From 1eaf08fa44ab4b34588c829ef73ec86cdb6833b8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Mar 2026 21:10:24 +0000 Subject: [PATCH 1/2] feat: add a new Waypoint source to accept a token that identifies a Navigation Point obtained from the `SearchDestinations` method of the Geocoding API docs: regenerated documentation for fields PiperOrigin-RevId: 879699007 Source-Link: https://github.com/googleapis/googleapis/commit/67b1168230d46351fa05aaf11a20b32872339f92 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3a6dbf11bc9963b66dae1d057e35a027ea9a6827 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiM2E2ZGJmMTFiYzk5NjNiNjZkYWUxZDA1N2UzNWEwMjdlYTlhNjgyNyJ9 --- .../google-maps-routing/.eslintignore | 7 + .../google-maps-routing/.eslintrc.json | 3 + .../google-maps-routing/.gitattributes | 4 + .../google-maps-routing/.gitignore | 14 + owl-bot-staging/google-maps-routing/.jsdoc.js | 55 + .../google-maps-routing/.mocharc.js | 33 + owl-bot-staging/google-maps-routing/.nycrc | 24 + .../google-maps-routing/.prettierignore | 6 + .../google-maps-routing/.prettierrc.js | 22 + .../google-maps-routing/CODE_OF_CONDUCT.md | 94 + .../google-maps-routing/CONTRIBUTING.md | 76 + owl-bot-staging/google-maps-routing/LICENSE | 202 + owl-bot-staging/google-maps-routing/README.md | 115 + .../protos/google/geo/type/viewport.proto | 69 + .../maps/routing/v2/fallback_info.proto | 73 + .../maps/routing/v2/geocoding_results.proto | 71 + .../maps/routing/v2/localized_time.proto | 39 + .../google/maps/routing/v2/location.proto | 43 + .../google/maps/routing/v2/maneuver.proto | 93 + .../routing/v2/navigation_instruction.proto | 40 + .../google/maps/routing/v2/polyline.proto | 73 + .../maps/routing/v2/polyline_details.proto | 84 + .../protos/google/maps/routing/v2/route.proto | 416 + .../google/maps/routing/v2/route_label.proto | 49 + .../maps/routing/v2/route_modifiers.proto | 64 + .../maps/routing/v2/route_travel_mode.proto | 52 + .../maps/routing/v2/routes_service.proto | 540 + .../maps/routing/v2/routing_preference.proto | 57 + .../routing/v2/speed_reading_interval.proto | 59 + .../google/maps/routing/v2/toll_info.proto | 41 + .../google/maps/routing/v2/toll_passes.proto | 348 + .../maps/routing/v2/traffic_model.proto | 55 + .../google/maps/routing/v2/transit.proto | 160 + .../maps/routing/v2/transit_preferences.proto | 74 + .../protos/google/maps/routing/v2/units.proto | 39 + .../routing/v2/vehicle_emission_type.proto | 46 + .../google/maps/routing/v2/vehicle_info.proto | 36 + .../google/maps/routing/v2/waypoint.proto | 80 + .../google-maps-routing/protos/protos.d.ts | 13379 ++++++ .../google-maps-routing/protos/protos.js | 37043 ++++++++++++++++ .../google-maps-routing/protos/protos.json | 3546 ++ .../v2/routes.compute_route_matrix.js | 154 + .../generated/v2/routes.compute_routes.js | 199 + ...ippet_metadata_google.maps.routing.v2.json | 211 + .../google-maps-routing/src/index.ts | 27 + .../src/v2/gapic_metadata.json | 38 + .../google-maps-routing/src/v2/index.ts | 19 + .../src/v2/routes_client.ts | 706 + .../src/v2/routes_client_config.json | 34 + .../src/v2/routes_proto_list.json | 27 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 49 + .../test/gapic_routes_v2.ts | 410 + .../google-maps-routing/tsconfig.json | 22 + .../google-maps-routing/webpack.config.js | 64 + 56 files changed, 59343 insertions(+) create mode 100644 owl-bot-staging/google-maps-routing/.eslintignore create mode 100644 owl-bot-staging/google-maps-routing/.eslintrc.json create mode 100644 owl-bot-staging/google-maps-routing/.gitattributes create mode 100644 owl-bot-staging/google-maps-routing/.gitignore create mode 100644 owl-bot-staging/google-maps-routing/.jsdoc.js create mode 100644 owl-bot-staging/google-maps-routing/.mocharc.js create mode 100644 owl-bot-staging/google-maps-routing/.nycrc create mode 100644 owl-bot-staging/google-maps-routing/.prettierignore create mode 100644 owl-bot-staging/google-maps-routing/.prettierrc.js create mode 100644 owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-maps-routing/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-maps-routing/LICENSE create mode 100644 owl-bot-staging/google-maps-routing/README.md create mode 100644 owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto create mode 100644 owl-bot-staging/google-maps-routing/protos/protos.d.ts create mode 100644 owl-bot-staging/google-maps-routing/protos/protos.js create mode 100644 owl-bot-staging/google-maps-routing/protos/protos.json create mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js create mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js create mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json create mode 100644 owl-bot-staging/google-maps-routing/src/index.ts create mode 100644 owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-maps-routing/src/v2/index.ts create mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_client.ts create mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json create mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json create mode 100644 owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-maps-routing/system-test/install.ts create mode 100644 owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts create mode 100644 owl-bot-staging/google-maps-routing/tsconfig.json create mode 100644 owl-bot-staging/google-maps-routing/webpack.config.js diff --git a/owl-bot-staging/google-maps-routing/.eslintignore b/owl-bot-staging/google-maps-routing/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-maps-routing/.eslintrc.json b/owl-bot-staging/google-maps-routing/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-maps-routing/.gitattributes b/owl-bot-staging/google-maps-routing/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-maps-routing/.gitignore b/owl-bot-staging/google-maps-routing/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-maps-routing/.jsdoc.js b/owl-bot-staging/google-maps-routing/.jsdoc.js new file mode 100644 index 00000000000..1f1b0bb81da --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +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 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@googlemaps/routing', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-maps-routing/.mocharc.js b/owl-bot-staging/google-maps-routing/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-maps-routing/.nycrc b/owl-bot-staging/google-maps-routing/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/.prettierignore b/owl-bot-staging/google-maps-routing/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-maps-routing/.prettierrc.js b/owl-bot-staging/google-maps-routing/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md b/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/CONTRIBUTING.md b/owl-bot-staging/google-maps-routing/CONTRIBUTING.md new file mode 100644 index 00000000000..bbced25792a --- /dev/null +++ b/owl-bot-staging/google-maps-routing/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 Routing 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=routes.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/LICENSE b/owl-bot-staging/google-maps-routing/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-maps-routing/README.md b/owl-bot-staging/google-maps-routing/README.md new file mode 100644 index 00000000000..22177e6eebd --- /dev/null +++ b/owl-bot-staging/google-maps-routing/README.md @@ -0,0 +1,115 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Routes API: Nodejs Client][homepage] + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + +[![npm version](https://img.shields.io/npm/v/@googlemaps/routing.svg)](https://www.npmjs.org/package/@googlemaps/routing) + +Routes API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Routes API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/routing/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Routes API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @googlemaps/routing +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| compute route matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | +| compute routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | +| maps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json) | + + +## 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/routing@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routes.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing diff --git a/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto b/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto new file mode 100644 index 00000000000..08c0cce8cfc --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.geo.type; + +import "google/type/latlng.proto"; + +option go_package = "google.golang.org/genproto/googleapis/geo/type/viewport;viewport"; +option java_multiple_files = true; +option java_outer_classname = "ViewportProto"; +option java_package = "com.google.geo.type"; +option objc_class_prefix = "GGTP"; + +// A latitude-longitude viewport, represented as two diagonally opposite `low` +// and `high` points. A viewport is considered a closed region, i.e. it includes +// its boundary. The latitude bounds must range between -90 to 90 degrees +// inclusive, and the longitude bounds must range between -180 to 180 degrees +// inclusive. Various cases include: +// +// - If `low` = `high`, the viewport consists of that single point. +// +// - If `low.longitude` > `high.longitude`, the longitude range is inverted +// (the viewport crosses the 180 degree longitude line). +// +// - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, +// the viewport includes all longitudes. +// +// - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, +// the longitude range is empty. +// +// - If `low.latitude` > `high.latitude`, the latitude range is empty. +// +// Both `low` and `high` must be populated, and the represented box cannot be +// empty (as specified by the definitions above). An empty viewport will result +// in an error. +// +// For example, this viewport fully encloses New York City: +// +// { +// "low": { +// "latitude": 40.477398, +// "longitude": -74.259087 +// }, +// "high": { +// "latitude": 40.91618, +// "longitude": -73.70018 +// } +// } +message Viewport { + // Required. The low point of the viewport. + google.type.LatLng low = 1; + + // Required. The high point of the viewport. + google.type.LatLng high = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto new file mode 100644 index 00000000000..a0ef20364bb --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "FallbackInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Information related to how and why a fallback result was used. If this field +// is set, then it means the server used a different routing mode from your +// preferred mode as fallback. +message FallbackInfo { + // Routing mode used for the response. If fallback was triggered, the mode + // may be different from routing preference set in the original client + // request. + FallbackRoutingMode routing_mode = 1; + + // The reason why fallback response was used instead of the original response. + // This field is only populated when the fallback mode is triggered and the + // fallback response is returned. + FallbackReason reason = 2; +} + +// Reasons for using fallback response. +enum FallbackReason { + // No fallback reason specified. + FALLBACK_REASON_UNSPECIFIED = 0; + + // A server error happened while calculating routes with your preferred + // routing mode, but we were able to return a result calculated by an + // alternative mode. + SERVER_ERROR = 1; + + // We were not able to finish the calculation with your preferred routing mode + // on time, but we were able to return a result calculated by an alternative + // mode. + LATENCY_EXCEEDED = 2; +} + +// Actual routing mode used for returned fallback response. +enum FallbackRoutingMode { + // Not used. + FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; + + // Indicates the `TRAFFIC_UNAWARE` + // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to + // compute the response. + FALLBACK_TRAFFIC_UNAWARE = 1; + + // Indicates the `TRAFFIC_AWARE` + // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to + // compute the response. + FALLBACK_TRAFFIC_AWARE = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto new file mode 100644 index 00000000000..70ba902ab3a --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "GeocodingResultsProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Contains [`GeocodedWaypoints`][google.maps.routing.v2.GeocodedWaypoint] for +// origin, destination and intermediate waypoints. Only populated for address +// waypoints. +message GeocodingResults { + // Origin geocoded waypoint. + GeocodedWaypoint origin = 1; + + // Destination geocoded waypoint. + GeocodedWaypoint destination = 2; + + // A list of intermediate geocoded waypoints each containing an index field + // that corresponds to the zero-based position of the waypoint in the order + // they were specified in the request. + repeated GeocodedWaypoint intermediates = 3; +} + +// Details about the locations used as waypoints. Only populated for address +// waypoints. Includes details about the geocoding results for the purposes of +// determining what the address was geocoded to. +message GeocodedWaypoint { + // Indicates the status code resulting from the geocoding operation. + google.rpc.Status geocoder_status = 1; + + // The index of the corresponding intermediate waypoint in the request. + // Only populated if the corresponding waypoint is an intermediate + // waypoint. + optional int32 intermediate_waypoint_request_index = 2; + + // The type(s) of the result, in the form of zero or more type tags. + // Supported types: [Address types and address component + // types](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types). + repeated string type = 3; + + // Indicates that the geocoder did not return an exact match for the original + // request, though it was able to match part of the requested address. You may + // wish to examine the original request for misspellings and/or an incomplete + // address. + bool partial_match = 4; + + // The place ID for this result. + string place_id = 5; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto new file mode 100644 index 00000000000..7ec111af21b --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/type/localized_text.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "LocalizedTimeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Localized description of time. +message LocalizedTime { + // The time specified as a string in a given time zone. + google.type.LocalizedText time = 1; + + // Contains the time zone. The value is the name of the time zone as defined + // in the [IANA Time Zone Database](http://www.iana.org/time-zones), e.g. + // "America/New_York". + string time_zone = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto new file mode 100644 index 00000000000..88ca2a6f1f2 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto @@ -0,0 +1,43 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/protobuf/wrappers.proto"; +import "google/type/latlng.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// 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 specifies the side of the road 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, and so on. You can use this field only for + // `DRIVE` and `TWO_WHEELER` + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + google.protobuf.Int32Value heading = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto new file mode 100644 index 00000000000..13bb3e0b0b1 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "ManeuverProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the navigation action to take for the current +// step (for example, turn left, merge, or straight). +enum Maneuver { + // Not used. + MANEUVER_UNSPECIFIED = 0; + + // Turn slightly to the left. + TURN_SLIGHT_LEFT = 1; + + // Turn sharply to the left. + TURN_SHARP_LEFT = 2; + + // Make a left u-turn. + UTURN_LEFT = 3; + + // Turn left. + TURN_LEFT = 4; + + // Turn slightly to the right. + TURN_SLIGHT_RIGHT = 5; + + // Turn sharply to the right. + TURN_SHARP_RIGHT = 6; + + // Make a right u-turn. + UTURN_RIGHT = 7; + + // Turn right. + TURN_RIGHT = 8; + + // Go straight. + STRAIGHT = 9; + + // Take the left ramp. + RAMP_LEFT = 10; + + // Take the right ramp. + RAMP_RIGHT = 11; + + // Merge into traffic. + MERGE = 12; + + // Take the left fork. + FORK_LEFT = 13; + + // Take the right fork. + FORK_RIGHT = 14; + + // Take the ferry. + FERRY = 15; + + // Take the train leading onto the ferry. + FERRY_TRAIN = 16; + + // Turn left at the roundabout. + ROUNDABOUT_LEFT = 17; + + // Turn right at the roundabout. + ROUNDABOUT_RIGHT = 18; + + // Initial maneuver. + DEPART = 19; + + // Used to indicate a street name change. + NAME_CHANGE = 20; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto new file mode 100644 index 00000000000..e944e88f111 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/maps/routing/v2/maneuver.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "NavigationInstructionProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates navigation instructions for a +// [`RouteLegStep`][google.maps.routing.v2.RouteLegStep]. +message NavigationInstruction { + // Encapsulates the navigation instructions for the current step (for example, + // turn left, merge, or straight). This field determines which icon to + // display. + Maneuver maneuver = 1; + + // Instructions for navigating this step. + string instructions = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto new file mode 100644 index 00000000000..523f78a1f27 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.routing.v2; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "PolylineProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates an encoded polyline. +message Polyline { + // Encapsulates the type of polyline. Defaults to encoded_polyline. + oneof polyline_type { + // The string encoding of the polyline using the [polyline encoding + // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) + string encoded_polyline = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4). + google.protobuf.Struct geo_json_linestring = 2; + } +} + +// A set of values that specify the quality of the polyline. +enum PolylineQuality { + // No polyline quality preference specified. Defaults to `OVERVIEW`. + POLYLINE_QUALITY_UNSPECIFIED = 0; + + // Specifies a high-quality polyline - which is composed using more points + // than `OVERVIEW`, at the cost of increased response size. Use this value + // when you need more precision. + HIGH_QUALITY = 1; + + // Specifies an overview polyline - which is composed using a small number of + // points. Use this value when displaying an overview of the route. Using this + // option has a lower request latency compared to using the + // `HIGH_QUALITY` option. + OVERVIEW = 2; +} + +// Specifies the preferred type of polyline to be returned. +enum PolylineEncoding { + // No polyline type preference specified. Defaults to `ENCODED_POLYLINE`. + POLYLINE_ENCODING_UNSPECIFIED = 0; + + // Specifies a polyline encoded using the [polyline encoding + // algorithm](/maps/documentation/utilities/polylinealgorithm). + ENCODED_POLYLINE = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + GEO_JSON_LINESTRING = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto new file mode 100644 index 00000000000..a56da6c86aa --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.routing.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "PolylineDetailsProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Details corresponding to a given index or contiguous segment of a polyline. +// Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the +// `PolylineDetails` defines an interval and associated metadata. +message PolylineDetails { + // Encapsulates the start and end indexes for a polyline detail. + // For instances where the data corresponds to a single point, `start_index` + // and `end_index` will be equal. + message PolylinePointIndex { + // The start index of this detail in the polyline. + optional int32 start_index = 1; + + // The end index of this detail in the polyline. + optional int32 end_index = 2; + } + + // Encapsulates the states of road features along a stretch of polyline. + enum RoadFeatureState { + // The road feature's state was not computed (default value). + ROAD_FEATURE_STATE_UNSPECIFIED = 0; + + // The road feature exists. + EXISTS = 1; + + // The road feature does not exist. + DOES_NOT_EXIST = 2; + } + + // Encapsulates information about flyovers along the polyline. + message FlyoverInfo { + // Output only. Denotes whether a flyover exists for a given stretch of the + // polyline. + RoadFeatureState flyover_presence = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The location of flyover related information along the polyline. + PolylinePointIndex polyline_point_index = 2; + } + + // Encapsulates information about narrow roads along the polyline. + message NarrowRoadInfo { + // Output only. Denotes whether a narrow road exists for a given stretch of + // the polyline. + RoadFeatureState narrow_road_presence = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The location of narrow road related information along the polyline. + PolylinePointIndex polyline_point_index = 2; + } + + // Flyover details along the polyline. + repeated FlyoverInfo flyover_info = 12; + + // Narrow road details along the polyline. + repeated NarrowRoadInfo narrow_road_info = 13; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto new file mode 100644 index 00000000000..42d73042fac --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto @@ -0,0 +1,416 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/geo/type/viewport.proto"; +import "google/maps/routing/v2/localized_time.proto"; +import "google/maps/routing/v2/location.proto"; +import "google/maps/routing/v2/navigation_instruction.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/polyline_details.proto"; +import "google/maps/routing/v2/route_label.proto"; +import "google/maps/routing/v2/route_travel_mode.proto"; +import "google/maps/routing/v2/speed_reading_interval.proto"; +import "google/maps/routing/v2/toll_info.proto"; +import "google/maps/routing/v2/transit.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/localized_text.proto"; +import "google/type/money.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Contains a route, which consists of a series of connected road segments +// that join beginning, ending, and intermediate waypoints. +message Route { + // Text representations of certain properties. + message RouteLocalizedValues { + // Travel distance represented in text form. + google.type.LocalizedText distance = 1; + + // Duration, represented in text form and localized to the region of the + // query. Takes traffic conditions into consideration. Note: If you did not + // request traffic information, this value is the same value as + // `static_duration`. + google.type.LocalizedText duration = 2; + + // Duration without taking traffic conditions into consideration, + // represented in text form. + google.type.LocalizedText static_duration = 3; + + // Transit fare represented in text form. + google.type.LocalizedText transit_fare = 4; + } + + // Labels for the `Route` that are useful to identify specific properties + // of the route to compare against others. + repeated RouteLabel route_labels = 13; + + // A collection of legs (path segments between waypoints) that make up the + // route. Each leg corresponds to the trip between two non-`via` + // [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with + // no intermediate waypoints has only one leg. A route that includes one + // non-`via` intermediate waypoint has two legs. A route that includes one + // `via` intermediate waypoint has one leg. The order of the legs matches the + // order of waypoints from `origin` to `intermediates` to `destination`. + repeated RouteLeg legs = 1; + + // The travel distance of the route, in meters. + int32 distance_meters = 2; + + // The length of time needed to navigate the route. If you set the + // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If you set the `routing_preference` to either + // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated + // taking traffic conditions into account. + google.protobuf.Duration duration = 3; + + // The duration of travel through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 4; + + // The overall route polyline. This polyline is the combined polyline of + // all `legs`. + Polyline polyline = 5; + + // A description of the route. + string description = 6; + + // An array of warnings to show when displaying the route. + repeated string warnings = 7; + + // The viewport bounding box of the polyline. + google.geo.type.Viewport viewport = 8; + + // Additional information about the route. + RouteTravelAdvisory travel_advisory = 9; + + // If you set + // [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] + // to true, this field contains the optimized ordering of intermediate + // waypoints. Otherwise, this field is empty. + // For example, if you give an input of Origin: LA; Intermediate waypoints: + // Dallas, Bangor, Phoenix; Destination: New York; and the optimized + // intermediate waypoint order is Phoenix, Dallas, Bangor, then this field + // contains the values [2, 0, 1]. The index starts with 0 for the first + // intermediate waypoint provided in the input. + repeated int32 optimized_intermediate_waypoint_index = 10; + + // Text representations of properties of the `Route`. + RouteLocalizedValues localized_values = 11; + + // An opaque token that can be passed to [Navigation + // SDK](https://developers.google.com/maps/documentation/mobility/driver-sdk/navigation) + // to reconstruct the route during navigation, and, in the event of rerouting, + // honor the original intention when the route was created. Treat this token + // as an opaque blob. Don't compare its value across requests as its value + // may change even if the service returns the exact same route. + // + // NOTE: `Route.route_token` is only available for requests that have set + // `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests + // that have Via waypoints. + string route_token = 12; + + // Contains information about details along the polyline. + PolylineDetails polyline_details = 14; +} + +// Contains the additional information that the user should be informed +// about, such as possible traffic zone restrictions. +message RouteTravelAdvisory { + // Contains information about tolls on the route. This field is only populated + // if tolls are expected on the route and `TOLLS` is included in the request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // If this field is set, but the `estimatedPrice` subfield is not populated, + // then the route contains tolls, but the estimated price is unknown. If + // `toll_info` is not set, then there are no tolls expected on the route. + TollInfo toll_info = 2; + + // Speed reading intervals indicating traffic density. This field is only + // populated for requests when the request has a `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL` + // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] + // value, and `TRAFFIC_ON_POLYLINE` is included in the + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // The intervals cover the entire polyline of the route without overlap. The + // start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 3; + + // The predicted fuel consumption in microliters. + // This field is only populated when `FUEL_CONSUMPTION` is included in the + // request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + int64 fuel_consumption_microliters = 5; + + // Returned route may have restrictions that are not suitable for requested + // travel mode or route modifiers. + bool route_restrictions_partially_ignored = 6; + + // If present, contains the total fare or ticket costs on this route + // This property is only returned for `TRANSIT` requests and only + // for routes where fare information is available for all transit steps. + google.type.Money transit_fare = 7; +} + +// Contains the additional information that the user should be informed +// about on a leg step, such as possible traffic zone restrictions. +message RouteLegTravelAdvisory { + // Contains information about tolls on the specific `RouteLeg`. + // This field is only populated if we expect there are tolls on the + // `RouteLeg` and `TOLLS` is included in the request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // If this field is set but the estimated_price subfield is not + // populated, we expect that road contains tolls but we do not know an + // estimated price. If `toll_info` does not exist, then there is no toll on + // the `RouteLeg`. + TollInfo toll_info = 1; + + // Speed reading intervals indicating traffic density. This field is only + // populated for requests when the request has a `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL` + // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] + // value, and `TRAFFIC_ON_POLYLINE` is included in the + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // The intervals cover the entire polyline of the `RouteLeg` without overlap. + // The start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 2; +} + +// Contains the additional information that the user should be informed +// about, such as possible traffic zone restrictions on a leg step. +message RouteLegStepTravelAdvisory { + // NOTE: This field is not currently populated. + repeated SpeedReadingInterval speed_reading_intervals = 1; +} + +// Contains a segment between non-`via` waypoints. +message RouteLeg { + // Text representations of certain properties. + message RouteLegLocalizedValues { + // Travel distance represented in text form. + google.type.LocalizedText distance = 1; + + // Duration, represented in text form and localized to the region of the + // query. Takes traffic conditions into consideration. Note: If you did not + // request traffic information, this value is the same value as + // static_duration. + google.type.LocalizedText duration = 2; + + // Duration without taking traffic conditions into + // consideration, represented in text form. + google.type.LocalizedText static_duration = 3; + } + + // Provides overview information about a list of `RouteLegStep`s. + message StepsOverview { + // Provides summarized information about different multi-modal segments of + // the `RouteLeg.steps`. A multi-modal segment is defined as one or more + // contiguous `RouteLegStep` that have the same `RouteTravelMode`. + // This field is not populated if the `RouteLeg` does not contain any + // multi-modal segments in the steps. + message MultiModalSegment { + // The corresponding `RouteLegStep` index that is the start of a + // multi-modal segment. + optional int32 step_start_index = 1; + + // The corresponding `RouteLegStep` index that is the end of a + // multi-modal segment. + optional int32 step_end_index = 2; + + // NavigationInstruction for the multi-modal segment. + NavigationInstruction navigation_instruction = 3; + + // The travel mode of the multi-modal segment. + RouteTravelMode travel_mode = 4; + } + + // Summarized information about different multi-modal segments of + // the `RouteLeg.steps`. This field is not populated if the `RouteLeg` does + // not contain any multi-modal segments in the steps. + repeated MultiModalSegment multi_modal_segments = 1; + } + + // The travel distance of the route leg, in meters. + int32 distance_meters = 1; + + // The length of time needed to navigate the leg. If the `route_preference` + // is set to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic + // conditions into account. + google.protobuf.Duration duration = 2; + + // The duration of travel through the leg, calculated without taking + // traffic conditions into consideration. + google.protobuf.Duration static_duration = 3; + + // The overall polyline for this leg that includes each `step`'s + // polyline. + Polyline polyline = 4; + + // The start location of this leg. This location might be different from the + // provided `origin`. For example, when the provided `origin` is not near a + // road, this is a point on the road. + Location start_location = 5; + + // The end location of this leg. This location might be different from the + // provided `destination`. For example, when the provided `destination` is not + // near a road, this is a point on the road. + Location end_location = 6; + + // An array of steps denoting segments within this leg. Each step represents + // one navigation instruction. + repeated RouteLegStep steps = 7; + + // Contains the additional information that the user should be informed + // about, such as possible traffic zone restrictions, on a route leg. + RouteLegTravelAdvisory travel_advisory = 8; + + // Text representations of properties of the `RouteLeg`. + RouteLegLocalizedValues localized_values = 9; + + // Overview information about the steps in this `RouteLeg`. This field is only + // populated for TRANSIT routes. + StepsOverview steps_overview = 10; +} + +// Contains a segment of a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. A +// step corresponds to a single navigation instruction. Route legs are made up +// of steps. +message RouteLegStep { + // Text representations of certain properties. + message RouteLegStepLocalizedValues { + // Travel distance represented in text form. + google.type.LocalizedText distance = 1; + + // Duration without taking traffic conditions into + // consideration, represented in text form. + google.type.LocalizedText static_duration = 3; + } + + // The travel distance of this step, in meters. In some circumstances, this + // field might not have a value. + int32 distance_meters = 1; + + // The duration of travel through this step without taking traffic conditions + // into consideration. In some circumstances, this field might not have a + // value. + google.protobuf.Duration static_duration = 2; + + // The polyline associated with this step. + Polyline polyline = 3; + + // The start location of this step. + Location start_location = 4; + + // The end location of this step. + Location end_location = 5; + + // Navigation instructions. + NavigationInstruction navigation_instruction = 6; + + // Contains the additional information that the user should be informed + // about, such as possible traffic zone restrictions, on a leg step. + RouteLegStepTravelAdvisory travel_advisory = 7; + + // Text representations of properties of the `RouteLegStep`. + RouteLegStepLocalizedValues localized_values = 8; + + // Details pertaining to this step if the travel mode is `TRANSIT`. + RouteLegStepTransitDetails transit_details = 9; + + // The travel mode used for this step. + RouteTravelMode travel_mode = 10; +} + +// Additional information for the `RouteLegStep` related to `TRANSIT` routes. +message RouteLegStepTransitDetails { + // Details about the transit stops for the `RouteLegStep`. + message TransitStopDetails { + // Information about the arrival stop for the step. + TransitStop arrival_stop = 1; + + // The estimated time of arrival for the step. + google.protobuf.Timestamp arrival_time = 2; + + // Information about the departure stop for the step. + TransitStop departure_stop = 3; + + // The estimated time of departure for the step. + google.protobuf.Timestamp departure_time = 4; + } + + // Localized descriptions of values for `RouteTransitDetails`. + message TransitDetailsLocalizedValues { + // Time in its formatted text representation with a corresponding time zone. + LocalizedTime arrival_time = 1; + + // Time in its formatted text representation with a corresponding time zone. + LocalizedTime departure_time = 2; + } + + // Information about the arrival and departure stops for the step. + TransitStopDetails stop_details = 1; + + // Text representations of properties of the `RouteLegStepTransitDetails`. + TransitDetailsLocalizedValues localized_values = 2; + + // Specifies the direction in which to travel on this line as marked on + // the vehicle or at the departure stop. The direction is often the terminus + // station. + string headsign = 3; + + // Specifies the expected time as a duration between departures from the same + // stop at this time. For example, with a headway seconds value of 600, you + // would expect a ten minute wait if you should miss your bus. + google.protobuf.Duration headway = 4; + + // Information about the transit line used in this step. + TransitLine transit_line = 5; + + // The number of stops from the departure to the arrival stop. This count + // includes the arrival stop, but excludes the departure stop. For example, if + // your route leaves from Stop A, passes through stops B and C, and arrives at + // stop D, stop_count returns 3. + int32 stop_count = 6; + + // The text that appears in schedules and sign boards to identify a transit + // trip to passengers. The text should uniquely identify a trip within a + // service day. For example, "538" is the `trip_short_text` of the Amtrak + // train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. + string trip_short_text = 7; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto new file mode 100644 index 00000000000..c88c941b6b1 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteLabelProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Labels for the [`Route`][google.maps.routing.v2.Route] that are useful to +// identify specific properties of the route to compare against others. +enum RouteLabel { + // Default - not used. + ROUTE_LABEL_UNSPECIFIED = 0; + + // The default "best" route returned for the route computation. + DEFAULT_ROUTE = 1; + + // An alternative to the default "best" route. Routes like this will be + // returned when + // [`compute_alternative_routes`][google.maps.routing.v2.ComputeRoutesRequest.compute_alternative_routes] + // is specified. + DEFAULT_ROUTE_ALTERNATE = 2; + + // Fuel efficient route. Routes labeled with this value are determined to be + // optimized for Eco parameters such as fuel consumption. + FUEL_EFFICIENT = 3; + + // Shorter travel distance route. This is an experimental feature. + SHORTER_DISTANCE = 4; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto new file mode 100644 index 00000000000..512bdd0d766 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/maps/routing/v2/toll_passes.proto"; +import "google/maps/routing/v2/vehicle_info.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteModifiersProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a set of optional conditions to satisfy when calculating the +// routes. +message RouteModifiers { + // When set to true, avoids toll roads where reasonable, giving preference to + // routes not containing toll roads. Applies only to the `DRIVE` and + // `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + bool avoid_tolls = 1; + + // When set to true, avoids highways where reasonable, giving preference to + // routes not containing highways. Applies only to the `DRIVE` and + // `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + bool avoid_highways = 2; + + // When set to true, avoids ferries where reasonable, giving preference to + // routes not containing ferries. Applies only to the `DRIVE` and`TWO_WHEELER` + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + bool avoid_ferries = 3; + + // When set to true, avoids navigating indoors where reasonable, giving + // preference to routes not containing indoor navigation. Applies only to the + // `WALK` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + bool avoid_indoor = 4; + + // Specifies the vehicle information. + VehicleInfo vehicle_info = 5; + + // Encapsulates information about toll passes. + // If toll passes are provided, the API tries to return the pass price. If + // toll passes are not provided, the API treats the toll pass as unknown and + // tries to return the cash price. + // Applies only to the `DRIVE` and `TWO_WHEELER` + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + repeated TollPass toll_passes = 6; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto new file mode 100644 index 00000000000..f43b50adbc8 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto @@ -0,0 +1,52 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RouteTravelModeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values used to specify the mode of travel. +// NOTE: `WALK`, `BICYCLE`, and `TWO_WHEELER` routes are in beta and might +// sometimes be missing clear sidewalks, pedestrian paths, or bicycling paths. +// You must display this warning to the user for all walking, bicycling, and +// two-wheel routes that you display in your app. +enum RouteTravelMode { + // No travel mode specified. Defaults to `DRIVE`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel by passenger car. + DRIVE = 1; + + // Travel by bicycle. + BICYCLE = 2; + + // Travel by walking. + WALK = 3; + + // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this + // differs from the `BICYCLE` travel mode which covers human-powered mode. + TWO_WHEELER = 4; + + // Travel by public transit routes, where available. + TRANSIT = 7; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto new file mode 100644 index 00000000000..ae7a21e616f --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto @@ -0,0 +1,540 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/maps/routing/v2/fallback_info.proto"; +import "google/maps/routing/v2/geocoding_results.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/route.proto"; +import "google/maps/routing/v2/route_modifiers.proto"; +import "google/maps/routing/v2/route_travel_mode.proto"; +import "google/maps/routing/v2/routing_preference.proto"; +import "google/maps/routing/v2/traffic_model.proto"; +import "google/maps/routing/v2/transit_preferences.proto"; +import "google/maps/routing/v2/units.proto"; +import "google/maps/routing/v2/waypoint.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/localized_text.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RoutesServiceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// The Routes API. +service Routes { + option (google.api.default_host) = "routes.googleapis.com"; + + // Returns the primary route along with optional alternate routes, given a set + // of terminal and intermediate waypoints. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using URL parameter + // `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` + // (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters)). The value + // is a comma separated list of field paths. See detailed documentation about + // [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of Route-level duration, distance, and polyline (an example + // production setup): + // `X-Goog-FieldMask: + // routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` + // + // Google discourage the use of the wildcard (`*`) response field mask, or + // specifying the field mask at the top level (`routes`), because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need + // in your production job ensures stable latency performance. We might add + // more response fields in the future, and those new fields might require + // extra computation time. If you select all fields, or if you select all + // fields at the top level, then you might experience performance degradation + // because any new field we add will be automatically included in the + // response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRoutes(ComputeRoutesRequest) returns (ComputeRoutesResponse) { + option (google.api.http) = { + post: "/directions/v2:computeRoutes" + body: "*" + }; + } + + // Takes in a list of origins and destinations and returns a stream containing + // route information for each combination of origin and destination. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using the URL + // parameter `$fields` or `fields`, or by using the HTTP/gRPC header + // `X-Goog-FieldMask` (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters)). + // The value is a comma separated list of field paths. See this detailed + // documentation about [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of route durations, distances, element status, condition, and + // element indices (an example production setup): + // `X-Goog-FieldMask: + // originIndex,destinationIndex,status,condition,distanceMeters,duration` + // + // It is critical that you include `status` in your field mask as otherwise + // all messages will appear to be OK. Google discourages the use of the + // wildcard (`*`) response field mask, because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need in your production job ensures + // stable latency performance. We might add more response fields in the + // future, and those new fields might require extra computation time. If you + // select all fields, or if you select all fields at the top level, then you + // might experience performance degradation because any new field we add will + // be automatically included in the response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) + returns (stream RouteMatrixElement) { + option (google.api.http) = { + post: "/distanceMatrix/v2:computeRouteMatrix" + body: "*" + }; + } +} + +// ComputeRoutes request message. +message ComputeRoutesRequest { + // A supported reference route on the ComputeRoutesRequest. + enum ReferenceRoute { + // Not used. Requests containing this value fail. + REFERENCE_ROUTE_UNSPECIFIED = 0; + + // Fuel efficient route. + FUEL_EFFICIENT = 1; + + // Route with shorter travel distance. This is an experimental feature. + // + // For `DRIVE` requests, this feature prioritizes shorter distance over + // driving comfort. For example, it may prefer local roads instead of + // highways, take dirt roads, cut through parking lots, etc. This feature + // does not return any maneuvers that Google Maps knows to be illegal. + // + // For `BICYCLE` and `TWO_WHEELER` requests, this feature returns routes + // similar to those returned when you don't specify + // `requested_reference_routes`. + // + // This feature is not compatible with any other travel modes, via + // intermediate waypoints, or `optimize_waypoint_order`; such requests will + // fail. However, you can use it with any `routing_preference`. + SHORTER_DISTANCE = 2; + } + + // Extra computations to perform while completing the request. + enum ExtraComputation { + // Not used. Requests containing this value will fail. + EXTRA_COMPUTATION_UNSPECIFIED = 0; + + // Toll information for the route(s). + TOLLS = 1; + + // Estimated fuel consumption for the route(s). + FUEL_CONSUMPTION = 2; + + // Traffic aware polylines for the route(s). + TRAFFIC_ON_POLYLINE = 3; + + // [`NavigationInstructions`](google.maps.routing.v2.NavigationInstructions.instructions) + // presented as a formatted HTML text string. This content + // is meant to be read as-is. This content is for display only. + // Do not programmatically parse it. + HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4; + + // Flyover information for the route(s). The + // `routes.polyline_details.flyover_info` fieldmask must be specified to + // return this information. This data will only currently be populated for + // certain metros in India. This feature is experimental, and the + // SKU/charge is subject to change. + FLYOVER_INFO_ON_POLYLINE = 7; + + // Narrow road information for the route(s). The + // `routes.polyline_details.narrow_road_info` fieldmask must be specified + // to return this information. This data will only currently be populated + // for certain metros in India. This feature is experimental, and the + // SKU/charge is subject to change. + NARROW_ROAD_INFO_ON_POLYLINE = 8; + } + + // Required. Origin waypoint. + Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination waypoint. + Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of waypoints along the route (excluding terminal points), + // for either stopping at or passing by. Up to 25 intermediate waypoints are + // supported. + repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server + // attempts to use the selected routing preference to compute the route. If + // the routing preference results in an error or an extra long latency, then + // an error is returned. You can specify this option only when the + // `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + RoutingPreference routing_preference = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies your preference for the quality of the polyline. + PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the preferred encoding for the polyline. + PolylineEncoding polyline_encoding = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, then this value + // defaults to the time that you made the request. + // NOTE: You can only specify a `departure_time` in the past when + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to + // `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 + // days in the future. + google.protobuf.Timestamp departure_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The arrival time. + // NOTE: This field is ignored when requests specify a + // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] other than + // `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + // not both. Transit trips are available for up to 7 days in the past or 100 + // days in the future. + google.protobuf.Timestamp arrival_time = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether to calculate alternate routes in addition to + // the route. No alternative routes are returned for requests that have + // intermediate waypoints. + bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of conditions to satisfy that affect the way routes are + // calculated. + RouteModifiers route_modifiers = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see [Unicode Locale + // Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + // See [Language + // Support](https://developers.google.com/maps/faq#languagesupport) + // for the list of supported languages. When you don't provide this value, the + // display language is inferred from the location of the route request. + string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The region code, specified as a ccTLD ("top-level domain") + // two-character value. For more information see [Country code top-level + // domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + string region_code = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the units of measure for the display fields. These + // fields include the `instruction` field in + // [`NavigationInstruction`][google.maps.routing.v2.NavigationInstruction]. + // The units of measure used for the route, leg, step distance, and duration + // are not affected by this value. If you don't provide this value, then the + // display units are inferred from the location of the first origin. + Units units = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the service attempts to minimize the overall cost + // of the route by re-ordering the specified intermediate waypoints. The + // request fails if any of the intermediate waypoints is a `via` waypoint. Use + // `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to + // find the new ordering. + // If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is + // not requested in the `X-Goog-FieldMask` header, the request fails. + // If `optimize_waypoint_order` is set to false, + // `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be + // empty. + bool optimize_waypoint_order = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies what reference routes to calculate as part of the + // request in addition to the default route. A reference route is a route with + // a different route calculation objective than the default route. For example + // a `FUEL_EFFICIENT` reference route calculation takes into account various + // parameters that would generate an optimal fuel efficient route. When using + // this feature, look for + // [`route_labels`][google.maps.routing.v2.Route.route_labels] on the + // resulting routes. + repeated ReferenceRoute requested_reference_routes = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of extra computations which may be used to complete the + // request. Note: These extra computations may return extra fields on the + // response. These extra fields must also be specified in the field mask to be + // returned in the response. + repeated ExtraComputation extra_computations = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the assumptions to use when calculating time in + // traffic. This setting affects the value returned in the duration field in + // the + // [`Route`][google.maps.routing.v2.Route] and + // [`RouteLeg`][google.maps.routing.v2.RouteLeg] which contains the predicted + // time in traffic based on historical averages. + // `TrafficModel` is only available for requests that have set + // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to + // `TRAFFIC_AWARE_OPTIMAL` and + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. + // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + // specified. + TrafficModel traffic_model = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies preferences that influence the route returned for + // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to + // `TRANSIT`. + TransitPreferences transit_preferences = 20 + [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeRoutes the response message. +message ComputeRoutesResponse { + // Contains an array of computed routes (up to three) when you specify + // `compute_alternatives_routes`, and contains just one route when you don't. + // When this array contains multiple entries, the first one is the most + // recommended route. If the array is empty, then it means no route could be + // found. + repeated Route routes = 1; + + // In some cases when the server is not able to compute the route results with + // all of the input preferences, it may fallback to using a different way of + // computation. When fallback mode is used, this field contains detailed info + // about the fallback response. Otherwise this field is unset. + FallbackInfo fallback_info = 2; + + // Contains geocoding response info for waypoints specified as addresses. + GeocodingResults geocoding_results = 3; +} + +// ComputeRouteMatrix request message +message ComputeRouteMatrixRequest { + // Extra computations to perform while completing the request. + enum ExtraComputation { + // Not used. Requests containing this value will fail. + EXTRA_COMPUTATION_UNSPECIFIED = 0; + + // Toll information for the matrix element(s). + TOLLS = 1; + } + + // Required. Array of origins, which determines the rows of the response + // matrix. Several size restrictions apply to the cardinality of origins and + // destinations: + // + // * The sum of the number of origins + the number of destinations specified + // as either `place_id` or `address` must be no greater than 50. + // * The product of number of origins × number of destinations must be no + // greater than 625 in any case. + // * The product of the number of origins × number of destinations must be no + // greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + // * The product of the number of origins × number of destinations must be no + // greater than 100 if travel_mode is set to `TRANSIT`. + repeated RouteMatrixOrigin origins = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Array of destinations, which determines the columns of the + // response matrix. + repeated RouteMatrixDestination destinations = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server attempts to use + // the selected routing preference to compute the route. If the routing + // preference results in an error or an extra long latency, an error is + // returned. You can specify this option only when the `travel_mode` is + // `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + RoutingPreference routing_preference = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, then this value + // defaults to the time that you made the request. + // NOTE: You can only specify a `departure_time` in the past when + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to + // `TRANSIT`. + google.protobuf.Timestamp departure_time = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The arrival time. + // NOTE: Can only be set when + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to + // `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + // not both. + google.protobuf.Timestamp arrival_time = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see [Unicode Locale + // Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + // See [Language + // Support](https://developers.google.com/maps/faq#languagesupport) + // for the list of supported languages. When you don't provide this value, the + // display language is inferred from the location of the first origin. + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The region code, specified as a ccTLD ("top-level domain") + // two-character value. For more information see [Country code top-level + // domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + string region_code = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the units of measure for the display fields. + Units units = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of extra computations which may be used to complete the + // request. Note: These extra computations may return extra fields on the + // response. These extra fields must also be specified in the field mask to be + // returned in the response. + repeated ExtraComputation extra_computations = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the assumptions to use when calculating time in + // traffic. This setting affects the value returned in the duration field in + // the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which + // contains the predicted time in traffic based on historical averages. + // `TrafficModel` is only available for requests that have set + // [RoutingPreference][google.maps.routing.v2.RoutingPreference] to + // `TRAFFIC_AWARE_OPTIMAL` and + // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. + // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + // specified. + TrafficModel traffic_model = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies preferences that influence the route returned for + // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to + // `TRANSIT`. + TransitPreferences transit_preferences = 12 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A single origin for ComputeRouteMatrixRequest +message RouteMatrixOrigin { + // Required. Origin waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Modifiers for every route that takes this as the origin + RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A single destination for ComputeRouteMatrixRequest +message RouteMatrixDestination { + // Required. Destination waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains route information computed for an origin/destination pair in the +// ComputeRouteMatrix API. This proto can be streamed to the client. +message RouteMatrixElement { + // Text representations of certain properties. + message LocalizedValues { + // Travel distance represented in text form. + google.type.LocalizedText distance = 1; + + // Duration represented in text form taking traffic conditions into + // consideration. Note: If traffic information was not requested, this value + // is the same value as static_duration. + google.type.LocalizedText duration = 2; + + // Duration represented in text form without taking traffic conditions into + // consideration. + google.type.LocalizedText static_duration = 3; + + // Transit fare represented in text form. + google.type.LocalizedText transit_fare = 4; + } + + // Zero-based index of the origin in the request. + optional int32 origin_index = 1; + + // Zero-based index of the destination in the request. + optional int32 destination_index = 2; + + // Error status code for this element. + google.rpc.Status status = 3; + + // Indicates whether the route was found or not. Independent of status. + RouteMatrixElementCondition condition = 9; + + // The travel distance of the route, in meters. + int32 distance_meters = 4; + + // The length of time needed to navigate the route. If you set the + // [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference] + // to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If + // you set the `routing_preference` to either `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic + // conditions into account. + google.protobuf.Duration duration = 5; + + // The duration of traveling through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 6; + + // Additional information about the route. For example: restriction + // information and toll information + RouteTravelAdvisory travel_advisory = 7; + + // In some cases when the server is not able to compute the route with the + // given preferences for this particular origin/destination pair, it may + // fall back to using a different mode of computation. When fallback mode is + // used, this field contains detailed information about the fallback response. + // Otherwise this field is unset. + FallbackInfo fallback_info = 8; + + // Text representations of properties of the `RouteMatrixElement`. + LocalizedValues localized_values = 10; +} + +// The condition of the route being returned. +enum RouteMatrixElementCondition { + // Only used when the `status` of the element is not OK. + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; + + // A route was found, and the corresponding information was filled out for the + // element. + ROUTE_EXISTS = 1; + + // No route could be found. Fields containing route information, such as + // `distance_meters` or `duration`, will not be filled out in the element. + ROUTE_NOT_FOUND = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto new file mode 100644 index 00000000000..e64b59c17be --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto @@ -0,0 +1,57 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "RoutingPreferenceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify factors to take into consideration when +// calculating the route. +enum RoutingPreference { + // No routing preference specified. Default to `TRAFFIC_UNAWARE`. + ROUTING_PREFERENCE_UNSPECIFIED = 0; + + // Computes routes without taking live traffic conditions into consideration. + // Suitable when traffic conditions don't matter or are not applicable. + // Using this value produces the lowest latency. + // Note: For [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] + // `DRIVE` and `TWO_WHEELER`, the route and duration chosen are based on road + // network and average time-independent traffic conditions, not current road + // conditions. Consequently, routes may include roads that are temporarily + // closed. Results for a given + // request may vary over time due to changes in the road network, updated + // average traffic conditions, and the distributed nature of the service. + // Results may also vary between nearly-equivalent routes at any time or + // frequency. + TRAFFIC_UNAWARE = 1; + + // Calculates routes taking live traffic conditions into consideration. + // In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to + // significantly reduce latency. + TRAFFIC_AWARE = 2; + + // Calculates the routes taking live traffic conditions into consideration, + // without applying most performance optimizations. Using this value produces + // the highest latency. + TRAFFIC_AWARE_OPTIMAL = 3; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto new file mode 100644 index 00000000000..e95803ffec0 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto @@ -0,0 +1,59 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "SpeedReadingIntervalProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Traffic density indicator on a contiguous segment of a polyline or path. +// Given a path with points P_0, P_1, ... , P_N (zero-based index), the +// `SpeedReadingInterval` defines an interval and describes its traffic using +// the following categories. +message SpeedReadingInterval { + // The classification of polyline speed based on traffic data. + enum Speed { + // Default value. This value is unused. + SPEED_UNSPECIFIED = 0; + + // Normal speed, no traffic delays. + NORMAL = 1; + + // Slowdown detected, medium amount of traffic. + SLOW = 2; + + // Traffic delays. + TRAFFIC_JAM = 3; + } + + // The starting index of this interval in the polyline. + optional int32 start_polyline_point_index = 1; + + // The ending index of this interval in the polyline. + optional int32 end_polyline_point_index = 2; + + // The type of speed in this interval. + oneof speed_type { + // Traffic speed in this interval. + Speed speed = 3; + } +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto new file mode 100644 index 00000000000..b2296adeb3b --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto @@ -0,0 +1,41 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/type/money.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "TollInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates toll information on a [`Route`][google.maps.routing.v2.Route] or +// on a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. +message TollInfo { + // The monetary amount of tolls for the corresponding + // [`Route`][google.maps.routing.v2.Route] or + // [`RouteLeg`][google.maps.routing.v2.RouteLeg]. This list contains a money + // amount for each currency that is expected to be charged by the toll + // stations. Typically this list will contain only one item for routes with + // tolls in one currency. For international trips, this list may contain + // multiple items to reflect tolls in different currencies. + repeated google.type.Money estimated_price = 1; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto new file mode 100644 index 00000000000..ee2b94091a9 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto @@ -0,0 +1,348 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "TollPassesProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// List of toll passes around the world that we support. +enum TollPass { + // Not used. If this value is used, then the request fails. + TOLL_PASS_UNSPECIFIED = 0; + + // Sydney toll pass. See additional details at + // https://www.myetoll.com.au. + AU_ETOLL_TAG = 82; + + // Sydney toll pass. See additional details at https://www.tollpay.com.au. + AU_EWAY_TAG = 83; + + // Australia-wide toll pass. + // See additional details at https://www.linkt.com.au/. + AU_LINKT = 2; + + // Argentina toll pass. See additional details at https://telepase.com.ar + AR_TELEPASE = 3; + + // Brazil toll pass. See additional details at https://www.autoexpreso.com + BR_AUTO_EXPRESO = 81; + + // Brazil toll pass. See additional details at https://conectcar.com. + BR_CONECTCAR = 7; + + // Brazil toll pass. See additional details at https://movemais.com. + BR_MOVE_MAIS = 8; + + // Brazil toll pass. See additional details at https://pasorapido.gob.do/ + BR_PASSA_RAPIDO = 88; + + // Brazil toll pass. See additional details at https://www.semparar.com.br. + BR_SEM_PARAR = 9; + + // Brazil toll pass. See additional details at https://taggy.com.br. + BR_TAGGY = 10; + + // Brazil toll pass. See additional details at + // https://veloe.com.br/site/onde-usar. + BR_VELOE = 11; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_BLUE_WATER_EDGE_PASS = 18; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_CONNEXION = 19; + + // Canada to United States border crossing. + CA_US_NEXUS_CARD = 20; + + // Indonesia. + // E-card provided by multiple banks used to pay for tolls. All e-cards + // via banks are charged the same so only one enum value is needed. E.g. + // - Bank Mandiri https://www.bankmandiri.co.id/e-money + // - BCA https://www.bca.co.id/flazz + // - BNI https://www.bni.co.id/id-id/ebanking/tapcash + ID_E_TOLL = 16; + + // India. + IN_FASTAG = 78; + + // India, HP state plate exemption. + IN_LOCAL_HP_PLATE_EXEMPT = 79; + + // Japan + // ETC. Electronic wireless system to collect tolls. + // https://www.go-etc.jp/ + JP_ETC = 98; + + // Japan + // ETC2.0. New version of ETC with further discount and bidirectional + // communication between devices on vehicles and antennas on the road. + // https://www.go-etc.jp/etc2/index.html + JP_ETC2 = 99; + + // Mexico toll pass. + // https://iave.capufe.gob.mx/#/ + MX_IAVE = 90; + + // Mexico + // https://www.pase.com.mx + MX_PASE = 91; + + // Mexico + // https://operadoravial.com/quick-pass/ + MX_QUICKPASS = 93; + + // http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf + MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; + + // Mexico + MX_TAG_IAVE = 12; + + // Mexico toll pass company. One of many operating in Mexico City. See + // additional details at https://www.televia.com.mx. + MX_TAG_TELEVIA = 13; + + // Mexico toll pass company. One of many operating in Mexico City. + // https://www.televia.com.mx + MX_TELEVIA = 92; + + // Mexico toll pass. See additional details at + // https://www.viapass.com.mx/viapass/web_home.aspx. + MX_VIAPASS = 14; + + // AL, USA. + US_AL_FREEDOM_PASS = 21; + + // AK, USA. + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; + + // CA, USA. + US_CA_FASTRAK = 4; + + // Indicates driver has any FasTrak pass in addition to the DMV issued Clean + // Air Vehicle (CAV) sticker. + // https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml + US_CA_FASTRAK_CAV_STICKER = 86; + + // CO, USA. + US_CO_EXPRESSTOLL = 23; + + // CO, USA. + US_CO_GO_PASS = 24; + + // DE, USA. + US_DE_EZPASSDE = 25; + + // FL, USA. + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; + + // FL, USA. + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; + + // FL, USA. + US_FL_EPASS = 67; + + // FL, USA. + US_FL_GIBA_TOLL_PASS = 68; + + // FL, USA. + US_FL_LEEWAY = 69; + + // FL, USA. + US_FL_SUNPASS = 70; + + // FL, USA. + US_FL_SUNPASS_PRO = 71; + + // IL, USA. + US_IL_EZPASSIL = 73; + + // IL, USA. + US_IL_IPASS = 72; + + // IN, USA. + US_IN_EZPASSIN = 26; + + // KS, USA. + US_KS_BESTPASS_HORIZON = 27; + + // KS, USA. + US_KS_KTAG = 28; + + // KS, USA. + US_KS_NATIONALPASS = 29; + + // KS, USA. + US_KS_PREPASS_ELITEPASS = 30; + + // KY, USA. + US_KY_RIVERLINK = 31; + + // LA, USA. + US_LA_GEAUXPASS = 32; + + // LA, USA. + US_LA_TOLL_TAG = 33; + + // MA, USA. + US_MA_EZPASSMA = 6; + + // MD, USA. + US_MD_EZPASSMD = 34; + + // ME, USA. + US_ME_EZPASSME = 35; + + // MI, USA. + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; + + // MI, USA. + US_MI_BCPASS = 94; + + // MI, USA. + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; + + // MI, USA. + // Deprecated as this pass type no longer exists. + US_MI_IQ_PROX_CARD = 38 [deprecated = true]; + + // MI, USA. + US_MI_IQ_TAG = 95; + + // MI, USA. + US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; + + // MI, USA. + US_MI_NEXPRESS_TOLL = 40; + + // MN, USA. + US_MN_EZPASSMN = 41; + + // NC, USA. + US_NC_EZPASSNC = 42; + + // NC, USA. + US_NC_PEACH_PASS = 87; + + // NC, USA. + US_NC_QUICK_PASS = 43; + + // NH, USA. + US_NH_EZPASSNH = 80; + + // NJ, USA. + US_NJ_DOWNBEACH_EXPRESS_PASS = 75; + + // NJ, USA. + US_NJ_EZPASSNJ = 74; + + // NY, USA. + US_NY_EXPRESSPASS = 76; + + // NY, USA. + US_NY_EZPASSNY = 77; + + // OH, USA. + US_OH_EZPASSOH = 44; + + // PA, USA. + US_PA_EZPASSPA = 45; + + // RI, USA. + US_RI_EZPASSRI = 46; + + // SC, USA. + US_SC_PALPASS = 47; + + // TX, USA. + US_TX_AVI_TAG = 97; + + // TX, USA. + US_TX_BANCPASS = 48; + + // TX, USA. + US_TX_DEL_RIO_PASS = 49; + + // TX, USA. + US_TX_EFAST_PASS = 50; + + // TX, USA. + US_TX_EAGLE_PASS_EXPRESS_CARD = 51; + + // TX, USA. + US_TX_EPTOLL = 52; + + // TX, USA. + US_TX_EZ_CROSS = 53; + + // TX, USA. + US_TX_EZTAG = 54; + + // TX, USA. + US_TX_FUEGO_TAG = 96; + + // TX, USA. + US_TX_LAREDO_TRADE_TAG = 55; + + // TX, USA. + US_TX_PLUSPASS = 56; + + // TX, USA. + US_TX_TOLLTAG = 57; + + // TX, USA. + US_TX_TXTAG = 58; + + // TX, USA. + US_TX_XPRESS_CARD = 59; + + // UT, USA. + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; + + // VA, USA. + US_VA_EZPASSVA = 61; + + // WA, USA. + US_WA_BREEZEBY = 17; + + // WA, USA. + US_WA_GOOD_TO_GO = 1; + + // WV, USA. + US_WV_EZPASSWV = 62; + + // WV, USA. + US_WV_MEMORIAL_BRIDGE_TICKETS = 63; + + // WV, USA + US_WV_MOV_PASS = 100; + + // WV, USA. + US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto new file mode 100644 index 00000000000..d680e1c46c1 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "TrafficModelProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// This field specifies one of the following assumptions to use when calculating +// travel time in traffic conditions, shown in the enums below. Depending on the +// enum chosen, the `duration` field of the TrafficModel response will vary. The +// value contains the predicted time to destination in traffic, based on +// historical averages. `TrafficModel` is only available for requests that have +// set [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to +// `TRAFFIC_AWARE_OPTIMAL` and +// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. +enum TrafficModel { + // Unused. If specified, will default to `BEST_GUESS`. + TRAFFIC_MODEL_UNSPECIFIED = 0; + + // Indicates that the returned `duration` should be the best + // estimate of travel time given what is known about both historical traffic + // conditions and live traffic. Live traffic becomes more important the closer + // the `departure_time` is to now. + BEST_GUESS = 1; + + // Indicates that the returned duration should be longer than the + // actual travel time on most days, though occasional days with particularly + // bad traffic conditions may exceed this value. + PESSIMISTIC = 2; + + // Indicates that the returned duration should be shorter than the actual + // travel time on most days, though occasional days with particularly good + // traffic conditions may be faster than this value. + OPTIMISTIC = 3; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto new file mode 100644 index 00000000000..295a3203f73 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto @@ -0,0 +1,160 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/maps/routing/v2/location.proto"; +import "google/type/localized_text.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "TransitProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A transit agency that operates a transit line. +message TransitAgency { + // The name of this transit agency. + string name = 1; + + // The transit agency's locale-specific formatted phone number. + string phone_number = 2; + + // The transit agency's URI. + string uri = 3; +} + +// Contains information about the transit line used in this step. +message TransitLine { + // The transit agency (or agencies) that operates this transit line. + repeated TransitAgency agencies = 1; + + // The full name of this transit line, For example, "8 Avenue Local". + string name = 2; + + // the URI for this transit line as provided by the transit agency. + string uri = 3; + + // The color commonly used in signage for this line. Represented in + // hexadecimal. + string color = 4; + + // The URI for the icon associated with this line. + string icon_uri = 5; + + // The short name of this transit line. This name will normally be a line + // number, such as "M7" or "355". + string name_short = 6; + + // The color commonly used in text on signage for this line. Represented in + // hexadecimal. + string text_color = 7; + + // The type of vehicle that operates on this transit line. + TransitVehicle vehicle = 8; +} + +// Information about a transit stop. +message TransitStop { + // The name of the transit stop. + string name = 1; + + // The location of the stop expressed in latitude/longitude coordinates. + Location location = 2; +} + +// Information about a vehicle used in transit routes. +message TransitVehicle { + // The type of vehicles for transit routes. + enum TransitVehicleType { + // Unused. + TRANSIT_VEHICLE_TYPE_UNSPECIFIED = 0; + + // Bus. + BUS = 1; + + // A vehicle that operates on a cable, usually on the ground. Aerial cable + // cars may be of the type `GONDOLA_LIFT`. + CABLE_CAR = 2; + + // Commuter rail. + COMMUTER_TRAIN = 3; + + // Ferry. + FERRY = 4; + + // A vehicle that is pulled up a steep incline by a cable. A Funicular + // typically consists of two cars, with each car acting as a counterweight + // for the other. + FUNICULAR = 5; + + // An aerial cable car. + GONDOLA_LIFT = 6; + + // Heavy rail. + HEAVY_RAIL = 7; + + // High speed train. + HIGH_SPEED_TRAIN = 8; + + // Intercity bus. + INTERCITY_BUS = 9; + + // Long distance train. + LONG_DISTANCE_TRAIN = 10; + + // Light rail transit. + METRO_RAIL = 11; + + // Monorail. + MONORAIL = 12; + + // All other vehicles. + OTHER = 13; + + // Rail. + RAIL = 14; + + // Share taxi is a kind of bus with the ability to drop off and pick up + // passengers anywhere on its route. + SHARE_TAXI = 15; + + // Underground light rail. + SUBWAY = 16; + + // Above ground light rail. + TRAM = 17; + + // Trolleybus. + TROLLEYBUS = 18; + } + + // The name of this vehicle, capitalized. + google.type.LocalizedText name = 1; + + // The type of vehicle used. + TransitVehicleType type = 2; + + // The URI for an icon associated with this vehicle type. + string icon_uri = 3; + + // The URI for the icon associated with this vehicle type, based on the local + // transport signage. + string local_icon_uri = 4; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto new file mode 100644 index 00000000000..0f977cdd1b4 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "TransitPreferencesProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Preferences for `TRANSIT` based routes that influence the route that is +// returned. +message TransitPreferences { + // A set of values used to specify the mode of transit. + enum TransitTravelMode { + // No transit travel mode specified. + TRANSIT_TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel by bus. + BUS = 1; + + // Travel by subway. + SUBWAY = 2; + + // Travel by train. + TRAIN = 3; + + // Travel by light rail or tram. + LIGHT_RAIL = 4; + + // Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`, + // and `LIGHT_RAIL`. + RAIL = 5; + } + + // Specifies routing preferences for transit routes. + enum TransitRoutingPreference { + // No preference specified. + TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED = 0; + + // Indicates that the calculated route should prefer limited amounts of + // walking. + LESS_WALKING = 1; + + // Indicates that the calculated route should prefer a limited number of + // transfers. + FEWER_TRANSFERS = 2; + } + + // A set of travel modes to use when getting a `TRANSIT` route. Defaults to + // all supported modes of travel. + repeated TransitTravelMode allowed_travel_modes = 1; + + // A routing preference that, when specified, influences the `TRANSIT` route + // returned. + TransitRoutingPreference routing_preference = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto new file mode 100644 index 00000000000..e073a136bb6 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "UnitsProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the unit of measure used in the display. +enum Units { + // Units of measure not specified. Defaults to the unit of measure inferred + // from the request. + UNITS_UNSPECIFIED = 0; + + // Metric units of measure. + METRIC = 1; + + // Imperial (English) units of measure. + IMPERIAL = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto new file mode 100644 index 00000000000..285fe8c3bc5 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto @@ -0,0 +1,46 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "VehicleEmissionTypeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values describing the vehicle's emission type. +// Applies only to the `DRIVE` +// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. +enum VehicleEmissionType { + // No emission type specified. Default to `GASOLINE`. + VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; + + // Gasoline/petrol fueled vehicle. + GASOLINE = 1; + + // Electricity powered vehicle. + ELECTRIC = 2; + + // Hybrid fuel (such as gasoline + electric) vehicle. + HYBRID = 3; + + // Diesel fueled vehicle. + DIESEL = 4; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto new file mode 100644 index 00000000000..6e40a2adb70 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto @@ -0,0 +1,36 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.routing.v2; + +import "google/maps/routing/v2/vehicle_emission_type.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "VehicleInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Contains the vehicle information, such as the vehicle emission type. +message VehicleInfo { + // Describes the vehicle's emission type. + // Applies only to the `DRIVE` + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + VehicleEmissionType emission_type = 2; +} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto new file mode 100644 index 00000000000..05c7bd1fdf2 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.routing.v2; + +import "google/maps/routing/v2/location.proto"; + +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; +option java_multiple_files = true; +option java_outer_classname = "WaypointProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a waypoint. Waypoints mark both the beginning and end of a +// route, and include intermediate stops along the route. +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; + + // Human readable address or a plus code. + // See https://plus.codes for details. + string address = 7; + + // A token that identifies a + // [`NavigationPoint`](https://developers.google.com/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations/searchDestinations#navigationpoint), + // obtained from the `SearchDestinations` method of the Geocoding API. + string navigation_point_token = 8; + } + + // Marks this waypoint as a milestone rather a stopping point. For + // each non-via waypoint in the request, the response appends an entry to the + // [`legs`][google.maps.routing.v2.Route.legs] + // array to provide the details for stopovers on that leg of the trip. Set + // this value to true when you want the route to pass through this waypoint + // without stopping over. Via waypoints don't cause an entry to be added to + // the `legs` array, but they do route the journey through the waypoint. You + // can only set this value on waypoints that are intermediates. The request + // fails if you set this field on terminal waypoints. If + // `ComputeRoutesRequest.optimize_waypoint_order` is set to true then this + // field cannot be set to true; otherwise, the request fails. + bool via = 3; + + // Indicates that the waypoint is meant for vehicles to stop at, where the + // intention is to either pickup or drop-off. When you set this value, the + // calculated route won't include non-`via` waypoints on roads that are + // unsuitable for pickup and drop-off. This option works only for `DRIVE` and + // `TWO_WHEELER` travel modes, and when the `location_type` is + // [`Location`][google.maps.routing.v2.Location]. + bool vehicle_stopover = 4; + + // 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 works only for `DRIVE` and `TWO_WHEELER` + // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. + bool side_of_road = 5; +} diff --git a/owl-bot-staging/google-maps-routing/protos/protos.d.ts b/owl-bot-staging/google-maps-routing/protos/protos.d.ts new file mode 100644 index 00000000000..e210ac2e81c --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/protos.d.ts @@ -0,0 +1,13379 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not 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.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload 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.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not 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.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload 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.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not 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.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload 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.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not 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.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload 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.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not 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.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload 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.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not 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.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload 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.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not 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.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload 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.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not 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.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload 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.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not 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.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload 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.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 geo. */ + namespace geo { + + /** Namespace type. */ + namespace type { + + /** Properties of a Viewport. */ + interface IViewport { + + /** Viewport low */ + low?: (google.type.ILatLng|null); + + /** Viewport high */ + high?: (google.type.ILatLng|null); + } + + /** Represents a Viewport. */ + class Viewport implements IViewport { + + /** + * Constructs a new Viewport. + * @param [properties] Properties to set + */ + constructor(properties?: google.geo.type.IViewport); + + /** Viewport low. */ + public low?: (google.type.ILatLng|null); + + /** Viewport high. */ + public high?: (google.type.ILatLng|null); + + /** + * Creates a new Viewport instance using the specified properties. + * @param [properties] Properties to set + * @returns Viewport instance + */ + public static create(properties?: google.geo.type.IViewport): google.geo.type.Viewport; + + /** + * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @param message Viewport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @param message Viewport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Viewport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.geo.type.Viewport; + + /** + * Decodes a Viewport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.geo.type.Viewport; + + /** + * Verifies a Viewport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Viewport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Viewport + */ + public static fromObject(object: { [k: string]: any }): google.geo.type.Viewport; + + /** + * Creates a plain object from a Viewport message. Also converts values to other types if specified. + * @param message Viewport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.geo.type.Viewport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Viewport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Viewport + * @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; + } + + /** Properties of a LocalizedText. */ + interface ILocalizedText { + + /** LocalizedText text */ + text?: (string|null); + + /** LocalizedText languageCode */ + languageCode?: (string|null); + } + + /** Represents a LocalizedText. */ + class LocalizedText implements ILocalizedText { + + /** + * Constructs a new LocalizedText. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILocalizedText); + + /** LocalizedText text. */ + public text: string; + + /** LocalizedText languageCode. */ + public languageCode: string; + + /** + * Creates a new LocalizedText instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedText instance + */ + public static create(properties?: google.type.ILocalizedText): google.type.LocalizedText; + + /** + * Encodes the specified LocalizedText message. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. + * @param message LocalizedText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILocalizedText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedText message, length delimited. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. + * @param message LocalizedText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILocalizedText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedText + * @throws {Error} If the payload is not 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.LocalizedText; + + /** + * Decodes a LocalizedText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedText + * @throws {Error} If the payload 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.LocalizedText; + + /** + * Verifies a LocalizedText message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedText + */ + public static fromObject(object: { [k: string]: any }): google.type.LocalizedText; + + /** + * Creates a plain object from a LocalizedText message. Also converts values to other types if specified. + * @param message LocalizedText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LocalizedText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalizedText + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not 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.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload 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.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace maps. */ + namespace maps { + + /** Namespace routing. */ + namespace routing { + + /** Namespace v2. */ + namespace v2 { + + /** Properties of a FallbackInfo. */ + interface IFallbackInfo { + + /** FallbackInfo routingMode */ + routingMode?: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode|null); + + /** FallbackInfo reason */ + reason?: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason|null); + } + + /** Represents a FallbackInfo. */ + class FallbackInfo implements IFallbackInfo { + + /** + * Constructs a new FallbackInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IFallbackInfo); + + /** FallbackInfo routingMode. */ + public routingMode: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode); + + /** FallbackInfo reason. */ + public reason: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason); + + /** + * Creates a new FallbackInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackInfo instance + */ + public static create(properties?: google.maps.routing.v2.IFallbackInfo): google.maps.routing.v2.FallbackInfo; + + /** + * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @param message FallbackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @param message FallbackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackInfo + * @throws {Error} If the payload is not 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.routing.v2.FallbackInfo; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackInfo + * @throws {Error} If the payload 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.routing.v2.FallbackInfo; + + /** + * Verifies a FallbackInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.FallbackInfo; + + /** + * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. + * @param message FallbackInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.FallbackInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FallbackReason enum. */ + enum FallbackReason { + FALLBACK_REASON_UNSPECIFIED = 0, + SERVER_ERROR = 1, + LATENCY_EXCEEDED = 2 + } + + /** FallbackRoutingMode enum. */ + enum FallbackRoutingMode { + FALLBACK_ROUTING_MODE_UNSPECIFIED = 0, + FALLBACK_TRAFFIC_UNAWARE = 1, + FALLBACK_TRAFFIC_AWARE = 2 + } + + /** Properties of a GeocodingResults. */ + interface IGeocodingResults { + + /** GeocodingResults origin */ + origin?: (google.maps.routing.v2.IGeocodedWaypoint|null); + + /** GeocodingResults destination */ + destination?: (google.maps.routing.v2.IGeocodedWaypoint|null); + + /** GeocodingResults intermediates */ + intermediates?: (google.maps.routing.v2.IGeocodedWaypoint[]|null); + } + + /** Represents a GeocodingResults. */ + class GeocodingResults implements IGeocodingResults { + + /** + * Constructs a new GeocodingResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IGeocodingResults); + + /** GeocodingResults origin. */ + public origin?: (google.maps.routing.v2.IGeocodedWaypoint|null); + + /** GeocodingResults destination. */ + public destination?: (google.maps.routing.v2.IGeocodedWaypoint|null); + + /** GeocodingResults intermediates. */ + public intermediates: google.maps.routing.v2.IGeocodedWaypoint[]; + + /** + * Creates a new GeocodingResults instance using the specified properties. + * @param [properties] Properties to set + * @returns GeocodingResults instance + */ + public static create(properties?: google.maps.routing.v2.IGeocodingResults): google.maps.routing.v2.GeocodingResults; + + /** + * Encodes the specified GeocodingResults message. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. + * @param message GeocodingResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IGeocodingResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeocodingResults message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. + * @param message GeocodingResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IGeocodingResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeocodingResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeocodingResults + * @throws {Error} If the payload is not 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.routing.v2.GeocodingResults; + + /** + * Decodes a GeocodingResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeocodingResults + * @throws {Error} If the payload 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.routing.v2.GeocodingResults; + + /** + * Verifies a GeocodingResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeocodingResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeocodingResults + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.GeocodingResults; + + /** + * Creates a plain object from a GeocodingResults message. Also converts values to other types if specified. + * @param message GeocodingResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.GeocodingResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeocodingResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeocodingResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeocodedWaypoint. */ + interface IGeocodedWaypoint { + + /** GeocodedWaypoint geocoderStatus */ + geocoderStatus?: (google.rpc.IStatus|null); + + /** GeocodedWaypoint intermediateWaypointRequestIndex */ + intermediateWaypointRequestIndex?: (number|null); + + /** GeocodedWaypoint type */ + type?: (string[]|null); + + /** GeocodedWaypoint partialMatch */ + partialMatch?: (boolean|null); + + /** GeocodedWaypoint placeId */ + placeId?: (string|null); + } + + /** Represents a GeocodedWaypoint. */ + class GeocodedWaypoint implements IGeocodedWaypoint { + + /** + * Constructs a new GeocodedWaypoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IGeocodedWaypoint); + + /** GeocodedWaypoint geocoderStatus. */ + public geocoderStatus?: (google.rpc.IStatus|null); + + /** GeocodedWaypoint intermediateWaypointRequestIndex. */ + public intermediateWaypointRequestIndex?: (number|null); + + /** GeocodedWaypoint type. */ + public type: string[]; + + /** GeocodedWaypoint partialMatch. */ + public partialMatch: boolean; + + /** GeocodedWaypoint placeId. */ + public placeId: string; + + /** + * Creates a new GeocodedWaypoint instance using the specified properties. + * @param [properties] Properties to set + * @returns GeocodedWaypoint instance + */ + public static create(properties?: google.maps.routing.v2.IGeocodedWaypoint): google.maps.routing.v2.GeocodedWaypoint; + + /** + * Encodes the specified GeocodedWaypoint message. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. + * @param message GeocodedWaypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IGeocodedWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeocodedWaypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. + * @param message GeocodedWaypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IGeocodedWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeocodedWaypoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeocodedWaypoint + * @throws {Error} If the payload is not 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.routing.v2.GeocodedWaypoint; + + /** + * Decodes a GeocodedWaypoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeocodedWaypoint + * @throws {Error} If the payload 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.routing.v2.GeocodedWaypoint; + + /** + * Verifies a GeocodedWaypoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeocodedWaypoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeocodedWaypoint + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.GeocodedWaypoint; + + /** + * Creates a plain object from a GeocodedWaypoint message. Also converts values to other types if specified. + * @param message GeocodedWaypoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.GeocodedWaypoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeocodedWaypoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeocodedWaypoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocalizedTime. */ + interface ILocalizedTime { + + /** LocalizedTime time */ + time?: (google.type.ILocalizedText|null); + + /** LocalizedTime timeZone */ + timeZone?: (string|null); + } + + /** Represents a LocalizedTime. */ + class LocalizedTime implements ILocalizedTime { + + /** + * Constructs a new LocalizedTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ILocalizedTime); + + /** LocalizedTime time. */ + public time?: (google.type.ILocalizedText|null); + + /** LocalizedTime timeZone. */ + public timeZone: string; + + /** + * Creates a new LocalizedTime instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedTime instance + */ + public static create(properties?: google.maps.routing.v2.ILocalizedTime): google.maps.routing.v2.LocalizedTime; + + /** + * Encodes the specified LocalizedTime message. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. + * @param message LocalizedTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ILocalizedTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedTime message, length delimited. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. + * @param message LocalizedTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ILocalizedTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedTime + * @throws {Error} If the payload is not 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.routing.v2.LocalizedTime; + + /** + * Decodes a LocalizedTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedTime + * @throws {Error} If the payload 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.routing.v2.LocalizedTime; + + /** + * Verifies a LocalizedTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedTime + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.LocalizedTime; + + /** + * Creates a plain object from a LocalizedTime message. Also converts values to other types if specified. + * @param message LocalizedTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.LocalizedTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalizedTime + * @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?: (google.protobuf.IInt32Value|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ILocation); + + /** Location latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** Location heading. */ + public heading?: (google.protobuf.IInt32Value|null); + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.maps.routing.v2.ILocation): google.maps.routing.v2.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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; + } + + /** Maneuver enum. */ + enum Maneuver { + MANEUVER_UNSPECIFIED = 0, + TURN_SLIGHT_LEFT = 1, + TURN_SHARP_LEFT = 2, + UTURN_LEFT = 3, + TURN_LEFT = 4, + TURN_SLIGHT_RIGHT = 5, + TURN_SHARP_RIGHT = 6, + UTURN_RIGHT = 7, + TURN_RIGHT = 8, + STRAIGHT = 9, + RAMP_LEFT = 10, + RAMP_RIGHT = 11, + MERGE = 12, + FORK_LEFT = 13, + FORK_RIGHT = 14, + FERRY = 15, + FERRY_TRAIN = 16, + ROUNDABOUT_LEFT = 17, + ROUNDABOUT_RIGHT = 18, + DEPART = 19, + NAME_CHANGE = 20 + } + + /** Properties of a NavigationInstruction. */ + interface INavigationInstruction { + + /** NavigationInstruction maneuver */ + maneuver?: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver|null); + + /** NavigationInstruction instructions */ + instructions?: (string|null); + } + + /** Represents a NavigationInstruction. */ + class NavigationInstruction implements INavigationInstruction { + + /** + * Constructs a new NavigationInstruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.INavigationInstruction); + + /** NavigationInstruction maneuver. */ + public maneuver: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver); + + /** NavigationInstruction instructions. */ + public instructions: string; + + /** + * Creates a new NavigationInstruction instance using the specified properties. + * @param [properties] Properties to set + * @returns NavigationInstruction instance + */ + public static create(properties?: google.maps.routing.v2.INavigationInstruction): google.maps.routing.v2.NavigationInstruction; + + /** + * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @param message NavigationInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @param message NavigationInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NavigationInstruction + * @throws {Error} If the payload is not 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.routing.v2.NavigationInstruction; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NavigationInstruction + * @throws {Error} If the payload 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.routing.v2.NavigationInstruction; + + /** + * Verifies a NavigationInstruction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NavigationInstruction + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.NavigationInstruction; + + /** + * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. + * @param message NavigationInstruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.NavigationInstruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NavigationInstruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NavigationInstruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Polyline. */ + interface IPolyline { + + /** Polyline encodedPolyline */ + encodedPolyline?: (string|null); + + /** Polyline geoJsonLinestring */ + geoJsonLinestring?: (google.protobuf.IStruct|null); + } + + /** Represents a Polyline. */ + class Polyline implements IPolyline { + + /** + * Constructs a new Polyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IPolyline); + + /** Polyline encodedPolyline. */ + public encodedPolyline?: (string|null); + + /** Polyline geoJsonLinestring. */ + public geoJsonLinestring?: (google.protobuf.IStruct|null); + + /** Polyline polylineType. */ + public polylineType?: ("encodedPolyline"|"geoJsonLinestring"); + + /** + * Creates a new Polyline instance using the specified properties. + * @param [properties] Properties to set + * @returns Polyline instance + */ + public static create(properties?: google.maps.routing.v2.IPolyline): google.maps.routing.v2.Polyline; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Polyline + * @throws {Error} If the payload is not 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.routing.v2.Polyline; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Polyline + * @throws {Error} If the payload 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.routing.v2.Polyline; + + /** + * Verifies a Polyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Polyline + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Polyline; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @param message Polyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Polyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Polyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Polyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PolylineQuality enum. */ + enum PolylineQuality { + POLYLINE_QUALITY_UNSPECIFIED = 0, + HIGH_QUALITY = 1, + OVERVIEW = 2 + } + + /** PolylineEncoding enum. */ + enum PolylineEncoding { + POLYLINE_ENCODING_UNSPECIFIED = 0, + ENCODED_POLYLINE = 1, + GEO_JSON_LINESTRING = 2 + } + + /** Properties of a PolylineDetails. */ + interface IPolylineDetails { + + /** PolylineDetails flyoverInfo */ + flyoverInfo?: (google.maps.routing.v2.PolylineDetails.IFlyoverInfo[]|null); + + /** PolylineDetails narrowRoadInfo */ + narrowRoadInfo?: (google.maps.routing.v2.PolylineDetails.INarrowRoadInfo[]|null); + } + + /** Represents a PolylineDetails. */ + class PolylineDetails implements IPolylineDetails { + + /** + * Constructs a new PolylineDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IPolylineDetails); + + /** PolylineDetails flyoverInfo. */ + public flyoverInfo: google.maps.routing.v2.PolylineDetails.IFlyoverInfo[]; + + /** PolylineDetails narrowRoadInfo. */ + public narrowRoadInfo: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo[]; + + /** + * Creates a new PolylineDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PolylineDetails instance + */ + public static create(properties?: google.maps.routing.v2.IPolylineDetails): google.maps.routing.v2.PolylineDetails; + + /** + * Encodes the specified PolylineDetails message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. + * @param message PolylineDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IPolylineDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolylineDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. + * @param message PolylineDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IPolylineDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolylineDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolylineDetails + * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails; + + /** + * Decodes a PolylineDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolylineDetails + * @throws {Error} If the payload 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.routing.v2.PolylineDetails; + + /** + * Verifies a PolylineDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolylineDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolylineDetails + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails; + + /** + * Creates a plain object from a PolylineDetails message. Also converts values to other types if specified. + * @param message PolylineDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.PolylineDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolylineDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolylineDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PolylineDetails { + + /** Properties of a PolylinePointIndex. */ + interface IPolylinePointIndex { + + /** PolylinePointIndex startIndex */ + startIndex?: (number|null); + + /** PolylinePointIndex endIndex */ + endIndex?: (number|null); + } + + /** Represents a PolylinePointIndex. */ + class PolylinePointIndex implements IPolylinePointIndex { + + /** + * Constructs a new PolylinePointIndex. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex); + + /** PolylinePointIndex startIndex. */ + public startIndex?: (number|null); + + /** PolylinePointIndex endIndex. */ + public endIndex?: (number|null); + + /** + * Creates a new PolylinePointIndex instance using the specified properties. + * @param [properties] Properties to set + * @returns PolylinePointIndex instance + */ + public static create(properties?: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex): google.maps.routing.v2.PolylineDetails.PolylinePointIndex; + + /** + * Encodes the specified PolylinePointIndex message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. + * @param message PolylinePointIndex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolylinePointIndex message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. + * @param message PolylinePointIndex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolylinePointIndex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolylinePointIndex + * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.PolylinePointIndex; + + /** + * Decodes a PolylinePointIndex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolylinePointIndex + * @throws {Error} If the payload 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.routing.v2.PolylineDetails.PolylinePointIndex; + + /** + * Verifies a PolylinePointIndex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolylinePointIndex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolylinePointIndex + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.PolylinePointIndex; + + /** + * Creates a plain object from a PolylinePointIndex message. Also converts values to other types if specified. + * @param message PolylinePointIndex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.PolylineDetails.PolylinePointIndex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolylinePointIndex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolylinePointIndex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RoadFeatureState enum. */ + enum RoadFeatureState { + ROAD_FEATURE_STATE_UNSPECIFIED = 0, + EXISTS = 1, + DOES_NOT_EXIST = 2 + } + + /** Properties of a FlyoverInfo. */ + interface IFlyoverInfo { + + /** FlyoverInfo flyoverPresence */ + flyoverPresence?: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState|null); + + /** FlyoverInfo polylinePointIndex */ + polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); + } + + /** Represents a FlyoverInfo. */ + class FlyoverInfo implements IFlyoverInfo { + + /** + * Constructs a new FlyoverInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.PolylineDetails.IFlyoverInfo); + + /** FlyoverInfo flyoverPresence. */ + public flyoverPresence: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState); + + /** FlyoverInfo polylinePointIndex. */ + public polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); + + /** + * Creates a new FlyoverInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FlyoverInfo instance + */ + public static create(properties?: google.maps.routing.v2.PolylineDetails.IFlyoverInfo): google.maps.routing.v2.PolylineDetails.FlyoverInfo; + + /** + * Encodes the specified FlyoverInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. + * @param message FlyoverInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.PolylineDetails.IFlyoverInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlyoverInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. + * @param message FlyoverInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.IFlyoverInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlyoverInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlyoverInfo + * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.FlyoverInfo; + + /** + * Decodes a FlyoverInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlyoverInfo + * @throws {Error} If the payload 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.routing.v2.PolylineDetails.FlyoverInfo; + + /** + * Verifies a FlyoverInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FlyoverInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlyoverInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.FlyoverInfo; + + /** + * Creates a plain object from a FlyoverInfo message. Also converts values to other types if specified. + * @param message FlyoverInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.PolylineDetails.FlyoverInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlyoverInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlyoverInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NarrowRoadInfo. */ + interface INarrowRoadInfo { + + /** NarrowRoadInfo narrowRoadPresence */ + narrowRoadPresence?: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState|null); + + /** NarrowRoadInfo polylinePointIndex */ + polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); + } + + /** Represents a NarrowRoadInfo. */ + class NarrowRoadInfo implements INarrowRoadInfo { + + /** + * Constructs a new NarrowRoadInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo); + + /** NarrowRoadInfo narrowRoadPresence. */ + public narrowRoadPresence: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState); + + /** NarrowRoadInfo polylinePointIndex. */ + public polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); + + /** + * Creates a new NarrowRoadInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns NarrowRoadInfo instance + */ + public static create(properties?: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo): google.maps.routing.v2.PolylineDetails.NarrowRoadInfo; + + /** + * Encodes the specified NarrowRoadInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. + * @param message NarrowRoadInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NarrowRoadInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. + * @param message NarrowRoadInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NarrowRoadInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NarrowRoadInfo + * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.NarrowRoadInfo; + + /** + * Decodes a NarrowRoadInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NarrowRoadInfo + * @throws {Error} If the payload 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.routing.v2.PolylineDetails.NarrowRoadInfo; + + /** + * Verifies a NarrowRoadInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NarrowRoadInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NarrowRoadInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.NarrowRoadInfo; + + /** + * Creates a plain object from a NarrowRoadInfo message. Also converts values to other types if specified. + * @param message NarrowRoadInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.PolylineDetails.NarrowRoadInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NarrowRoadInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NarrowRoadInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Route. */ + interface IRoute { + + /** Route routeLabels */ + routeLabels?: (google.maps.routing.v2.RouteLabel[]|null); + + /** Route legs */ + legs?: (google.maps.routing.v2.IRouteLeg[]|null); + + /** Route distanceMeters */ + distanceMeters?: (number|null); + + /** Route duration */ + duration?: (google.protobuf.IDuration|null); + + /** Route staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** Route polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** Route description */ + description?: (string|null); + + /** Route warnings */ + warnings?: (string[]|null); + + /** Route viewport */ + viewport?: (google.geo.type.IViewport|null); + + /** Route travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** Route optimizedIntermediateWaypointIndex */ + optimizedIntermediateWaypointIndex?: (number[]|null); + + /** Route localizedValues */ + localizedValues?: (google.maps.routing.v2.Route.IRouteLocalizedValues|null); + + /** Route routeToken */ + routeToken?: (string|null); + + /** Route polylineDetails */ + polylineDetails?: (google.maps.routing.v2.IPolylineDetails|null); + } + + /** Represents a Route. */ + class Route implements IRoute { + + /** + * Constructs a new Route. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRoute); + + /** Route routeLabels. */ + public routeLabels: google.maps.routing.v2.RouteLabel[]; + + /** Route legs. */ + public legs: google.maps.routing.v2.IRouteLeg[]; + + /** Route distanceMeters. */ + public distanceMeters: number; + + /** Route duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Route staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** Route polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** Route description. */ + public description: string; + + /** Route warnings. */ + public warnings: string[]; + + /** Route viewport. */ + public viewport?: (google.geo.type.IViewport|null); + + /** Route travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** Route optimizedIntermediateWaypointIndex. */ + public optimizedIntermediateWaypointIndex: number[]; + + /** Route localizedValues. */ + public localizedValues?: (google.maps.routing.v2.Route.IRouteLocalizedValues|null); + + /** Route routeToken. */ + public routeToken: string; + + /** Route polylineDetails. */ + public polylineDetails?: (google.maps.routing.v2.IPolylineDetails|null); + + /** + * Creates a new Route instance using the specified properties. + * @param [properties] Properties to set + * @returns Route instance + */ + public static create(properties?: google.maps.routing.v2.IRoute): google.maps.routing.v2.Route; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @param message Route message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @param message Route message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Route message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Route + * @throws {Error} If the payload is not 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.routing.v2.Route; + + /** + * Decodes a Route message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Route + * @throws {Error} If the payload 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.routing.v2.Route; + + /** + * Verifies a Route message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Route + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Route; + + /** + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @param message Route + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Route, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Route to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Route + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Route { + + /** Properties of a RouteLocalizedValues. */ + interface IRouteLocalizedValues { + + /** RouteLocalizedValues distance */ + distance?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues duration */ + duration?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues staticDuration */ + staticDuration?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues transitFare */ + transitFare?: (google.type.ILocalizedText|null); + } + + /** Represents a RouteLocalizedValues. */ + class RouteLocalizedValues implements IRouteLocalizedValues { + + /** + * Constructs a new RouteLocalizedValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.Route.IRouteLocalizedValues); + + /** RouteLocalizedValues distance. */ + public distance?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues duration. */ + public duration?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues staticDuration. */ + public staticDuration?: (google.type.ILocalizedText|null); + + /** RouteLocalizedValues transitFare. */ + public transitFare?: (google.type.ILocalizedText|null); + + /** + * Creates a new RouteLocalizedValues instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLocalizedValues instance + */ + public static create(properties?: google.maps.routing.v2.Route.IRouteLocalizedValues): google.maps.routing.v2.Route.RouteLocalizedValues; + + /** + * Encodes the specified RouteLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. + * @param message RouteLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.Route.IRouteLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. + * @param message RouteLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.Route.IRouteLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLocalizedValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLocalizedValues + * @throws {Error} If the payload is not 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.routing.v2.Route.RouteLocalizedValues; + + /** + * Decodes a RouteLocalizedValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLocalizedValues + * @throws {Error} If the payload 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.routing.v2.Route.RouteLocalizedValues; + + /** + * Verifies a RouteLocalizedValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLocalizedValues + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Route.RouteLocalizedValues; + + /** + * Creates a plain object from a RouteLocalizedValues message. Also converts values to other types if specified. + * @param message RouteLocalizedValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Route.RouteLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLocalizedValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLocalizedValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RouteTravelAdvisory. */ + interface IRouteTravelAdvisory { + + /** RouteTravelAdvisory tollInfo */ + tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + + /** RouteTravelAdvisory fuelConsumptionMicroliters */ + fuelConsumptionMicroliters?: (number|Long|string|null); + + /** RouteTravelAdvisory routeRestrictionsPartiallyIgnored */ + routeRestrictionsPartiallyIgnored?: (boolean|null); + + /** RouteTravelAdvisory transitFare */ + transitFare?: (google.type.IMoney|null); + } + + /** Represents a RouteTravelAdvisory. */ + class RouteTravelAdvisory implements IRouteTravelAdvisory { + + /** + * Constructs a new RouteTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteTravelAdvisory); + + /** RouteTravelAdvisory tollInfo. */ + public tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** RouteTravelAdvisory fuelConsumptionMicroliters. */ + public fuelConsumptionMicroliters: (number|Long|string); + + /** RouteTravelAdvisory routeRestrictionsPartiallyIgnored. */ + public routeRestrictionsPartiallyIgnored: boolean; + + /** RouteTravelAdvisory transitFare. */ + public transitFare?: (google.type.IMoney|null); + + /** + * Creates a new RouteTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteTravelAdvisory): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @param message RouteTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @param message RouteTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteTravelAdvisory + * @throws {Error} If the payload is not 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.routing.v2.RouteTravelAdvisory; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteTravelAdvisory + * @throws {Error} If the payload 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.routing.v2.RouteTravelAdvisory; + + /** + * Verifies a RouteTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLegTravelAdvisory. */ + interface IRouteLegTravelAdvisory { + + /** RouteLegTravelAdvisory tollInfo */ + tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteLegTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + } + + /** Represents a RouteLegTravelAdvisory. */ + class RouteLegTravelAdvisory implements IRouteLegTravelAdvisory { + + /** + * Constructs a new RouteLegTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory); + + /** RouteLegTravelAdvisory tollInfo. */ + public tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteLegTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** + * Creates a new RouteLegTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @param message RouteLegTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @param message RouteLegTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegTravelAdvisory + * @throws {Error} If the payload is not 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.routing.v2.RouteLegTravelAdvisory; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegTravelAdvisory + * @throws {Error} If the payload 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.routing.v2.RouteLegTravelAdvisory; + + /** + * Verifies a RouteLegTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteLegTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLegStepTravelAdvisory. */ + interface IRouteLegStepTravelAdvisory { + + /** RouteLegStepTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + } + + /** Represents a RouteLegStepTravelAdvisory. */ + class RouteLegStepTravelAdvisory implements IRouteLegStepTravelAdvisory { + + /** + * Constructs a new RouteLegStepTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory); + + /** RouteLegStepTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** + * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStepTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @param message RouteLegStepTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @param message RouteLegStepTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStepTravelAdvisory + * @throws {Error} If the payload 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.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Verifies a RouteLegStepTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStepTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteLegStepTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStepTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStepTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStepTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLeg. */ + interface IRouteLeg { + + /** RouteLeg distanceMeters */ + distanceMeters?: (number|null); + + /** RouteLeg duration */ + duration?: (google.protobuf.IDuration|null); + + /** RouteLeg staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLeg polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLeg startLocation */ + startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg endLocation */ + endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg steps */ + steps?: (google.maps.routing.v2.IRouteLegStep[]|null); + + /** RouteLeg travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); + + /** RouteLeg localizedValues */ + localizedValues?: (google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null); + + /** RouteLeg stepsOverview */ + stepsOverview?: (google.maps.routing.v2.RouteLeg.IStepsOverview|null); + } + + /** Represents a RouteLeg. */ + class RouteLeg implements IRouteLeg { + + /** + * Constructs a new RouteLeg. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLeg); + + /** RouteLeg distanceMeters. */ + public distanceMeters: number; + + /** RouteLeg duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** RouteLeg staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLeg polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLeg startLocation. */ + public startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg endLocation. */ + public endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg steps. */ + public steps: google.maps.routing.v2.IRouteLegStep[]; + + /** RouteLeg travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); + + /** RouteLeg localizedValues. */ + public localizedValues?: (google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null); + + /** RouteLeg stepsOverview. */ + public stepsOverview?: (google.maps.routing.v2.RouteLeg.IStepsOverview|null); + + /** + * Creates a new RouteLeg instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLeg instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLeg): google.maps.routing.v2.RouteLeg; + + /** + * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @param message RouteLeg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @param message RouteLeg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLeg message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLeg + * @throws {Error} If the payload is not 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.routing.v2.RouteLeg; + + /** + * Decodes a RouteLeg message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLeg + * @throws {Error} If the payload 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.routing.v2.RouteLeg; + + /** + * Verifies a RouteLeg message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLeg + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg; + + /** + * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. + * @param message RouteLeg + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLeg, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLeg to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLeg + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RouteLeg { + + /** Properties of a RouteLegLocalizedValues. */ + interface IRouteLegLocalizedValues { + + /** RouteLegLocalizedValues distance */ + distance?: (google.type.ILocalizedText|null); + + /** RouteLegLocalizedValues duration */ + duration?: (google.type.ILocalizedText|null); + + /** RouteLegLocalizedValues staticDuration */ + staticDuration?: (google.type.ILocalizedText|null); + } + + /** Represents a RouteLegLocalizedValues. */ + class RouteLegLocalizedValues implements IRouteLegLocalizedValues { + + /** + * Constructs a new RouteLegLocalizedValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues); + + /** RouteLegLocalizedValues distance. */ + public distance?: (google.type.ILocalizedText|null); + + /** RouteLegLocalizedValues duration. */ + public duration?: (google.type.ILocalizedText|null); + + /** RouteLegLocalizedValues staticDuration. */ + public staticDuration?: (google.type.ILocalizedText|null); + + /** + * Creates a new RouteLegLocalizedValues instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegLocalizedValues instance + */ + public static create(properties?: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues): google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues; + + /** + * Encodes the specified RouteLegLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. + * @param message RouteLegLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. + * @param message RouteLegLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegLocalizedValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegLocalizedValues + * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.RouteLegLocalizedValues; + + /** + * Decodes a RouteLegLocalizedValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegLocalizedValues + * @throws {Error} If the payload 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.routing.v2.RouteLeg.RouteLegLocalizedValues; + + /** + * Verifies a RouteLegLocalizedValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegLocalizedValues + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues; + + /** + * Creates a plain object from a RouteLegLocalizedValues message. Also converts values to other types if specified. + * @param message RouteLegLocalizedValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegLocalizedValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegLocalizedValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StepsOverview. */ + interface IStepsOverview { + + /** StepsOverview multiModalSegments */ + multiModalSegments?: (google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment[]|null); + } + + /** Represents a StepsOverview. */ + class StepsOverview implements IStepsOverview { + + /** + * Constructs a new StepsOverview. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLeg.IStepsOverview); + + /** StepsOverview multiModalSegments. */ + public multiModalSegments: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment[]; + + /** + * Creates a new StepsOverview instance using the specified properties. + * @param [properties] Properties to set + * @returns StepsOverview instance + */ + public static create(properties?: google.maps.routing.v2.RouteLeg.IStepsOverview): google.maps.routing.v2.RouteLeg.StepsOverview; + + /** + * Encodes the specified StepsOverview message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. + * @param message StepsOverview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLeg.IStepsOverview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StepsOverview message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. + * @param message StepsOverview message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.IStepsOverview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StepsOverview message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StepsOverview + * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.StepsOverview; + + /** + * Decodes a StepsOverview message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StepsOverview + * @throws {Error} If the payload 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.routing.v2.RouteLeg.StepsOverview; + + /** + * Verifies a StepsOverview message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StepsOverview message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StepsOverview + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.StepsOverview; + + /** + * Creates a plain object from a StepsOverview message. Also converts values to other types if specified. + * @param message StepsOverview + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLeg.StepsOverview, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StepsOverview to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StepsOverview + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StepsOverview { + + /** Properties of a MultiModalSegment. */ + interface IMultiModalSegment { + + /** MultiModalSegment stepStartIndex */ + stepStartIndex?: (number|null); + + /** MultiModalSegment stepEndIndex */ + stepEndIndex?: (number|null); + + /** MultiModalSegment navigationInstruction */ + navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** MultiModalSegment travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + } + + /** Represents a MultiModalSegment. */ + class MultiModalSegment implements IMultiModalSegment { + + /** + * Constructs a new MultiModalSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment); + + /** MultiModalSegment stepStartIndex. */ + public stepStartIndex?: (number|null); + + /** MultiModalSegment stepEndIndex. */ + public stepEndIndex?: (number|null); + + /** MultiModalSegment navigationInstruction. */ + public navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** MultiModalSegment travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** + * Creates a new MultiModalSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiModalSegment instance + */ + public static create(properties?: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment): google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; + + /** + * Encodes the specified MultiModalSegment message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. + * @param message MultiModalSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiModalSegment message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. + * @param message MultiModalSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiModalSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiModalSegment + * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; + + /** + * Decodes a MultiModalSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiModalSegment + * @throws {Error} If the payload 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.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; + + /** + * Verifies a MultiModalSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiModalSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiModalSegment + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; + + /** + * Creates a plain object from a MultiModalSegment message. Also converts values to other types if specified. + * @param message MultiModalSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiModalSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiModalSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a RouteLegStep. */ + interface IRouteLegStep { + + /** RouteLegStep distanceMeters */ + distanceMeters?: (number|null); + + /** RouteLegStep staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLegStep polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLegStep startLocation */ + startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep endLocation */ + endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep navigationInstruction */ + navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** RouteLegStep travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); + + /** RouteLegStep localizedValues */ + localizedValues?: (google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null); + + /** RouteLegStep transitDetails */ + transitDetails?: (google.maps.routing.v2.IRouteLegStepTransitDetails|null); + + /** RouteLegStep travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + } + + /** Represents a RouteLegStep. */ + class RouteLegStep implements IRouteLegStep { + + /** + * Constructs a new RouteLegStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegStep); + + /** RouteLegStep distanceMeters. */ + public distanceMeters: number; + + /** RouteLegStep staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLegStep polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLegStep startLocation. */ + public startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep endLocation. */ + public endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep navigationInstruction. */ + public navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** RouteLegStep travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); + + /** RouteLegStep localizedValues. */ + public localizedValues?: (google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null); + + /** RouteLegStep transitDetails. */ + public transitDetails?: (google.maps.routing.v2.IRouteLegStepTransitDetails|null); + + /** RouteLegStep travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** + * Creates a new RouteLegStep instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStep instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegStep): google.maps.routing.v2.RouteLegStep; + + /** + * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @param message RouteLegStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @param message RouteLegStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStep + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStep; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStep + * @throws {Error} If the payload 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.routing.v2.RouteLegStep; + + /** + * Verifies a RouteLegStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStep + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStep; + + /** + * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. + * @param message RouteLegStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RouteLegStep { + + /** Properties of a RouteLegStepLocalizedValues. */ + interface IRouteLegStepLocalizedValues { + + /** RouteLegStepLocalizedValues distance */ + distance?: (google.type.ILocalizedText|null); + + /** RouteLegStepLocalizedValues staticDuration */ + staticDuration?: (google.type.ILocalizedText|null); + } + + /** Represents a RouteLegStepLocalizedValues. */ + class RouteLegStepLocalizedValues implements IRouteLegStepLocalizedValues { + + /** + * Constructs a new RouteLegStepLocalizedValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues); + + /** RouteLegStepLocalizedValues distance. */ + public distance?: (google.type.ILocalizedText|null); + + /** RouteLegStepLocalizedValues staticDuration. */ + public staticDuration?: (google.type.ILocalizedText|null); + + /** + * Creates a new RouteLegStepLocalizedValues instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStepLocalizedValues instance + */ + public static create(properties?: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues): google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; + + /** + * Encodes the specified RouteLegStepLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. + * @param message RouteLegStepLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStepLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. + * @param message RouteLegStepLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStepLocalizedValues + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; + + /** + * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStepLocalizedValues + * @throws {Error} If the payload 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.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; + + /** + * Verifies a RouteLegStepLocalizedValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStepLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStepLocalizedValues + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; + + /** + * Creates a plain object from a RouteLegStepLocalizedValues message. Also converts values to other types if specified. + * @param message RouteLegStepLocalizedValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStepLocalizedValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStepLocalizedValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RouteLegStepTransitDetails. */ + interface IRouteLegStepTransitDetails { + + /** RouteLegStepTransitDetails stopDetails */ + stopDetails?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null); + + /** RouteLegStepTransitDetails localizedValues */ + localizedValues?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null); + + /** RouteLegStepTransitDetails headsign */ + headsign?: (string|null); + + /** RouteLegStepTransitDetails headway */ + headway?: (google.protobuf.IDuration|null); + + /** RouteLegStepTransitDetails transitLine */ + transitLine?: (google.maps.routing.v2.ITransitLine|null); + + /** RouteLegStepTransitDetails stopCount */ + stopCount?: (number|null); + + /** RouteLegStepTransitDetails tripShortText */ + tripShortText?: (string|null); + } + + /** Represents a RouteLegStepTransitDetails. */ + class RouteLegStepTransitDetails implements IRouteLegStepTransitDetails { + + /** + * Constructs a new RouteLegStepTransitDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegStepTransitDetails); + + /** RouteLegStepTransitDetails stopDetails. */ + public stopDetails?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null); + + /** RouteLegStepTransitDetails localizedValues. */ + public localizedValues?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null); + + /** RouteLegStepTransitDetails headsign. */ + public headsign: string; + + /** RouteLegStepTransitDetails headway. */ + public headway?: (google.protobuf.IDuration|null); + + /** RouteLegStepTransitDetails transitLine. */ + public transitLine?: (google.maps.routing.v2.ITransitLine|null); + + /** RouteLegStepTransitDetails stopCount. */ + public stopCount: number; + + /** RouteLegStepTransitDetails tripShortText. */ + public tripShortText: string; + + /** + * Creates a new RouteLegStepTransitDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStepTransitDetails instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegStepTransitDetails): google.maps.routing.v2.RouteLegStepTransitDetails; + + /** + * Encodes the specified RouteLegStepTransitDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. + * @param message RouteLegStepTransitDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegStepTransitDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStepTransitDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. + * @param message RouteLegStepTransitDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStepTransitDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStepTransitDetails + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails; + + /** + * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStepTransitDetails + * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails; + + /** + * Verifies a RouteLegStepTransitDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStepTransitDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStepTransitDetails + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails; + + /** + * Creates a plain object from a RouteLegStepTransitDetails message. Also converts values to other types if specified. + * @param message RouteLegStepTransitDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStepTransitDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStepTransitDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RouteLegStepTransitDetails { + + /** Properties of a TransitStopDetails. */ + interface ITransitStopDetails { + + /** TransitStopDetails arrivalStop */ + arrivalStop?: (google.maps.routing.v2.ITransitStop|null); + + /** TransitStopDetails arrivalTime */ + arrivalTime?: (google.protobuf.ITimestamp|null); + + /** TransitStopDetails departureStop */ + departureStop?: (google.maps.routing.v2.ITransitStop|null); + + /** TransitStopDetails departureTime */ + departureTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TransitStopDetails. */ + class TransitStopDetails implements ITransitStopDetails { + + /** + * Constructs a new TransitStopDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails); + + /** TransitStopDetails arrivalStop. */ + public arrivalStop?: (google.maps.routing.v2.ITransitStop|null); + + /** TransitStopDetails arrivalTime. */ + public arrivalTime?: (google.protobuf.ITimestamp|null); + + /** TransitStopDetails departureStop. */ + public departureStop?: (google.maps.routing.v2.ITransitStop|null); + + /** TransitStopDetails departureTime. */ + public departureTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TransitStopDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitStopDetails instance + */ + public static create(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails): google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; + + /** + * Encodes the specified TransitStopDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. + * @param message TransitStopDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitStopDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. + * @param message TransitStopDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitStopDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitStopDetails + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; + + /** + * Decodes a TransitStopDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitStopDetails + * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; + + /** + * Verifies a TransitStopDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitStopDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitStopDetails + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; + + /** + * Creates a plain object from a TransitStopDetails message. Also converts values to other types if specified. + * @param message TransitStopDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitStopDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitStopDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitDetailsLocalizedValues. */ + interface ITransitDetailsLocalizedValues { + + /** TransitDetailsLocalizedValues arrivalTime */ + arrivalTime?: (google.maps.routing.v2.ILocalizedTime|null); + + /** TransitDetailsLocalizedValues departureTime */ + departureTime?: (google.maps.routing.v2.ILocalizedTime|null); + } + + /** Represents a TransitDetailsLocalizedValues. */ + class TransitDetailsLocalizedValues implements ITransitDetailsLocalizedValues { + + /** + * Constructs a new TransitDetailsLocalizedValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues); + + /** TransitDetailsLocalizedValues arrivalTime. */ + public arrivalTime?: (google.maps.routing.v2.ILocalizedTime|null); + + /** TransitDetailsLocalizedValues departureTime. */ + public departureTime?: (google.maps.routing.v2.ILocalizedTime|null); + + /** + * Creates a new TransitDetailsLocalizedValues instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitDetailsLocalizedValues instance + */ + public static create(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues): google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; + + /** + * Encodes the specified TransitDetailsLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. + * @param message TransitDetailsLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitDetailsLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. + * @param message TransitDetailsLocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitDetailsLocalizedValues + * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; + + /** + * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitDetailsLocalizedValues + * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; + + /** + * Verifies a TransitDetailsLocalizedValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitDetailsLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitDetailsLocalizedValues + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; + + /** + * Creates a plain object from a TransitDetailsLocalizedValues message. Also converts values to other types if specified. + * @param message TransitDetailsLocalizedValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitDetailsLocalizedValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitDetailsLocalizedValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** RouteLabel enum. */ + enum RouteLabel { + ROUTE_LABEL_UNSPECIFIED = 0, + DEFAULT_ROUTE = 1, + DEFAULT_ROUTE_ALTERNATE = 2, + FUEL_EFFICIENT = 3, + SHORTER_DISTANCE = 4 + } + + /** RouteTravelMode enum. */ + enum RouteTravelMode { + TRAVEL_MODE_UNSPECIFIED = 0, + DRIVE = 1, + BICYCLE = 2, + WALK = 3, + TWO_WHEELER = 4, + TRANSIT = 7 + } + + /** Properties of a SpeedReadingInterval. */ + interface ISpeedReadingInterval { + + /** SpeedReadingInterval startPolylinePointIndex */ + startPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval endPolylinePointIndex */ + endPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval speed */ + speed?: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed|null); + } + + /** Represents a SpeedReadingInterval. */ + class SpeedReadingInterval implements ISpeedReadingInterval { + + /** + * Constructs a new SpeedReadingInterval. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ISpeedReadingInterval); + + /** SpeedReadingInterval startPolylinePointIndex. */ + public startPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval endPolylinePointIndex. */ + public endPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval speed. */ + public speed?: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed|null); + + /** SpeedReadingInterval speedType. */ + public speedType?: "speed"; + + /** + * Creates a new SpeedReadingInterval instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeedReadingInterval instance + */ + public static create(properties?: google.maps.routing.v2.ISpeedReadingInterval): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @param message SpeedReadingInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @param message SpeedReadingInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeedReadingInterval + * @throws {Error} If the payload is not 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.routing.v2.SpeedReadingInterval; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeedReadingInterval + * @throws {Error} If the payload 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.routing.v2.SpeedReadingInterval; + + /** + * Verifies a SpeedReadingInterval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeedReadingInterval + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. + * @param message SpeedReadingInterval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.SpeedReadingInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeedReadingInterval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeedReadingInterval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeedReadingInterval { + + /** Speed enum. */ + enum Speed { + SPEED_UNSPECIFIED = 0, + NORMAL = 1, + SLOW = 2, + TRAFFIC_JAM = 3 + } + } + + /** Properties of a TollInfo. */ + interface ITollInfo { + + /** TollInfo estimatedPrice */ + estimatedPrice?: (google.type.IMoney[]|null); + } + + /** Represents a TollInfo. */ + class TollInfo implements ITollInfo { + + /** + * Constructs a new TollInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITollInfo); + + /** TollInfo estimatedPrice. */ + public estimatedPrice: google.type.IMoney[]; + + /** + * Creates a new TollInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TollInfo instance + */ + public static create(properties?: google.maps.routing.v2.ITollInfo): google.maps.routing.v2.TollInfo; + + /** + * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @param message TollInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @param message TollInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TollInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TollInfo + * @throws {Error} If the payload is not 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.routing.v2.TollInfo; + + /** + * Decodes a TollInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TollInfo + * @throws {Error} If the payload 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.routing.v2.TollInfo; + + /** + * Verifies a TollInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TollInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TollInfo; + + /** + * Creates a plain object from a TollInfo message. Also converts values to other types if specified. + * @param message TollInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TollInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TollInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TollInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitAgency. */ + interface ITransitAgency { + + /** TransitAgency name */ + name?: (string|null); + + /** TransitAgency phoneNumber */ + phoneNumber?: (string|null); + + /** TransitAgency uri */ + uri?: (string|null); + } + + /** Represents a TransitAgency. */ + class TransitAgency implements ITransitAgency { + + /** + * Constructs a new TransitAgency. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITransitAgency); + + /** TransitAgency name. */ + public name: string; + + /** TransitAgency phoneNumber. */ + public phoneNumber: string; + + /** TransitAgency uri. */ + public uri: string; + + /** + * Creates a new TransitAgency instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitAgency instance + */ + public static create(properties?: google.maps.routing.v2.ITransitAgency): google.maps.routing.v2.TransitAgency; + + /** + * Encodes the specified TransitAgency message. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. + * @param message TransitAgency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITransitAgency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitAgency message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. + * @param message TransitAgency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITransitAgency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitAgency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitAgency + * @throws {Error} If the payload is not 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.routing.v2.TransitAgency; + + /** + * Decodes a TransitAgency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitAgency + * @throws {Error} If the payload 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.routing.v2.TransitAgency; + + /** + * Verifies a TransitAgency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitAgency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitAgency + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitAgency; + + /** + * Creates a plain object from a TransitAgency message. Also converts values to other types if specified. + * @param message TransitAgency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TransitAgency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitAgency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitAgency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitLine. */ + interface ITransitLine { + + /** TransitLine agencies */ + agencies?: (google.maps.routing.v2.ITransitAgency[]|null); + + /** TransitLine name */ + name?: (string|null); + + /** TransitLine uri */ + uri?: (string|null); + + /** TransitLine color */ + color?: (string|null); + + /** TransitLine iconUri */ + iconUri?: (string|null); + + /** TransitLine nameShort */ + nameShort?: (string|null); + + /** TransitLine textColor */ + textColor?: (string|null); + + /** TransitLine vehicle */ + vehicle?: (google.maps.routing.v2.ITransitVehicle|null); + } + + /** Represents a TransitLine. */ + class TransitLine implements ITransitLine { + + /** + * Constructs a new TransitLine. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITransitLine); + + /** TransitLine agencies. */ + public agencies: google.maps.routing.v2.ITransitAgency[]; + + /** TransitLine name. */ + public name: string; + + /** TransitLine uri. */ + public uri: string; + + /** TransitLine color. */ + public color: string; + + /** TransitLine iconUri. */ + public iconUri: string; + + /** TransitLine nameShort. */ + public nameShort: string; + + /** TransitLine textColor. */ + public textColor: string; + + /** TransitLine vehicle. */ + public vehicle?: (google.maps.routing.v2.ITransitVehicle|null); + + /** + * Creates a new TransitLine instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitLine instance + */ + public static create(properties?: google.maps.routing.v2.ITransitLine): google.maps.routing.v2.TransitLine; + + /** + * Encodes the specified TransitLine message. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. + * @param message TransitLine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITransitLine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitLine message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. + * @param message TransitLine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITransitLine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitLine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitLine + * @throws {Error} If the payload is not 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.routing.v2.TransitLine; + + /** + * Decodes a TransitLine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitLine + * @throws {Error} If the payload 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.routing.v2.TransitLine; + + /** + * Verifies a TransitLine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitLine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitLine + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitLine; + + /** + * Creates a plain object from a TransitLine message. Also converts values to other types if specified. + * @param message TransitLine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TransitLine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitLine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitLine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitStop. */ + interface ITransitStop { + + /** TransitStop name */ + name?: (string|null); + + /** TransitStop location */ + location?: (google.maps.routing.v2.ILocation|null); + } + + /** Represents a TransitStop. */ + class TransitStop implements ITransitStop { + + /** + * Constructs a new TransitStop. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITransitStop); + + /** TransitStop name. */ + public name: string; + + /** TransitStop location. */ + public location?: (google.maps.routing.v2.ILocation|null); + + /** + * Creates a new TransitStop instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitStop instance + */ + public static create(properties?: google.maps.routing.v2.ITransitStop): google.maps.routing.v2.TransitStop; + + /** + * Encodes the specified TransitStop message. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. + * @param message TransitStop message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITransitStop, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitStop message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. + * @param message TransitStop message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITransitStop, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitStop message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitStop + * @throws {Error} If the payload is not 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.routing.v2.TransitStop; + + /** + * Decodes a TransitStop message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitStop + * @throws {Error} If the payload 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.routing.v2.TransitStop; + + /** + * Verifies a TransitStop message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitStop message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitStop + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitStop; + + /** + * Creates a plain object from a TransitStop message. Also converts values to other types if specified. + * @param message TransitStop + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TransitStop, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitStop to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitStop + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitVehicle. */ + interface ITransitVehicle { + + /** TransitVehicle name */ + name?: (google.type.ILocalizedText|null); + + /** TransitVehicle type */ + type?: (google.maps.routing.v2.TransitVehicle.TransitVehicleType|keyof typeof google.maps.routing.v2.TransitVehicle.TransitVehicleType|null); + + /** TransitVehicle iconUri */ + iconUri?: (string|null); + + /** TransitVehicle localIconUri */ + localIconUri?: (string|null); + } + + /** Represents a TransitVehicle. */ + class TransitVehicle implements ITransitVehicle { + + /** + * Constructs a new TransitVehicle. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITransitVehicle); + + /** TransitVehicle name. */ + public name?: (google.type.ILocalizedText|null); + + /** TransitVehicle type. */ + public type: (google.maps.routing.v2.TransitVehicle.TransitVehicleType|keyof typeof google.maps.routing.v2.TransitVehicle.TransitVehicleType); + + /** TransitVehicle iconUri. */ + public iconUri: string; + + /** TransitVehicle localIconUri. */ + public localIconUri: string; + + /** + * Creates a new TransitVehicle instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitVehicle instance + */ + public static create(properties?: google.maps.routing.v2.ITransitVehicle): google.maps.routing.v2.TransitVehicle; + + /** + * Encodes the specified TransitVehicle message. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. + * @param message TransitVehicle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITransitVehicle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitVehicle message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. + * @param message TransitVehicle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITransitVehicle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitVehicle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitVehicle + * @throws {Error} If the payload is not 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.routing.v2.TransitVehicle; + + /** + * Decodes a TransitVehicle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitVehicle + * @throws {Error} If the payload 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.routing.v2.TransitVehicle; + + /** + * Verifies a TransitVehicle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitVehicle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitVehicle + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitVehicle; + + /** + * Creates a plain object from a TransitVehicle message. Also converts values to other types if specified. + * @param message TransitVehicle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TransitVehicle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitVehicle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitVehicle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitVehicle { + + /** TransitVehicleType enum. */ + enum TransitVehicleType { + TRANSIT_VEHICLE_TYPE_UNSPECIFIED = 0, + BUS = 1, + CABLE_CAR = 2, + COMMUTER_TRAIN = 3, + FERRY = 4, + FUNICULAR = 5, + GONDOLA_LIFT = 6, + HEAVY_RAIL = 7, + HIGH_SPEED_TRAIN = 8, + INTERCITY_BUS = 9, + LONG_DISTANCE_TRAIN = 10, + METRO_RAIL = 11, + MONORAIL = 12, + OTHER = 13, + RAIL = 14, + SHARE_TAXI = 15, + SUBWAY = 16, + TRAM = 17, + TROLLEYBUS = 18 + } + } + + /** Properties of a RouteModifiers. */ + interface IRouteModifiers { + + /** RouteModifiers avoidTolls */ + avoidTolls?: (boolean|null); + + /** RouteModifiers avoidHighways */ + avoidHighways?: (boolean|null); + + /** RouteModifiers avoidFerries */ + avoidFerries?: (boolean|null); + + /** RouteModifiers avoidIndoor */ + avoidIndoor?: (boolean|null); + + /** RouteModifiers vehicleInfo */ + vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); + + /** RouteModifiers tollPasses */ + tollPasses?: (google.maps.routing.v2.TollPass[]|null); + } + + /** Represents a RouteModifiers. */ + class RouteModifiers implements IRouteModifiers { + + /** + * Constructs a new RouteModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteModifiers); + + /** RouteModifiers avoidTolls. */ + public avoidTolls: boolean; + + /** RouteModifiers avoidHighways. */ + public avoidHighways: boolean; + + /** RouteModifiers avoidFerries. */ + public avoidFerries: boolean; + + /** RouteModifiers avoidIndoor. */ + public avoidIndoor: boolean; + + /** RouteModifiers vehicleInfo. */ + public vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); + + /** RouteModifiers tollPasses. */ + public tollPasses: google.maps.routing.v2.TollPass[]; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteModifiers instance + */ + public static create(properties?: google.maps.routing.v2.IRouteModifiers): google.maps.routing.v2.RouteModifiers; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteModifiers + * @throws {Error} If the payload is not 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.routing.v2.RouteModifiers; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteModifiers + * @throws {Error} If the payload 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.routing.v2.RouteModifiers; + + /** + * Verifies a RouteModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteModifiers + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteModifiers; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @param message RouteModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteModifiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteModifiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TollPass enum. */ + enum TollPass { + TOLL_PASS_UNSPECIFIED = 0, + AU_ETOLL_TAG = 82, + AU_EWAY_TAG = 83, + AU_LINKT = 2, + AR_TELEPASE = 3, + BR_AUTO_EXPRESO = 81, + BR_CONECTCAR = 7, + BR_MOVE_MAIS = 8, + BR_PASSA_RAPIDO = 88, + BR_SEM_PARAR = 9, + BR_TAGGY = 10, + BR_VELOE = 11, + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84, + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85, + CA_US_BLUE_WATER_EDGE_PASS = 18, + CA_US_CONNEXION = 19, + CA_US_NEXUS_CARD = 20, + ID_E_TOLL = 16, + IN_FASTAG = 78, + IN_LOCAL_HP_PLATE_EXEMPT = 79, + JP_ETC = 98, + JP_ETC2 = 99, + MX_IAVE = 90, + MX_PASE = 91, + MX_QUICKPASS = 93, + MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89, + MX_TAG_IAVE = 12, + MX_TAG_TELEVIA = 13, + MX_TELEVIA = 92, + MX_VIAPASS = 14, + US_AL_FREEDOM_PASS = 21, + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22, + US_CA_FASTRAK = 4, + US_CA_FASTRAK_CAV_STICKER = 86, + US_CO_EXPRESSTOLL = 23, + US_CO_GO_PASS = 24, + US_DE_EZPASSDE = 25, + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65, + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66, + US_FL_EPASS = 67, + US_FL_GIBA_TOLL_PASS = 68, + US_FL_LEEWAY = 69, + US_FL_SUNPASS = 70, + US_FL_SUNPASS_PRO = 71, + US_IL_EZPASSIL = 73, + US_IL_IPASS = 72, + US_IN_EZPASSIN = 26, + US_KS_BESTPASS_HORIZON = 27, + US_KS_KTAG = 28, + US_KS_NATIONALPASS = 29, + US_KS_PREPASS_ELITEPASS = 30, + US_KY_RIVERLINK = 31, + US_LA_GEAUXPASS = 32, + US_LA_TOLL_TAG = 33, + US_MA_EZPASSMA = 6, + US_MD_EZPASSMD = 34, + US_ME_EZPASSME = 35, + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36, + US_MI_BCPASS = 94, + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37, + US_MI_IQ_PROX_CARD = 38, + US_MI_IQ_TAG = 95, + US_MI_MACKINAC_BRIDGE_MAC_PASS = 39, + US_MI_NEXPRESS_TOLL = 40, + US_MN_EZPASSMN = 41, + US_NC_EZPASSNC = 42, + US_NC_PEACH_PASS = 87, + US_NC_QUICK_PASS = 43, + US_NH_EZPASSNH = 80, + US_NJ_DOWNBEACH_EXPRESS_PASS = 75, + US_NJ_EZPASSNJ = 74, + US_NY_EXPRESSPASS = 76, + US_NY_EZPASSNY = 77, + US_OH_EZPASSOH = 44, + US_PA_EZPASSPA = 45, + US_RI_EZPASSRI = 46, + US_SC_PALPASS = 47, + US_TX_AVI_TAG = 97, + US_TX_BANCPASS = 48, + US_TX_DEL_RIO_PASS = 49, + US_TX_EFAST_PASS = 50, + US_TX_EAGLE_PASS_EXPRESS_CARD = 51, + US_TX_EPTOLL = 52, + US_TX_EZ_CROSS = 53, + US_TX_EZTAG = 54, + US_TX_FUEGO_TAG = 96, + US_TX_LAREDO_TRADE_TAG = 55, + US_TX_PLUSPASS = 56, + US_TX_TOLLTAG = 57, + US_TX_TXTAG = 58, + US_TX_XPRESS_CARD = 59, + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60, + US_VA_EZPASSVA = 61, + US_WA_BREEZEBY = 17, + US_WA_GOOD_TO_GO = 1, + US_WV_EZPASSWV = 62, + US_WV_MEMORIAL_BRIDGE_TICKETS = 63, + US_WV_MOV_PASS = 100, + US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64 + } + + /** Properties of a VehicleInfo. */ + interface IVehicleInfo { + + /** VehicleInfo emissionType */ + emissionType?: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType|null); + } + + /** Represents a VehicleInfo. */ + class VehicleInfo implements IVehicleInfo { + + /** + * Constructs a new VehicleInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IVehicleInfo); + + /** VehicleInfo emissionType. */ + public emissionType: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType); + + /** + * Creates a new VehicleInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns VehicleInfo instance + */ + public static create(properties?: google.maps.routing.v2.IVehicleInfo): google.maps.routing.v2.VehicleInfo; + + /** + * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @param message VehicleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @param message VehicleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VehicleInfo + * @throws {Error} If the payload is not 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.routing.v2.VehicleInfo; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VehicleInfo + * @throws {Error} If the payload 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.routing.v2.VehicleInfo; + + /** + * Verifies a VehicleInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VehicleInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.VehicleInfo; + + /** + * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. + * @param message VehicleInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.VehicleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VehicleInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VehicleInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VehicleEmissionType enum. */ + enum VehicleEmissionType { + VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0, + GASOLINE = 1, + ELECTRIC = 2, + HYBRID = 3, + DIESEL = 4 + } + + /** Represents a Routes */ + class Routes extends $protobuf.rpc.Service { + + /** + * Constructs a new Routes 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 Routes 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): Routes; + + /** + * Calls ComputeRoutes. + * @param request ComputeRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ComputeRoutesResponse + */ + public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest, callback: google.maps.routing.v2.Routes.ComputeRoutesCallback): void; + + /** + * Calls ComputeRoutes. + * @param request ComputeRoutesRequest message or plain object + * @returns Promise + */ + public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest): Promise; + + /** + * Calls ComputeRouteMatrix. + * @param request ComputeRouteMatrixRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouteMatrixElement + */ + public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest, callback: google.maps.routing.v2.Routes.ComputeRouteMatrixCallback): void; + + /** + * Calls ComputeRouteMatrix. + * @param request ComputeRouteMatrixRequest message or plain object + * @returns Promise + */ + public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest): Promise; + } + + namespace Routes { + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. + * @param error Error, if any + * @param [response] ComputeRoutesResponse + */ + type ComputeRoutesCallback = (error: (Error|null), response?: google.maps.routing.v2.ComputeRoutesResponse) => void; + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. + * @param error Error, if any + * @param [response] RouteMatrixElement + */ + type ComputeRouteMatrixCallback = (error: (Error|null), response?: google.maps.routing.v2.RouteMatrixElement) => void; + } + + /** Properties of a ComputeRoutesRequest. */ + interface IComputeRoutesRequest { + + /** ComputeRoutesRequest origin */ + origin?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest destination */ + destination?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest intermediates */ + intermediates?: (google.maps.routing.v2.IWaypoint[]|null); + + /** ComputeRoutesRequest travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + + /** ComputeRoutesRequest routingPreference */ + routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); + + /** ComputeRoutesRequest polylineQuality */ + polylineQuality?: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality|null); + + /** ComputeRoutesRequest polylineEncoding */ + polylineEncoding?: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding|null); + + /** ComputeRoutesRequest departureTime */ + departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest arrivalTime */ + arrivalTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest computeAlternativeRoutes */ + computeAlternativeRoutes?: (boolean|null); + + /** ComputeRoutesRequest routeModifiers */ + routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** ComputeRoutesRequest languageCode */ + languageCode?: (string|null); + + /** ComputeRoutesRequest regionCode */ + regionCode?: (string|null); + + /** ComputeRoutesRequest units */ + units?: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units|null); + + /** ComputeRoutesRequest optimizeWaypointOrder */ + optimizeWaypointOrder?: (boolean|null); + + /** ComputeRoutesRequest requestedReferenceRoutes */ + requestedReferenceRoutes?: (google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[]|null); + + /** ComputeRoutesRequest extraComputations */ + extraComputations?: (google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[]|null); + + /** ComputeRoutesRequest trafficModel */ + trafficModel?: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel|null); + + /** ComputeRoutesRequest transitPreferences */ + transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); + } + + /** Represents a ComputeRoutesRequest. */ + class ComputeRoutesRequest implements IComputeRoutesRequest { + + /** + * Constructs a new ComputeRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRoutesRequest); + + /** ComputeRoutesRequest origin. */ + public origin?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest destination. */ + public destination?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest intermediates. */ + public intermediates: google.maps.routing.v2.IWaypoint[]; + + /** ComputeRoutesRequest travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** ComputeRoutesRequest routingPreference. */ + public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); + + /** ComputeRoutesRequest polylineQuality. */ + public polylineQuality: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality); + + /** ComputeRoutesRequest polylineEncoding. */ + public polylineEncoding: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding); + + /** ComputeRoutesRequest departureTime. */ + public departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest arrivalTime. */ + public arrivalTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest computeAlternativeRoutes. */ + public computeAlternativeRoutes: boolean; + + /** ComputeRoutesRequest routeModifiers. */ + public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** ComputeRoutesRequest languageCode. */ + public languageCode: string; + + /** ComputeRoutesRequest regionCode. */ + public regionCode: string; + + /** ComputeRoutesRequest units. */ + public units: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units); + + /** ComputeRoutesRequest optimizeWaypointOrder. */ + public optimizeWaypointOrder: boolean; + + /** ComputeRoutesRequest requestedReferenceRoutes. */ + public requestedReferenceRoutes: google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[]; + + /** ComputeRoutesRequest extraComputations. */ + public extraComputations: google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[]; + + /** ComputeRoutesRequest trafficModel. */ + public trafficModel: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel); + + /** ComputeRoutesRequest transitPreferences. */ + public transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); + + /** + * Creates a new ComputeRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRoutesRequest instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRoutesRequest): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @param message ComputeRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @param message ComputeRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRoutesRequest + * @throws {Error} If the payload is not 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.routing.v2.ComputeRoutesRequest; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRoutesRequest + * @throws {Error} If the payload 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.routing.v2.ComputeRoutesRequest; + + /** + * Verifies a ComputeRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. + * @param message ComputeRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeRoutesRequest { + + /** ReferenceRoute enum. */ + enum ReferenceRoute { + REFERENCE_ROUTE_UNSPECIFIED = 0, + FUEL_EFFICIENT = 1, + SHORTER_DISTANCE = 2 + } + + /** ExtraComputation enum. */ + enum ExtraComputation { + EXTRA_COMPUTATION_UNSPECIFIED = 0, + TOLLS = 1, + FUEL_CONSUMPTION = 2, + TRAFFIC_ON_POLYLINE = 3, + HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4, + FLYOVER_INFO_ON_POLYLINE = 7, + NARROW_ROAD_INFO_ON_POLYLINE = 8 + } + } + + /** Properties of a ComputeRoutesResponse. */ + interface IComputeRoutesResponse { + + /** ComputeRoutesResponse routes */ + routes?: (google.maps.routing.v2.IRoute[]|null); + + /** ComputeRoutesResponse fallbackInfo */ + fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** ComputeRoutesResponse geocodingResults */ + geocodingResults?: (google.maps.routing.v2.IGeocodingResults|null); + } + + /** Represents a ComputeRoutesResponse. */ + class ComputeRoutesResponse implements IComputeRoutesResponse { + + /** + * Constructs a new ComputeRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRoutesResponse); + + /** ComputeRoutesResponse routes. */ + public routes: google.maps.routing.v2.IRoute[]; + + /** ComputeRoutesResponse fallbackInfo. */ + public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** ComputeRoutesResponse geocodingResults. */ + public geocodingResults?: (google.maps.routing.v2.IGeocodingResults|null); + + /** + * Creates a new ComputeRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRoutesResponse instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRoutesResponse): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @param message ComputeRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @param message ComputeRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRoutesResponse + * @throws {Error} If the payload is not 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.routing.v2.ComputeRoutesResponse; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRoutesResponse + * @throws {Error} If the payload 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.routing.v2.ComputeRoutesResponse; + + /** + * Verifies a ComputeRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. + * @param message ComputeRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeRouteMatrixRequest. */ + interface IComputeRouteMatrixRequest { + + /** ComputeRouteMatrixRequest origins */ + origins?: (google.maps.routing.v2.IRouteMatrixOrigin[]|null); + + /** ComputeRouteMatrixRequest destinations */ + destinations?: (google.maps.routing.v2.IRouteMatrixDestination[]|null); + + /** ComputeRouteMatrixRequest travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + + /** ComputeRouteMatrixRequest routingPreference */ + routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); + + /** ComputeRouteMatrixRequest departureTime */ + departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRouteMatrixRequest arrivalTime */ + arrivalTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRouteMatrixRequest languageCode */ + languageCode?: (string|null); + + /** ComputeRouteMatrixRequest regionCode */ + regionCode?: (string|null); + + /** ComputeRouteMatrixRequest units */ + units?: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units|null); + + /** ComputeRouteMatrixRequest extraComputations */ + extraComputations?: (google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[]|null); + + /** ComputeRouteMatrixRequest trafficModel */ + trafficModel?: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel|null); + + /** ComputeRouteMatrixRequest transitPreferences */ + transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); + } + + /** Represents a ComputeRouteMatrixRequest. */ + class ComputeRouteMatrixRequest implements IComputeRouteMatrixRequest { + + /** + * Constructs a new ComputeRouteMatrixRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest); + + /** ComputeRouteMatrixRequest origins. */ + public origins: google.maps.routing.v2.IRouteMatrixOrigin[]; + + /** ComputeRouteMatrixRequest destinations. */ + public destinations: google.maps.routing.v2.IRouteMatrixDestination[]; + + /** ComputeRouteMatrixRequest travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** ComputeRouteMatrixRequest routingPreference. */ + public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); + + /** ComputeRouteMatrixRequest departureTime. */ + public departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRouteMatrixRequest arrivalTime. */ + public arrivalTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRouteMatrixRequest languageCode. */ + public languageCode: string; + + /** ComputeRouteMatrixRequest regionCode. */ + public regionCode: string; + + /** ComputeRouteMatrixRequest units. */ + public units: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units); + + /** ComputeRouteMatrixRequest extraComputations. */ + public extraComputations: google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[]; + + /** ComputeRouteMatrixRequest trafficModel. */ + public trafficModel: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel); + + /** ComputeRouteMatrixRequest transitPreferences. */ + public transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); + + /** + * Creates a new ComputeRouteMatrixRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRouteMatrixRequest instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @param message ComputeRouteMatrixRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @param message ComputeRouteMatrixRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRouteMatrixRequest + * @throws {Error} If the payload is not 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.routing.v2.ComputeRouteMatrixRequest; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRouteMatrixRequest + * @throws {Error} If the payload 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.routing.v2.ComputeRouteMatrixRequest; + + /** + * Verifies a ComputeRouteMatrixRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRouteMatrixRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. + * @param message ComputeRouteMatrixRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRouteMatrixRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRouteMatrixRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRouteMatrixRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeRouteMatrixRequest { + + /** ExtraComputation enum. */ + enum ExtraComputation { + EXTRA_COMPUTATION_UNSPECIFIED = 0, + TOLLS = 1 + } + } + + /** Properties of a RouteMatrixOrigin. */ + interface IRouteMatrixOrigin { + + /** RouteMatrixOrigin waypoint */ + waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** RouteMatrixOrigin routeModifiers */ + routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + } + + /** Represents a RouteMatrixOrigin. */ + class RouteMatrixOrigin implements IRouteMatrixOrigin { + + /** + * Constructs a new RouteMatrixOrigin. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixOrigin); + + /** RouteMatrixOrigin waypoint. */ + public waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** RouteMatrixOrigin routeModifiers. */ + public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** + * Creates a new RouteMatrixOrigin instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixOrigin instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixOrigin): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @param message RouteMatrixOrigin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @param message RouteMatrixOrigin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixOrigin + * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixOrigin; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixOrigin + * @throws {Error} If the payload 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.routing.v2.RouteMatrixOrigin; + + /** + * Verifies a RouteMatrixOrigin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixOrigin + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. + * @param message RouteMatrixOrigin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixOrigin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixOrigin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixOrigin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatrixDestination. */ + interface IRouteMatrixDestination { + + /** RouteMatrixDestination waypoint */ + waypoint?: (google.maps.routing.v2.IWaypoint|null); + } + + /** Represents a RouteMatrixDestination. */ + class RouteMatrixDestination implements IRouteMatrixDestination { + + /** + * Constructs a new RouteMatrixDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixDestination); + + /** RouteMatrixDestination waypoint. */ + public waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** + * Creates a new RouteMatrixDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixDestination instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixDestination): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @param message RouteMatrixDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @param message RouteMatrixDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixDestination + * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixDestination; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixDestination + * @throws {Error} If the payload 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.routing.v2.RouteMatrixDestination; + + /** + * Verifies a RouteMatrixDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixDestination + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. + * @param message RouteMatrixDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatrixElement. */ + interface IRouteMatrixElement { + + /** RouteMatrixElement originIndex */ + originIndex?: (number|null); + + /** RouteMatrixElement destinationIndex */ + destinationIndex?: (number|null); + + /** RouteMatrixElement status */ + status?: (google.rpc.IStatus|null); + + /** RouteMatrixElement condition */ + condition?: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition|null); + + /** RouteMatrixElement distanceMeters */ + distanceMeters?: (number|null); + + /** RouteMatrixElement duration */ + duration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** RouteMatrixElement fallbackInfo */ + fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** RouteMatrixElement localizedValues */ + localizedValues?: (google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null); + } + + /** Represents a RouteMatrixElement. */ + class RouteMatrixElement implements IRouteMatrixElement { + + /** + * Constructs a new RouteMatrixElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixElement); + + /** RouteMatrixElement originIndex. */ + public originIndex?: (number|null); + + /** RouteMatrixElement destinationIndex. */ + public destinationIndex?: (number|null); + + /** RouteMatrixElement status. */ + public status?: (google.rpc.IStatus|null); + + /** RouteMatrixElement condition. */ + public condition: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition); + + /** RouteMatrixElement distanceMeters. */ + public distanceMeters: number; + + /** RouteMatrixElement duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** RouteMatrixElement fallbackInfo. */ + public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** RouteMatrixElement localizedValues. */ + public localizedValues?: (google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null); + + /** + * Creates a new RouteMatrixElement instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixElement instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixElement): google.maps.routing.v2.RouteMatrixElement; + + /** + * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @param message RouteMatrixElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @param message RouteMatrixElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixElement + * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixElement; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixElement + * @throws {Error} If the payload 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.routing.v2.RouteMatrixElement; + + /** + * Verifies a RouteMatrixElement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixElement + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixElement; + + /** + * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. + * @param message RouteMatrixElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixElement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RouteMatrixElement { + + /** Properties of a LocalizedValues. */ + interface ILocalizedValues { + + /** LocalizedValues distance */ + distance?: (google.type.ILocalizedText|null); + + /** LocalizedValues duration */ + duration?: (google.type.ILocalizedText|null); + + /** LocalizedValues staticDuration */ + staticDuration?: (google.type.ILocalizedText|null); + + /** LocalizedValues transitFare */ + transitFare?: (google.type.ILocalizedText|null); + } + + /** Represents a LocalizedValues. */ + class LocalizedValues implements ILocalizedValues { + + /** + * Constructs a new LocalizedValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues); + + /** LocalizedValues distance. */ + public distance?: (google.type.ILocalizedText|null); + + /** LocalizedValues duration. */ + public duration?: (google.type.ILocalizedText|null); + + /** LocalizedValues staticDuration. */ + public staticDuration?: (google.type.ILocalizedText|null); + + /** LocalizedValues transitFare. */ + public transitFare?: (google.type.ILocalizedText|null); + + /** + * Creates a new LocalizedValues instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedValues instance + */ + public static create(properties?: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues): google.maps.routing.v2.RouteMatrixElement.LocalizedValues; + + /** + * Encodes the specified LocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. + * @param message LocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. + * @param message LocalizedValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedValues + * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixElement.LocalizedValues; + + /** + * Decodes a LocalizedValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedValues + * @throws {Error} If the payload 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.routing.v2.RouteMatrixElement.LocalizedValues; + + /** + * Verifies a LocalizedValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedValues + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixElement.LocalizedValues; + + /** + * Creates a plain object from a LocalizedValues message. Also converts values to other types if specified. + * @param message LocalizedValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixElement.LocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalizedValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** RouteMatrixElementCondition enum. */ + enum RouteMatrixElementCondition { + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0, + ROUTE_EXISTS = 1, + ROUTE_NOT_FOUND = 2 + } + + /** RoutingPreference enum. */ + enum RoutingPreference { + ROUTING_PREFERENCE_UNSPECIFIED = 0, + TRAFFIC_UNAWARE = 1, + TRAFFIC_AWARE = 2, + TRAFFIC_AWARE_OPTIMAL = 3 + } + + /** TrafficModel enum. */ + enum TrafficModel { + TRAFFIC_MODEL_UNSPECIFIED = 0, + BEST_GUESS = 1, + PESSIMISTIC = 2, + OPTIMISTIC = 3 + } + + /** Properties of a TransitPreferences. */ + interface ITransitPreferences { + + /** TransitPreferences allowedTravelModes */ + allowedTravelModes?: (google.maps.routing.v2.TransitPreferences.TransitTravelMode[]|null); + + /** TransitPreferences routingPreference */ + routingPreference?: (google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|keyof typeof google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|null); + } + + /** Represents a TransitPreferences. */ + class TransitPreferences implements ITransitPreferences { + + /** + * Constructs a new TransitPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITransitPreferences); + + /** TransitPreferences allowedTravelModes. */ + public allowedTravelModes: google.maps.routing.v2.TransitPreferences.TransitTravelMode[]; + + /** TransitPreferences routingPreference. */ + public routingPreference: (google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|keyof typeof google.maps.routing.v2.TransitPreferences.TransitRoutingPreference); + + /** + * Creates a new TransitPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitPreferences instance + */ + public static create(properties?: google.maps.routing.v2.ITransitPreferences): google.maps.routing.v2.TransitPreferences; + + /** + * Encodes the specified TransitPreferences message. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. + * @param message TransitPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITransitPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitPreferences message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. + * @param message TransitPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITransitPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitPreferences + * @throws {Error} If the payload is not 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.routing.v2.TransitPreferences; + + /** + * Decodes a TransitPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitPreferences + * @throws {Error} If the payload 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.routing.v2.TransitPreferences; + + /** + * Verifies a TransitPreferences message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransitPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitPreferences + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitPreferences; + + /** + * Creates a plain object from a TransitPreferences message. Also converts values to other types if specified. + * @param message TransitPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TransitPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitPreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitPreferences { + + /** TransitTravelMode enum. */ + enum TransitTravelMode { + TRANSIT_TRAVEL_MODE_UNSPECIFIED = 0, + BUS = 1, + SUBWAY = 2, + TRAIN = 3, + LIGHT_RAIL = 4, + RAIL = 5 + } + + /** TransitRoutingPreference enum. */ + enum TransitRoutingPreference { + TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED = 0, + LESS_WALKING = 1, + FEWER_TRANSFERS = 2 + } + } + + /** Units enum. */ + enum Units { + UNITS_UNSPECIFIED = 0, + METRIC = 1, + IMPERIAL = 2 + } + + /** Properties of a Waypoint. */ + interface IWaypoint { + + /** Waypoint location */ + location?: (google.maps.routing.v2.ILocation|null); + + /** Waypoint placeId */ + placeId?: (string|null); + + /** Waypoint address */ + address?: (string|null); + + /** Waypoint navigationPointToken */ + navigationPointToken?: (string|null); + + /** Waypoint via */ + via?: (boolean|null); + + /** Waypoint vehicleStopover */ + vehicleStopover?: (boolean|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.routing.v2.IWaypoint); + + /** Waypoint location. */ + public location?: (google.maps.routing.v2.ILocation|null); + + /** Waypoint placeId. */ + public placeId?: (string|null); + + /** Waypoint address. */ + public address?: (string|null); + + /** Waypoint navigationPointToken. */ + public navigationPointToken?: (string|null); + + /** Waypoint via. */ + public via: boolean; + + /** Waypoint vehicleStopover. */ + public vehicleStopover: boolean; + + /** Waypoint sideOfRoad. */ + public sideOfRoad: boolean; + + /** Waypoint locationType. */ + public locationType?: ("location"|"placeId"|"address"|"navigationPointToken"); + + /** + * Creates a new Waypoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Waypoint instance + */ + public static create(properties?: google.maps.routing.v2.IWaypoint): google.maps.routing.v2.Waypoint; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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; + } + } + } + } + + /** 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 api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } +} diff --git a/owl-bot-staging/google-maps-routing/protos/protos.js b/owl-bot-staging/google-maps-routing/protos/protos.js new file mode 100644 index 00000000000..f61a469c4b6 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/protos.js @@ -0,0 +1,37043 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._googlemaps_routing_protos || ($protobuf.roots._googlemaps_routing_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + 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 a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * 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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + 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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * 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; + + /** + * 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.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + 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"; + } + 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]); + } + 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.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.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.geo = (function() { + + /** + * Namespace geo. + * @memberof google + * @namespace + */ + var geo = {}; + + geo.type = (function() { + + /** + * Namespace type. + * @memberof google.geo + * @namespace + */ + var type = {}; + + type.Viewport = (function() { + + /** + * Properties of a Viewport. + * @memberof google.geo.type + * @interface IViewport + * @property {google.type.ILatLng|null} [low] Viewport low + * @property {google.type.ILatLng|null} [high] Viewport high + */ + + /** + * Constructs a new Viewport. + * @memberof google.geo.type + * @classdesc Represents a Viewport. + * @implements IViewport + * @constructor + * @param {google.geo.type.IViewport=} [properties] Properties to set + */ + function Viewport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Viewport low. + * @member {google.type.ILatLng|null|undefined} low + * @memberof google.geo.type.Viewport + * @instance + */ + Viewport.prototype.low = null; + + /** + * Viewport high. + * @member {google.type.ILatLng|null|undefined} high + * @memberof google.geo.type.Viewport + * @instance + */ + Viewport.prototype.high = null; + + /** + * Creates a new Viewport instance using the specified properties. + * @function create + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport=} [properties] Properties to set + * @returns {google.geo.type.Viewport} Viewport instance + */ + Viewport.create = function create(properties) { + return new Viewport(properties); + }; + + /** + * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @function encode + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport} message Viewport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Viewport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.low != null && Object.hasOwnProperty.call(message, "low")) + $root.google.type.LatLng.encode(message.low, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.high != null && Object.hasOwnProperty.call(message, "high")) + $root.google.type.LatLng.encode(message.high, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport} message Viewport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Viewport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Viewport message from the specified reader or buffer. + * @function decode + * @memberof google.geo.type.Viewport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.geo.type.Viewport} Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Viewport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.geo.type.Viewport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.low = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.high = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Viewport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.geo.type.Viewport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.geo.type.Viewport} Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Viewport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Viewport message. + * @function verify + * @memberof google.geo.type.Viewport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Viewport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.low != null && message.hasOwnProperty("low")) { + var error = $root.google.type.LatLng.verify(message.low); + if (error) + return "low." + error; + } + if (message.high != null && message.hasOwnProperty("high")) { + var error = $root.google.type.LatLng.verify(message.high); + if (error) + return "high." + error; + } + return null; + }; + + /** + * Creates a Viewport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.geo.type.Viewport + * @static + * @param {Object.} object Plain object + * @returns {google.geo.type.Viewport} Viewport + */ + Viewport.fromObject = function fromObject(object) { + if (object instanceof $root.google.geo.type.Viewport) + return object; + var message = new $root.google.geo.type.Viewport(); + if (object.low != null) { + if (typeof object.low !== "object") + throw TypeError(".google.geo.type.Viewport.low: object expected"); + message.low = $root.google.type.LatLng.fromObject(object.low); + } + if (object.high != null) { + if (typeof object.high !== "object") + throw TypeError(".google.geo.type.Viewport.high: object expected"); + message.high = $root.google.type.LatLng.fromObject(object.high); + } + return message; + }; + + /** + * Creates a plain object from a Viewport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.Viewport} message Viewport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Viewport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.low = null; + object.high = null; + } + if (message.low != null && message.hasOwnProperty("low")) + object.low = $root.google.type.LatLng.toObject(message.low, options); + if (message.high != null && message.hasOwnProperty("high")) + object.high = $root.google.type.LatLng.toObject(message.high, options); + return object; + }; + + /** + * Converts this Viewport to JSON. + * @function toJSON + * @memberof google.geo.type.Viewport + * @instance + * @returns {Object.} JSON object + */ + Viewport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Viewport + * @function getTypeUrl + * @memberof google.geo.type.Viewport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Viewport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.geo.type.Viewport"; + }; + + return Viewport; + })(); + + return type; + })(); + + return geo; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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; + })(); + + type.LocalizedText = (function() { + + /** + * Properties of a LocalizedText. + * @memberof google.type + * @interface ILocalizedText + * @property {string|null} [text] LocalizedText text + * @property {string|null} [languageCode] LocalizedText languageCode + */ + + /** + * Constructs a new LocalizedText. + * @memberof google.type + * @classdesc Represents a LocalizedText. + * @implements ILocalizedText + * @constructor + * @param {google.type.ILocalizedText=} [properties] Properties to set + */ + function LocalizedText(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalizedText text. + * @member {string} text + * @memberof google.type.LocalizedText + * @instance + */ + LocalizedText.prototype.text = ""; + + /** + * LocalizedText languageCode. + * @member {string} languageCode + * @memberof google.type.LocalizedText + * @instance + */ + LocalizedText.prototype.languageCode = ""; + + /** + * Creates a new LocalizedText instance using the specified properties. + * @function create + * @memberof google.type.LocalizedText + * @static + * @param {google.type.ILocalizedText=} [properties] Properties to set + * @returns {google.type.LocalizedText} LocalizedText instance + */ + LocalizedText.create = function create(properties) { + return new LocalizedText(properties); + }; + + /** + * Encodes the specified LocalizedText message. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. + * @function encode + * @memberof google.type.LocalizedText + * @static + * @param {google.type.ILocalizedText} message LocalizedText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified LocalizedText message, length delimited. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LocalizedText + * @static + * @param {google.type.ILocalizedText} message LocalizedText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedText message from the specified reader or buffer. + * @function decode + * @memberof google.type.LocalizedText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LocalizedText} LocalizedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedText.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LocalizedText(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LocalizedText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LocalizedText} LocalizedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedText message. + * @function verify + * @memberof google.type.LocalizedText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedText.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a LocalizedText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LocalizedText + * @static + * @param {Object.} object Plain object + * @returns {google.type.LocalizedText} LocalizedText + */ + LocalizedText.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LocalizedText) + return object; + var message = new $root.google.type.LocalizedText(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a LocalizedText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LocalizedText + * @static + * @param {google.type.LocalizedText} message LocalizedText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this LocalizedText to JSON. + * @function toJSON + * @memberof google.type.LocalizedText + * @instance + * @returns {Object.} JSON object + */ + LocalizedText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalizedText + * @function getTypeUrl + * @memberof google.type.LocalizedText + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalizedText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LocalizedText"; + }; + + return LocalizedText; + })(); + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + return type; + })(); + + google.maps = (function() { + + /** + * Namespace maps. + * @memberof google + * @namespace + */ + var maps = {}; + + maps.routing = (function() { + + /** + * Namespace routing. + * @memberof google.maps + * @namespace + */ + var routing = {}; + + routing.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.maps.routing + * @namespace + */ + var v2 = {}; + + v2.FallbackInfo = (function() { + + /** + * Properties of a FallbackInfo. + * @memberof google.maps.routing.v2 + * @interface IFallbackInfo + * @property {google.maps.routing.v2.FallbackRoutingMode|null} [routingMode] FallbackInfo routingMode + * @property {google.maps.routing.v2.FallbackReason|null} [reason] FallbackInfo reason + */ + + /** + * Constructs a new FallbackInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a FallbackInfo. + * @implements IFallbackInfo + * @constructor + * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set + */ + function FallbackInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FallbackInfo routingMode. + * @member {google.maps.routing.v2.FallbackRoutingMode} routingMode + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + */ + FallbackInfo.prototype.routingMode = 0; + + /** + * FallbackInfo reason. + * @member {google.maps.routing.v2.FallbackReason} reason + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + */ + FallbackInfo.prototype.reason = 0; + + /** + * Creates a new FallbackInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo instance + */ + FallbackInfo.create = function create(properties) { + return new FallbackInfo(properties); + }; + + /** + * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingMode != null && Object.hasOwnProperty.call(message, "routingMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.routingMode); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + return writer; + }; + + /** + * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.FallbackInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.routingMode = reader.int32(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackInfo message. + * @function verify + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + switch (message.routingMode) { + default: + return "routingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + */ + FallbackInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.FallbackInfo) + return object; + var message = new $root.google.maps.routing.v2.FallbackInfo(); + switch (object.routingMode) { + default: + if (typeof object.routingMode === "number") { + message.routingMode = object.routingMode; + break; + } + break; + case "FALLBACK_ROUTING_MODE_UNSPECIFIED": + case 0: + message.routingMode = 0; + break; + case "FALLBACK_TRAFFIC_UNAWARE": + case 1: + message.routingMode = 1; + break; + case "FALLBACK_TRAFFIC_AWARE": + case 2: + message.routingMode = 2; + break; + } + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "FALLBACK_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "SERVER_ERROR": + case 1: + message.reason = 1; + break; + case "LATENCY_EXCEEDED": + case 2: + message.reason = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.FallbackInfo} message FallbackInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.routingMode = options.enums === String ? "FALLBACK_ROUTING_MODE_UNSPECIFIED" : 0; + object.reason = options.enums === String ? "FALLBACK_REASON_UNSPECIFIED" : 0; + } + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + object.routingMode = options.enums === String ? $root.google.maps.routing.v2.FallbackRoutingMode[message.routingMode] === undefined ? message.routingMode : $root.google.maps.routing.v2.FallbackRoutingMode[message.routingMode] : message.routingMode; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.maps.routing.v2.FallbackReason[message.reason] === undefined ? message.reason : $root.google.maps.routing.v2.FallbackReason[message.reason] : message.reason; + return object; + }; + + /** + * Converts this FallbackInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + * @returns {Object.} JSON object + */ + FallbackInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.FallbackInfo"; + }; + + return FallbackInfo; + })(); + + /** + * FallbackReason enum. + * @name google.maps.routing.v2.FallbackReason + * @enum {number} + * @property {number} FALLBACK_REASON_UNSPECIFIED=0 FALLBACK_REASON_UNSPECIFIED value + * @property {number} SERVER_ERROR=1 SERVER_ERROR value + * @property {number} LATENCY_EXCEEDED=2 LATENCY_EXCEEDED value + */ + v2.FallbackReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FALLBACK_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVER_ERROR"] = 1; + values[valuesById[2] = "LATENCY_EXCEEDED"] = 2; + return values; + })(); + + /** + * FallbackRoutingMode enum. + * @name google.maps.routing.v2.FallbackRoutingMode + * @enum {number} + * @property {number} FALLBACK_ROUTING_MODE_UNSPECIFIED=0 FALLBACK_ROUTING_MODE_UNSPECIFIED value + * @property {number} FALLBACK_TRAFFIC_UNAWARE=1 FALLBACK_TRAFFIC_UNAWARE value + * @property {number} FALLBACK_TRAFFIC_AWARE=2 FALLBACK_TRAFFIC_AWARE value + */ + v2.FallbackRoutingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FALLBACK_ROUTING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FALLBACK_TRAFFIC_UNAWARE"] = 1; + values[valuesById[2] = "FALLBACK_TRAFFIC_AWARE"] = 2; + return values; + })(); + + v2.GeocodingResults = (function() { + + /** + * Properties of a GeocodingResults. + * @memberof google.maps.routing.v2 + * @interface IGeocodingResults + * @property {google.maps.routing.v2.IGeocodedWaypoint|null} [origin] GeocodingResults origin + * @property {google.maps.routing.v2.IGeocodedWaypoint|null} [destination] GeocodingResults destination + * @property {Array.|null} [intermediates] GeocodingResults intermediates + */ + + /** + * Constructs a new GeocodingResults. + * @memberof google.maps.routing.v2 + * @classdesc Represents a GeocodingResults. + * @implements IGeocodingResults + * @constructor + * @param {google.maps.routing.v2.IGeocodingResults=} [properties] Properties to set + */ + function GeocodingResults(properties) { + this.intermediates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeocodingResults origin. + * @member {google.maps.routing.v2.IGeocodedWaypoint|null|undefined} origin + * @memberof google.maps.routing.v2.GeocodingResults + * @instance + */ + GeocodingResults.prototype.origin = null; + + /** + * GeocodingResults destination. + * @member {google.maps.routing.v2.IGeocodedWaypoint|null|undefined} destination + * @memberof google.maps.routing.v2.GeocodingResults + * @instance + */ + GeocodingResults.prototype.destination = null; + + /** + * GeocodingResults intermediates. + * @member {Array.} intermediates + * @memberof google.maps.routing.v2.GeocodingResults + * @instance + */ + GeocodingResults.prototype.intermediates = $util.emptyArray; + + /** + * Creates a new GeocodingResults instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {google.maps.routing.v2.IGeocodingResults=} [properties] Properties to set + * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults instance + */ + GeocodingResults.create = function create(properties) { + return new GeocodingResults(properties); + }; + + /** + * Encodes the specified GeocodingResults message. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {google.maps.routing.v2.IGeocodingResults} message GeocodingResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeocodingResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) + $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.destination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intermediates != null && message.intermediates.length) + for (var i = 0; i < message.intermediates.length; ++i) + $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.intermediates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeocodingResults message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {google.maps.routing.v2.IGeocodingResults} message GeocodingResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeocodingResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeocodingResults message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeocodingResults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.GeocodingResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.origin = $root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.destination = $root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.intermediates && message.intermediates.length)) + message.intermediates = []; + message.intermediates.push($root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeocodingResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeocodingResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeocodingResults message. + * @function verify + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeocodingResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) { + var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.origin); + if (error) + return "origin." + error; + } + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.intermediates != null && message.hasOwnProperty("intermediates")) { + if (!Array.isArray(message.intermediates)) + return "intermediates: array expected"; + for (var i = 0; i < message.intermediates.length; ++i) { + var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.intermediates[i]); + if (error) + return "intermediates." + error; + } + } + return null; + }; + + /** + * Creates a GeocodingResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults + */ + GeocodingResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.GeocodingResults) + return object; + var message = new $root.google.maps.routing.v2.GeocodingResults(); + if (object.origin != null) { + if (typeof object.origin !== "object") + throw TypeError(".google.maps.routing.v2.GeocodingResults.origin: object expected"); + message.origin = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.origin); + } + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.maps.routing.v2.GeocodingResults.destination: object expected"); + message.destination = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.destination); + } + if (object.intermediates) { + if (!Array.isArray(object.intermediates)) + throw TypeError(".google.maps.routing.v2.GeocodingResults.intermediates: array expected"); + message.intermediates = []; + for (var i = 0; i < object.intermediates.length; ++i) { + if (typeof object.intermediates[i] !== "object") + throw TypeError(".google.maps.routing.v2.GeocodingResults.intermediates: object expected"); + message.intermediates[i] = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.intermediates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeocodingResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {google.maps.routing.v2.GeocodingResults} message GeocodingResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeocodingResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intermediates = []; + if (options.defaults) { + object.origin = null; + object.destination = null; + } + if (message.origin != null && message.hasOwnProperty("origin")) + object.origin = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.origin, options); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.destination, options); + if (message.intermediates && message.intermediates.length) { + object.intermediates = []; + for (var j = 0; j < message.intermediates.length; ++j) + object.intermediates[j] = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.intermediates[j], options); + } + return object; + }; + + /** + * Converts this GeocodingResults to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.GeocodingResults + * @instance + * @returns {Object.} JSON object + */ + GeocodingResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeocodingResults + * @function getTypeUrl + * @memberof google.maps.routing.v2.GeocodingResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeocodingResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.GeocodingResults"; + }; + + return GeocodingResults; + })(); + + v2.GeocodedWaypoint = (function() { + + /** + * Properties of a GeocodedWaypoint. + * @memberof google.maps.routing.v2 + * @interface IGeocodedWaypoint + * @property {google.rpc.IStatus|null} [geocoderStatus] GeocodedWaypoint geocoderStatus + * @property {number|null} [intermediateWaypointRequestIndex] GeocodedWaypoint intermediateWaypointRequestIndex + * @property {Array.|null} [type] GeocodedWaypoint type + * @property {boolean|null} [partialMatch] GeocodedWaypoint partialMatch + * @property {string|null} [placeId] GeocodedWaypoint placeId + */ + + /** + * Constructs a new GeocodedWaypoint. + * @memberof google.maps.routing.v2 + * @classdesc Represents a GeocodedWaypoint. + * @implements IGeocodedWaypoint + * @constructor + * @param {google.maps.routing.v2.IGeocodedWaypoint=} [properties] Properties to set + */ + function GeocodedWaypoint(properties) { + this.type = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeocodedWaypoint geocoderStatus. + * @member {google.rpc.IStatus|null|undefined} geocoderStatus + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + */ + GeocodedWaypoint.prototype.geocoderStatus = null; + + /** + * GeocodedWaypoint intermediateWaypointRequestIndex. + * @member {number|null|undefined} intermediateWaypointRequestIndex + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + */ + GeocodedWaypoint.prototype.intermediateWaypointRequestIndex = null; + + /** + * GeocodedWaypoint type. + * @member {Array.} type + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + */ + GeocodedWaypoint.prototype.type = $util.emptyArray; + + /** + * GeocodedWaypoint partialMatch. + * @member {boolean} partialMatch + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + */ + GeocodedWaypoint.prototype.partialMatch = false; + + /** + * GeocodedWaypoint placeId. + * @member {string} placeId + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + */ + GeocodedWaypoint.prototype.placeId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GeocodedWaypoint.prototype, "_intermediateWaypointRequestIndex", { + get: $util.oneOfGetter($oneOfFields = ["intermediateWaypointRequestIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GeocodedWaypoint instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {google.maps.routing.v2.IGeocodedWaypoint=} [properties] Properties to set + * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint instance + */ + GeocodedWaypoint.create = function create(properties) { + return new GeocodedWaypoint(properties); + }; + + /** + * Encodes the specified GeocodedWaypoint message. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {google.maps.routing.v2.IGeocodedWaypoint} message GeocodedWaypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeocodedWaypoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.geocoderStatus != null && Object.hasOwnProperty.call(message, "geocoderStatus")) + $root.google.rpc.Status.encode(message.geocoderStatus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.intermediateWaypointRequestIndex != null && Object.hasOwnProperty.call(message, "intermediateWaypointRequestIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intermediateWaypointRequestIndex); + if (message.type != null && message.type.length) + for (var i = 0; i < message.type.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type[i]); + if (message.partialMatch != null && Object.hasOwnProperty.call(message, "partialMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.partialMatch); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.placeId); + return writer; + }; + + /** + * Encodes the specified GeocodedWaypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {google.maps.routing.v2.IGeocodedWaypoint} message GeocodedWaypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeocodedWaypoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeocodedWaypoint message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeocodedWaypoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.GeocodedWaypoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.geocoderStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.intermediateWaypointRequestIndex = reader.int32(); + break; + } + case 3: { + if (!(message.type && message.type.length)) + message.type = []; + message.type.push(reader.string()); + break; + } + case 4: { + message.partialMatch = reader.bool(); + break; + } + case 5: { + message.placeId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeocodedWaypoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeocodedWaypoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeocodedWaypoint message. + * @function verify + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeocodedWaypoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.geocoderStatus != null && message.hasOwnProperty("geocoderStatus")) { + var error = $root.google.rpc.Status.verify(message.geocoderStatus); + if (error) + return "geocoderStatus." + error; + } + if (message.intermediateWaypointRequestIndex != null && message.hasOwnProperty("intermediateWaypointRequestIndex")) { + properties._intermediateWaypointRequestIndex = 1; + if (!$util.isInteger(message.intermediateWaypointRequestIndex)) + return "intermediateWaypointRequestIndex: integer expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + if (!Array.isArray(message.type)) + return "type: array expected"; + for (var i = 0; i < message.type.length; ++i) + if (!$util.isString(message.type[i])) + return "type: string[] expected"; + } + if (message.partialMatch != null && message.hasOwnProperty("partialMatch")) + if (typeof message.partialMatch !== "boolean") + return "partialMatch: boolean expected"; + if (message.placeId != null && message.hasOwnProperty("placeId")) + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + return null; + }; + + /** + * Creates a GeocodedWaypoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint + */ + GeocodedWaypoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.GeocodedWaypoint) + return object; + var message = new $root.google.maps.routing.v2.GeocodedWaypoint(); + if (object.geocoderStatus != null) { + if (typeof object.geocoderStatus !== "object") + throw TypeError(".google.maps.routing.v2.GeocodedWaypoint.geocoderStatus: object expected"); + message.geocoderStatus = $root.google.rpc.Status.fromObject(object.geocoderStatus); + } + if (object.intermediateWaypointRequestIndex != null) + message.intermediateWaypointRequestIndex = object.intermediateWaypointRequestIndex | 0; + if (object.type) { + if (!Array.isArray(object.type)) + throw TypeError(".google.maps.routing.v2.GeocodedWaypoint.type: array expected"); + message.type = []; + for (var i = 0; i < object.type.length; ++i) + message.type[i] = String(object.type[i]); + } + if (object.partialMatch != null) + message.partialMatch = Boolean(object.partialMatch); + if (object.placeId != null) + message.placeId = String(object.placeId); + return message; + }; + + /** + * Creates a plain object from a GeocodedWaypoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {google.maps.routing.v2.GeocodedWaypoint} message GeocodedWaypoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeocodedWaypoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.type = []; + if (options.defaults) { + object.geocoderStatus = null; + object.partialMatch = false; + object.placeId = ""; + } + if (message.geocoderStatus != null && message.hasOwnProperty("geocoderStatus")) + object.geocoderStatus = $root.google.rpc.Status.toObject(message.geocoderStatus, options); + if (message.intermediateWaypointRequestIndex != null && message.hasOwnProperty("intermediateWaypointRequestIndex")) { + object.intermediateWaypointRequestIndex = message.intermediateWaypointRequestIndex; + if (options.oneofs) + object._intermediateWaypointRequestIndex = "intermediateWaypointRequestIndex"; + } + if (message.type && message.type.length) { + object.type = []; + for (var j = 0; j < message.type.length; ++j) + object.type[j] = message.type[j]; + } + if (message.partialMatch != null && message.hasOwnProperty("partialMatch")) + object.partialMatch = message.partialMatch; + if (message.placeId != null && message.hasOwnProperty("placeId")) + object.placeId = message.placeId; + return object; + }; + + /** + * Converts this GeocodedWaypoint to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @instance + * @returns {Object.} JSON object + */ + GeocodedWaypoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeocodedWaypoint + * @function getTypeUrl + * @memberof google.maps.routing.v2.GeocodedWaypoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeocodedWaypoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.GeocodedWaypoint"; + }; + + return GeocodedWaypoint; + })(); + + v2.LocalizedTime = (function() { + + /** + * Properties of a LocalizedTime. + * @memberof google.maps.routing.v2 + * @interface ILocalizedTime + * @property {google.type.ILocalizedText|null} [time] LocalizedTime time + * @property {string|null} [timeZone] LocalizedTime timeZone + */ + + /** + * Constructs a new LocalizedTime. + * @memberof google.maps.routing.v2 + * @classdesc Represents a LocalizedTime. + * @implements ILocalizedTime + * @constructor + * @param {google.maps.routing.v2.ILocalizedTime=} [properties] Properties to set + */ + function LocalizedTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalizedTime time. + * @member {google.type.ILocalizedText|null|undefined} time + * @memberof google.maps.routing.v2.LocalizedTime + * @instance + */ + LocalizedTime.prototype.time = null; + + /** + * LocalizedTime timeZone. + * @member {string} timeZone + * @memberof google.maps.routing.v2.LocalizedTime + * @instance + */ + LocalizedTime.prototype.timeZone = ""; + + /** + * Creates a new LocalizedTime instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {google.maps.routing.v2.ILocalizedTime=} [properties] Properties to set + * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime instance + */ + LocalizedTime.create = function create(properties) { + return new LocalizedTime(properties); + }; + + /** + * Encodes the specified LocalizedTime message. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {google.maps.routing.v2.ILocalizedTime} message LocalizedTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.type.LocalizedText.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified LocalizedTime message, length delimited. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {google.maps.routing.v2.ILocalizedTime} message LocalizedTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedTime message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedTime.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.LocalizedTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.time = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedTime message. + * @function verify + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.type.LocalizedText.verify(message.time); + if (error) + return "time." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a LocalizedTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime + */ + LocalizedTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.LocalizedTime) + return object; + var message = new $root.google.maps.routing.v2.LocalizedTime(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.maps.routing.v2.LocalizedTime.time: object expected"); + message.time = $root.google.type.LocalizedText.fromObject(object.time); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a LocalizedTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {google.maps.routing.v2.LocalizedTime} message LocalizedTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.time = null; + object.timeZone = ""; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.type.LocalizedText.toObject(message.time, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this LocalizedTime to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.LocalizedTime + * @instance + * @returns {Object.} JSON object + */ + LocalizedTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalizedTime + * @function getTypeUrl + * @memberof google.maps.routing.v2.LocalizedTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalizedTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.LocalizedTime"; + }; + + return LocalizedTime; + })(); + + v2.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.maps.routing.v2 + * @interface ILocation + * @property {google.type.ILatLng|null} [latLng] Location latLng + * @property {google.protobuf.IInt32Value|null} [heading] Location heading + */ + + /** + * Constructs a new Location. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.maps.routing.v2.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.routing.v2.Location + * @instance + */ + Location.prototype.latLng = null; + + /** + * Location heading. + * @member {google.protobuf.IInt32Value|null|undefined} heading + * @memberof google.maps.routing.v2.Location + * @instance + */ + Location.prototype.heading = null; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.ILocation=} [properties] Properties to set + * @returns {google.maps.routing.v2.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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")) + $root.google.protobuf.Int32Value.encode(message.heading, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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.routing.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heading = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + 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.routing.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.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.routing.v2.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.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")) { + var error = $root.google.protobuf.Int32Value.verify(message.heading); + if (error) + return "heading." + error; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Location + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Location) + return object; + var message = new $root.google.maps.routing.v2.Location(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.maps.routing.v2.Location.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.heading != null) { + if (typeof object.heading !== "object") + throw TypeError(".google.maps.routing.v2.Location.heading: object expected"); + message.heading = $root.google.protobuf.Int32Value.fromObject(object.heading); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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; + object.heading = 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 = $root.google.protobuf.Int32Value.toObject(message.heading, options); + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.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.routing.v2.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.routing.v2.Location"; + }; + + return Location; + })(); + + /** + * Maneuver enum. + * @name google.maps.routing.v2.Maneuver + * @enum {number} + * @property {number} MANEUVER_UNSPECIFIED=0 MANEUVER_UNSPECIFIED value + * @property {number} TURN_SLIGHT_LEFT=1 TURN_SLIGHT_LEFT value + * @property {number} TURN_SHARP_LEFT=2 TURN_SHARP_LEFT value + * @property {number} UTURN_LEFT=3 UTURN_LEFT value + * @property {number} TURN_LEFT=4 TURN_LEFT value + * @property {number} TURN_SLIGHT_RIGHT=5 TURN_SLIGHT_RIGHT value + * @property {number} TURN_SHARP_RIGHT=6 TURN_SHARP_RIGHT value + * @property {number} UTURN_RIGHT=7 UTURN_RIGHT value + * @property {number} TURN_RIGHT=8 TURN_RIGHT value + * @property {number} STRAIGHT=9 STRAIGHT value + * @property {number} RAMP_LEFT=10 RAMP_LEFT value + * @property {number} RAMP_RIGHT=11 RAMP_RIGHT value + * @property {number} MERGE=12 MERGE value + * @property {number} FORK_LEFT=13 FORK_LEFT value + * @property {number} FORK_RIGHT=14 FORK_RIGHT value + * @property {number} FERRY=15 FERRY value + * @property {number} FERRY_TRAIN=16 FERRY_TRAIN value + * @property {number} ROUNDABOUT_LEFT=17 ROUNDABOUT_LEFT value + * @property {number} ROUNDABOUT_RIGHT=18 ROUNDABOUT_RIGHT value + * @property {number} DEPART=19 DEPART value + * @property {number} NAME_CHANGE=20 NAME_CHANGE value + */ + v2.Maneuver = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANEUVER_UNSPECIFIED"] = 0; + values[valuesById[1] = "TURN_SLIGHT_LEFT"] = 1; + values[valuesById[2] = "TURN_SHARP_LEFT"] = 2; + values[valuesById[3] = "UTURN_LEFT"] = 3; + values[valuesById[4] = "TURN_LEFT"] = 4; + values[valuesById[5] = "TURN_SLIGHT_RIGHT"] = 5; + values[valuesById[6] = "TURN_SHARP_RIGHT"] = 6; + values[valuesById[7] = "UTURN_RIGHT"] = 7; + values[valuesById[8] = "TURN_RIGHT"] = 8; + values[valuesById[9] = "STRAIGHT"] = 9; + values[valuesById[10] = "RAMP_LEFT"] = 10; + values[valuesById[11] = "RAMP_RIGHT"] = 11; + values[valuesById[12] = "MERGE"] = 12; + values[valuesById[13] = "FORK_LEFT"] = 13; + values[valuesById[14] = "FORK_RIGHT"] = 14; + values[valuesById[15] = "FERRY"] = 15; + values[valuesById[16] = "FERRY_TRAIN"] = 16; + values[valuesById[17] = "ROUNDABOUT_LEFT"] = 17; + values[valuesById[18] = "ROUNDABOUT_RIGHT"] = 18; + values[valuesById[19] = "DEPART"] = 19; + values[valuesById[20] = "NAME_CHANGE"] = 20; + return values; + })(); + + v2.NavigationInstruction = (function() { + + /** + * Properties of a NavigationInstruction. + * @memberof google.maps.routing.v2 + * @interface INavigationInstruction + * @property {google.maps.routing.v2.Maneuver|null} [maneuver] NavigationInstruction maneuver + * @property {string|null} [instructions] NavigationInstruction instructions + */ + + /** + * Constructs a new NavigationInstruction. + * @memberof google.maps.routing.v2 + * @classdesc Represents a NavigationInstruction. + * @implements INavigationInstruction + * @constructor + * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set + */ + function NavigationInstruction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NavigationInstruction maneuver. + * @member {google.maps.routing.v2.Maneuver} maneuver + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + */ + NavigationInstruction.prototype.maneuver = 0; + + /** + * NavigationInstruction instructions. + * @member {string} instructions + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + */ + NavigationInstruction.prototype.instructions = ""; + + /** + * Creates a new NavigationInstruction instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction instance + */ + NavigationInstruction.create = function create(properties) { + return new NavigationInstruction(properties); + }; + + /** + * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NavigationInstruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maneuver != null && Object.hasOwnProperty.call(message, "maneuver")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maneuver); + if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructions); + return writer; + }; + + /** + * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NavigationInstruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NavigationInstruction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.NavigationInstruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maneuver = reader.int32(); + break; + } + case 2: { + message.instructions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NavigationInstruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NavigationInstruction message. + * @function verify + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NavigationInstruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maneuver != null && message.hasOwnProperty("maneuver")) + switch (message.maneuver) { + default: + return "maneuver: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + break; + } + if (message.instructions != null && message.hasOwnProperty("instructions")) + if (!$util.isString(message.instructions)) + return "instructions: string expected"; + return null; + }; + + /** + * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + */ + NavigationInstruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.NavigationInstruction) + return object; + var message = new $root.google.maps.routing.v2.NavigationInstruction(); + switch (object.maneuver) { + default: + if (typeof object.maneuver === "number") { + message.maneuver = object.maneuver; + break; + } + break; + case "MANEUVER_UNSPECIFIED": + case 0: + message.maneuver = 0; + break; + case "TURN_SLIGHT_LEFT": + case 1: + message.maneuver = 1; + break; + case "TURN_SHARP_LEFT": + case 2: + message.maneuver = 2; + break; + case "UTURN_LEFT": + case 3: + message.maneuver = 3; + break; + case "TURN_LEFT": + case 4: + message.maneuver = 4; + break; + case "TURN_SLIGHT_RIGHT": + case 5: + message.maneuver = 5; + break; + case "TURN_SHARP_RIGHT": + case 6: + message.maneuver = 6; + break; + case "UTURN_RIGHT": + case 7: + message.maneuver = 7; + break; + case "TURN_RIGHT": + case 8: + message.maneuver = 8; + break; + case "STRAIGHT": + case 9: + message.maneuver = 9; + break; + case "RAMP_LEFT": + case 10: + message.maneuver = 10; + break; + case "RAMP_RIGHT": + case 11: + message.maneuver = 11; + break; + case "MERGE": + case 12: + message.maneuver = 12; + break; + case "FORK_LEFT": + case 13: + message.maneuver = 13; + break; + case "FORK_RIGHT": + case 14: + message.maneuver = 14; + break; + case "FERRY": + case 15: + message.maneuver = 15; + break; + case "FERRY_TRAIN": + case 16: + message.maneuver = 16; + break; + case "ROUNDABOUT_LEFT": + case 17: + message.maneuver = 17; + break; + case "ROUNDABOUT_RIGHT": + case 18: + message.maneuver = 18; + break; + case "DEPART": + case 19: + message.maneuver = 19; + break; + case "NAME_CHANGE": + case 20: + message.maneuver = 20; + break; + } + if (object.instructions != null) + message.instructions = String(object.instructions); + return message; + }; + + /** + * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.NavigationInstruction} message NavigationInstruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NavigationInstruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maneuver = options.enums === String ? "MANEUVER_UNSPECIFIED" : 0; + object.instructions = ""; + } + if (message.maneuver != null && message.hasOwnProperty("maneuver")) + object.maneuver = options.enums === String ? $root.google.maps.routing.v2.Maneuver[message.maneuver] === undefined ? message.maneuver : $root.google.maps.routing.v2.Maneuver[message.maneuver] : message.maneuver; + if (message.instructions != null && message.hasOwnProperty("instructions")) + object.instructions = message.instructions; + return object; + }; + + /** + * Converts this NavigationInstruction to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + * @returns {Object.} JSON object + */ + NavigationInstruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NavigationInstruction + * @function getTypeUrl + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NavigationInstruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.NavigationInstruction"; + }; + + return NavigationInstruction; + })(); + + v2.Polyline = (function() { + + /** + * Properties of a Polyline. + * @memberof google.maps.routing.v2 + * @interface IPolyline + * @property {string|null} [encodedPolyline] Polyline encodedPolyline + * @property {google.protobuf.IStruct|null} [geoJsonLinestring] Polyline geoJsonLinestring + */ + + /** + * Constructs a new Polyline. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Polyline. + * @implements IPolyline + * @constructor + * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set + */ + function Polyline(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Polyline encodedPolyline. + * @member {string|null|undefined} encodedPolyline + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Polyline.prototype.encodedPolyline = null; + + /** + * Polyline geoJsonLinestring. + * @member {google.protobuf.IStruct|null|undefined} geoJsonLinestring + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Polyline.prototype.geoJsonLinestring = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Polyline polylineType. + * @member {"encodedPolyline"|"geoJsonLinestring"|undefined} polylineType + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Object.defineProperty(Polyline.prototype, "polylineType", { + get: $util.oneOfGetter($oneOfFields = ["encodedPolyline", "geoJsonLinestring"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Polyline instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set + * @returns {google.maps.routing.v2.Polyline} Polyline instance + */ + Polyline.create = function create(properties) { + return new Polyline(properties); + }; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encodedPolyline != null && Object.hasOwnProperty.call(message, "encodedPolyline")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encodedPolyline); + if (message.geoJsonLinestring != null && Object.hasOwnProperty.call(message, "geoJsonLinestring")) + $root.google.protobuf.Struct.encode(message.geoJsonLinestring, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Polyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encodedPolyline = reader.string(); + break; + } + case 2: { + message.geoJsonLinestring = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polyline message. + * @function verify + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polyline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + properties.polylineType = 1; + if (!$util.isString(message.encodedPolyline)) + return "encodedPolyline: string expected"; + } + if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { + if (properties.polylineType === 1) + return "polylineType: multiple values"; + properties.polylineType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.geoJsonLinestring); + if (error) + return "geoJsonLinestring." + error; + } + } + return null; + }; + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Polyline} Polyline + */ + Polyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Polyline) + return object; + var message = new $root.google.maps.routing.v2.Polyline(); + if (object.encodedPolyline != null) + message.encodedPolyline = String(object.encodedPolyline); + if (object.geoJsonLinestring != null) { + if (typeof object.geoJsonLinestring !== "object") + throw TypeError(".google.maps.routing.v2.Polyline.geoJsonLinestring: object expected"); + message.geoJsonLinestring = $root.google.protobuf.Struct.fromObject(object.geoJsonLinestring); + } + return message; + }; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.Polyline} message Polyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + object.encodedPolyline = message.encodedPolyline; + if (options.oneofs) + object.polylineType = "encodedPolyline"; + } + if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { + object.geoJsonLinestring = $root.google.protobuf.Struct.toObject(message.geoJsonLinestring, options); + if (options.oneofs) + object.polylineType = "geoJsonLinestring"; + } + return object; + }; + + /** + * Converts this Polyline to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Polyline + * @instance + * @returns {Object.} JSON object + */ + Polyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Polyline + * @function getTypeUrl + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Polyline"; + }; + + return Polyline; + })(); + + /** + * PolylineQuality enum. + * @name google.maps.routing.v2.PolylineQuality + * @enum {number} + * @property {number} POLYLINE_QUALITY_UNSPECIFIED=0 POLYLINE_QUALITY_UNSPECIFIED value + * @property {number} HIGH_QUALITY=1 HIGH_QUALITY value + * @property {number} OVERVIEW=2 OVERVIEW value + */ + v2.PolylineQuality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLYLINE_QUALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH_QUALITY"] = 1; + values[valuesById[2] = "OVERVIEW"] = 2; + return values; + })(); + + /** + * PolylineEncoding enum. + * @name google.maps.routing.v2.PolylineEncoding + * @enum {number} + * @property {number} POLYLINE_ENCODING_UNSPECIFIED=0 POLYLINE_ENCODING_UNSPECIFIED value + * @property {number} ENCODED_POLYLINE=1 ENCODED_POLYLINE value + * @property {number} GEO_JSON_LINESTRING=2 GEO_JSON_LINESTRING value + */ + v2.PolylineEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLYLINE_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCODED_POLYLINE"] = 1; + values[valuesById[2] = "GEO_JSON_LINESTRING"] = 2; + return values; + })(); + + v2.PolylineDetails = (function() { + + /** + * Properties of a PolylineDetails. + * @memberof google.maps.routing.v2 + * @interface IPolylineDetails + * @property {Array.|null} [flyoverInfo] PolylineDetails flyoverInfo + * @property {Array.|null} [narrowRoadInfo] PolylineDetails narrowRoadInfo + */ + + /** + * Constructs a new PolylineDetails. + * @memberof google.maps.routing.v2 + * @classdesc Represents a PolylineDetails. + * @implements IPolylineDetails + * @constructor + * @param {google.maps.routing.v2.IPolylineDetails=} [properties] Properties to set + */ + function PolylineDetails(properties) { + this.flyoverInfo = []; + this.narrowRoadInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolylineDetails flyoverInfo. + * @member {Array.} flyoverInfo + * @memberof google.maps.routing.v2.PolylineDetails + * @instance + */ + PolylineDetails.prototype.flyoverInfo = $util.emptyArray; + + /** + * PolylineDetails narrowRoadInfo. + * @member {Array.} narrowRoadInfo + * @memberof google.maps.routing.v2.PolylineDetails + * @instance + */ + PolylineDetails.prototype.narrowRoadInfo = $util.emptyArray; + + /** + * Creates a new PolylineDetails instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {google.maps.routing.v2.IPolylineDetails=} [properties] Properties to set + * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails instance + */ + PolylineDetails.create = function create(properties) { + return new PolylineDetails(properties); + }; + + /** + * Encodes the specified PolylineDetails message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {google.maps.routing.v2.IPolylineDetails} message PolylineDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylineDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flyoverInfo != null && message.flyoverInfo.length) + for (var i = 0; i < message.flyoverInfo.length; ++i) + $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.encode(message.flyoverInfo[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.narrowRoadInfo != null && message.narrowRoadInfo.length) + for (var i = 0; i < message.narrowRoadInfo.length; ++i) + $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.encode(message.narrowRoadInfo[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolylineDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {google.maps.routing.v2.IPolylineDetails} message PolylineDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylineDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolylineDetails message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylineDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 12: { + if (!(message.flyoverInfo && message.flyoverInfo.length)) + message.flyoverInfo = []; + message.flyoverInfo.push($root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.narrowRoadInfo && message.narrowRoadInfo.length)) + message.narrowRoadInfo = []; + message.narrowRoadInfo.push($root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolylineDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylineDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolylineDetails message. + * @function verify + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolylineDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.flyoverInfo != null && message.hasOwnProperty("flyoverInfo")) { + if (!Array.isArray(message.flyoverInfo)) + return "flyoverInfo: array expected"; + for (var i = 0; i < message.flyoverInfo.length; ++i) { + var error = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify(message.flyoverInfo[i]); + if (error) + return "flyoverInfo." + error; + } + } + if (message.narrowRoadInfo != null && message.hasOwnProperty("narrowRoadInfo")) { + if (!Array.isArray(message.narrowRoadInfo)) + return "narrowRoadInfo: array expected"; + for (var i = 0; i < message.narrowRoadInfo.length; ++i) { + var error = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify(message.narrowRoadInfo[i]); + if (error) + return "narrowRoadInfo." + error; + } + } + return null; + }; + + /** + * Creates a PolylineDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails + */ + PolylineDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.PolylineDetails) + return object; + var message = new $root.google.maps.routing.v2.PolylineDetails(); + if (object.flyoverInfo) { + if (!Array.isArray(object.flyoverInfo)) + throw TypeError(".google.maps.routing.v2.PolylineDetails.flyoverInfo: array expected"); + message.flyoverInfo = []; + for (var i = 0; i < object.flyoverInfo.length; ++i) { + if (typeof object.flyoverInfo[i] !== "object") + throw TypeError(".google.maps.routing.v2.PolylineDetails.flyoverInfo: object expected"); + message.flyoverInfo[i] = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.fromObject(object.flyoverInfo[i]); + } + } + if (object.narrowRoadInfo) { + if (!Array.isArray(object.narrowRoadInfo)) + throw TypeError(".google.maps.routing.v2.PolylineDetails.narrowRoadInfo: array expected"); + message.narrowRoadInfo = []; + for (var i = 0; i < object.narrowRoadInfo.length; ++i) { + if (typeof object.narrowRoadInfo[i] !== "object") + throw TypeError(".google.maps.routing.v2.PolylineDetails.narrowRoadInfo: object expected"); + message.narrowRoadInfo[i] = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.fromObject(object.narrowRoadInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolylineDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {google.maps.routing.v2.PolylineDetails} message PolylineDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolylineDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.flyoverInfo = []; + object.narrowRoadInfo = []; + } + if (message.flyoverInfo && message.flyoverInfo.length) { + object.flyoverInfo = []; + for (var j = 0; j < message.flyoverInfo.length; ++j) + object.flyoverInfo[j] = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.toObject(message.flyoverInfo[j], options); + } + if (message.narrowRoadInfo && message.narrowRoadInfo.length) { + object.narrowRoadInfo = []; + for (var j = 0; j < message.narrowRoadInfo.length; ++j) + object.narrowRoadInfo[j] = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.toObject(message.narrowRoadInfo[j], options); + } + return object; + }; + + /** + * Converts this PolylineDetails to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.PolylineDetails + * @instance + * @returns {Object.} JSON object + */ + PolylineDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolylineDetails + * @function getTypeUrl + * @memberof google.maps.routing.v2.PolylineDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolylineDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails"; + }; + + PolylineDetails.PolylinePointIndex = (function() { + + /** + * Properties of a PolylinePointIndex. + * @memberof google.maps.routing.v2.PolylineDetails + * @interface IPolylinePointIndex + * @property {number|null} [startIndex] PolylinePointIndex startIndex + * @property {number|null} [endIndex] PolylinePointIndex endIndex + */ + + /** + * Constructs a new PolylinePointIndex. + * @memberof google.maps.routing.v2.PolylineDetails + * @classdesc Represents a PolylinePointIndex. + * @implements IPolylinePointIndex + * @constructor + * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex=} [properties] Properties to set + */ + function PolylinePointIndex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolylinePointIndex startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @instance + */ + PolylinePointIndex.prototype.startIndex = null; + + /** + * PolylinePointIndex endIndex. + * @member {number|null|undefined} endIndex + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @instance + */ + PolylinePointIndex.prototype.endIndex = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PolylinePointIndex.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PolylinePointIndex.prototype, "_endIndex", { + get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PolylinePointIndex instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex=} [properties] Properties to set + * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex instance + */ + PolylinePointIndex.create = function create(properties) { + return new PolylinePointIndex(properties); + }; + + /** + * Encodes the specified PolylinePointIndex message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex} message PolylinePointIndex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylinePointIndex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); + return writer; + }; + + /** + * Encodes the specified PolylinePointIndex message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex} message PolylinePointIndex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolylinePointIndex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolylinePointIndex message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylinePointIndex.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolylinePointIndex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolylinePointIndex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolylinePointIndex message. + * @function verify + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolylinePointIndex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + properties._startIndex = 1; + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + properties._endIndex = 1; + if (!$util.isInteger(message.endIndex)) + return "endIndex: integer expected"; + } + return null; + }; + + /** + * Creates a PolylinePointIndex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex + */ + PolylinePointIndex.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex) + return object; + var message = new $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex(); + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.endIndex != null) + message.endIndex = object.endIndex | 0; + return message; + }; + + /** + * Creates a plain object from a PolylinePointIndex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} message PolylinePointIndex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolylinePointIndex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + object.startIndex = message.startIndex; + if (options.oneofs) + object._startIndex = "startIndex"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + object.endIndex = message.endIndex; + if (options.oneofs) + object._endIndex = "endIndex"; + } + return object; + }; + + /** + * Converts this PolylinePointIndex to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @instance + * @returns {Object.} JSON object + */ + PolylinePointIndex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolylinePointIndex + * @function getTypeUrl + * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolylinePointIndex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.PolylinePointIndex"; + }; + + return PolylinePointIndex; + })(); + + /** + * RoadFeatureState enum. + * @name google.maps.routing.v2.PolylineDetails.RoadFeatureState + * @enum {number} + * @property {number} ROAD_FEATURE_STATE_UNSPECIFIED=0 ROAD_FEATURE_STATE_UNSPECIFIED value + * @property {number} EXISTS=1 EXISTS value + * @property {number} DOES_NOT_EXIST=2 DOES_NOT_EXIST value + */ + PolylineDetails.RoadFeatureState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROAD_FEATURE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXISTS"] = 1; + values[valuesById[2] = "DOES_NOT_EXIST"] = 2; + return values; + })(); + + PolylineDetails.FlyoverInfo = (function() { + + /** + * Properties of a FlyoverInfo. + * @memberof google.maps.routing.v2.PolylineDetails + * @interface IFlyoverInfo + * @property {google.maps.routing.v2.PolylineDetails.RoadFeatureState|null} [flyoverPresence] FlyoverInfo flyoverPresence + * @property {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null} [polylinePointIndex] FlyoverInfo polylinePointIndex + */ + + /** + * Constructs a new FlyoverInfo. + * @memberof google.maps.routing.v2.PolylineDetails + * @classdesc Represents a FlyoverInfo. + * @implements IFlyoverInfo + * @constructor + * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo=} [properties] Properties to set + */ + function FlyoverInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlyoverInfo flyoverPresence. + * @member {google.maps.routing.v2.PolylineDetails.RoadFeatureState} flyoverPresence + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @instance + */ + FlyoverInfo.prototype.flyoverPresence = 0; + + /** + * FlyoverInfo polylinePointIndex. + * @member {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null|undefined} polylinePointIndex + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @instance + */ + FlyoverInfo.prototype.polylinePointIndex = null; + + /** + * Creates a new FlyoverInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo instance + */ + FlyoverInfo.create = function create(properties) { + return new FlyoverInfo(properties); + }; + + /** + * Encodes the specified FlyoverInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo} message FlyoverInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlyoverInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flyoverPresence != null && Object.hasOwnProperty.call(message, "flyoverPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.flyoverPresence); + if (message.polylinePointIndex != null && Object.hasOwnProperty.call(message, "polylinePointIndex")) + $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.encode(message.polylinePointIndex, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FlyoverInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo} message FlyoverInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlyoverInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlyoverInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlyoverInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.flyoverPresence = reader.int32(); + break; + } + case 2: { + message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FlyoverInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlyoverInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlyoverInfo message. + * @function verify + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlyoverInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.flyoverPresence != null && message.hasOwnProperty("flyoverPresence")) + switch (message.flyoverPresence) { + default: + return "flyoverPresence: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) { + var error = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify(message.polylinePointIndex); + if (error) + return "polylinePointIndex." + error; + } + return null; + }; + + /** + * Creates a FlyoverInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo + */ + FlyoverInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo) + return object; + var message = new $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo(); + switch (object.flyoverPresence) { + default: + if (typeof object.flyoverPresence === "number") { + message.flyoverPresence = object.flyoverPresence; + break; + } + break; + case "ROAD_FEATURE_STATE_UNSPECIFIED": + case 0: + message.flyoverPresence = 0; + break; + case "EXISTS": + case 1: + message.flyoverPresence = 1; + break; + case "DOES_NOT_EXIST": + case 2: + message.flyoverPresence = 2; + break; + } + if (object.polylinePointIndex != null) { + if (typeof object.polylinePointIndex !== "object") + throw TypeError(".google.maps.routing.v2.PolylineDetails.FlyoverInfo.polylinePointIndex: object expected"); + message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.fromObject(object.polylinePointIndex); + } + return message; + }; + + /** + * Creates a plain object from a FlyoverInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.FlyoverInfo} message FlyoverInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlyoverInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.flyoverPresence = options.enums === String ? "ROAD_FEATURE_STATE_UNSPECIFIED" : 0; + object.polylinePointIndex = null; + } + if (message.flyoverPresence != null && message.hasOwnProperty("flyoverPresence")) + object.flyoverPresence = options.enums === String ? $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.flyoverPresence] === undefined ? message.flyoverPresence : $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.flyoverPresence] : message.flyoverPresence; + if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) + object.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.toObject(message.polylinePointIndex, options); + return object; + }; + + /** + * Converts this FlyoverInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @instance + * @returns {Object.} JSON object + */ + FlyoverInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlyoverInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlyoverInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.FlyoverInfo"; + }; + + return FlyoverInfo; + })(); + + PolylineDetails.NarrowRoadInfo = (function() { + + /** + * Properties of a NarrowRoadInfo. + * @memberof google.maps.routing.v2.PolylineDetails + * @interface INarrowRoadInfo + * @property {google.maps.routing.v2.PolylineDetails.RoadFeatureState|null} [narrowRoadPresence] NarrowRoadInfo narrowRoadPresence + * @property {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null} [polylinePointIndex] NarrowRoadInfo polylinePointIndex + */ + + /** + * Constructs a new NarrowRoadInfo. + * @memberof google.maps.routing.v2.PolylineDetails + * @classdesc Represents a NarrowRoadInfo. + * @implements INarrowRoadInfo + * @constructor + * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo=} [properties] Properties to set + */ + function NarrowRoadInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NarrowRoadInfo narrowRoadPresence. + * @member {google.maps.routing.v2.PolylineDetails.RoadFeatureState} narrowRoadPresence + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @instance + */ + NarrowRoadInfo.prototype.narrowRoadPresence = 0; + + /** + * NarrowRoadInfo polylinePointIndex. + * @member {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null|undefined} polylinePointIndex + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @instance + */ + NarrowRoadInfo.prototype.polylinePointIndex = null; + + /** + * Creates a new NarrowRoadInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo instance + */ + NarrowRoadInfo.create = function create(properties) { + return new NarrowRoadInfo(properties); + }; + + /** + * Encodes the specified NarrowRoadInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo} message NarrowRoadInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NarrowRoadInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.narrowRoadPresence != null && Object.hasOwnProperty.call(message, "narrowRoadPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.narrowRoadPresence); + if (message.polylinePointIndex != null && Object.hasOwnProperty.call(message, "polylinePointIndex")) + $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.encode(message.polylinePointIndex, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NarrowRoadInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo} message NarrowRoadInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NarrowRoadInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NarrowRoadInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NarrowRoadInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.narrowRoadPresence = reader.int32(); + break; + } + case 2: { + message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NarrowRoadInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NarrowRoadInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NarrowRoadInfo message. + * @function verify + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NarrowRoadInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.narrowRoadPresence != null && message.hasOwnProperty("narrowRoadPresence")) + switch (message.narrowRoadPresence) { + default: + return "narrowRoadPresence: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) { + var error = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify(message.polylinePointIndex); + if (error) + return "polylinePointIndex." + error; + } + return null; + }; + + /** + * Creates a NarrowRoadInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo + */ + NarrowRoadInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo) + return object; + var message = new $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo(); + switch (object.narrowRoadPresence) { + default: + if (typeof object.narrowRoadPresence === "number") { + message.narrowRoadPresence = object.narrowRoadPresence; + break; + } + break; + case "ROAD_FEATURE_STATE_UNSPECIFIED": + case 0: + message.narrowRoadPresence = 0; + break; + case "EXISTS": + case 1: + message.narrowRoadPresence = 1; + break; + case "DOES_NOT_EXIST": + case 2: + message.narrowRoadPresence = 2; + break; + } + if (object.polylinePointIndex != null) { + if (typeof object.polylinePointIndex !== "object") + throw TypeError(".google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.polylinePointIndex: object expected"); + message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.fromObject(object.polylinePointIndex); + } + return message; + }; + + /** + * Creates a plain object from a NarrowRoadInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} message NarrowRoadInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NarrowRoadInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.narrowRoadPresence = options.enums === String ? "ROAD_FEATURE_STATE_UNSPECIFIED" : 0; + object.polylinePointIndex = null; + } + if (message.narrowRoadPresence != null && message.hasOwnProperty("narrowRoadPresence")) + object.narrowRoadPresence = options.enums === String ? $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.narrowRoadPresence] === undefined ? message.narrowRoadPresence : $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.narrowRoadPresence] : message.narrowRoadPresence; + if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) + object.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.toObject(message.polylinePointIndex, options); + return object; + }; + + /** + * Converts this NarrowRoadInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @instance + * @returns {Object.} JSON object + */ + NarrowRoadInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NarrowRoadInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NarrowRoadInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.NarrowRoadInfo"; + }; + + return NarrowRoadInfo; + })(); + + return PolylineDetails; + })(); + + v2.Route = (function() { + + /** + * Properties of a Route. + * @memberof google.maps.routing.v2 + * @interface IRoute + * @property {Array.|null} [routeLabels] Route routeLabels + * @property {Array.|null} [legs] Route legs + * @property {number|null} [distanceMeters] Route distanceMeters + * @property {google.protobuf.IDuration|null} [duration] Route duration + * @property {google.protobuf.IDuration|null} [staticDuration] Route staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] Route polyline + * @property {string|null} [description] Route description + * @property {Array.|null} [warnings] Route warnings + * @property {google.geo.type.IViewport|null} [viewport] Route viewport + * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] Route travelAdvisory + * @property {Array.|null} [optimizedIntermediateWaypointIndex] Route optimizedIntermediateWaypointIndex + * @property {google.maps.routing.v2.Route.IRouteLocalizedValues|null} [localizedValues] Route localizedValues + * @property {string|null} [routeToken] Route routeToken + * @property {google.maps.routing.v2.IPolylineDetails|null} [polylineDetails] Route polylineDetails + */ + + /** + * Constructs a new Route. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Route. + * @implements IRoute + * @constructor + * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set + */ + function Route(properties) { + this.routeLabels = []; + this.legs = []; + this.warnings = []; + this.optimizedIntermediateWaypointIndex = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Route routeLabels. + * @member {Array.} routeLabels + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.routeLabels = $util.emptyArray; + + /** + * Route legs. + * @member {Array.} legs + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.legs = $util.emptyArray; + + /** + * Route distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.distanceMeters = 0; + + /** + * Route duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.duration = null; + + /** + * Route staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.staticDuration = null; + + /** + * Route polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.polyline = null; + + /** + * Route description. + * @member {string} description + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.description = ""; + + /** + * Route warnings. + * @member {Array.} warnings + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.warnings = $util.emptyArray; + + /** + * Route viewport. + * @member {google.geo.type.IViewport|null|undefined} viewport + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.viewport = null; + + /** + * Route travelAdvisory. + * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.travelAdvisory = null; + + /** + * Route optimizedIntermediateWaypointIndex. + * @member {Array.} optimizedIntermediateWaypointIndex + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.optimizedIntermediateWaypointIndex = $util.emptyArray; + + /** + * Route localizedValues. + * @member {google.maps.routing.v2.Route.IRouteLocalizedValues|null|undefined} localizedValues + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.localizedValues = null; + + /** + * Route routeToken. + * @member {string} routeToken + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.routeToken = ""; + + /** + * Route polylineDetails. + * @member {google.maps.routing.v2.IPolylineDetails|null|undefined} polylineDetails + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.polylineDetails = null; + + /** + * Creates a new Route instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set + * @returns {google.maps.routing.v2.Route} Route instance + */ + Route.create = function create(properties) { + return new Route(properties); + }; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Route.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.legs != null && message.legs.length) + for (var i = 0; i < message.legs.length; ++i) + $root.google.maps.routing.v2.RouteLeg.encode(message.legs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.distanceMeters); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.warnings[i]); + if (message.viewport != null && Object.hasOwnProperty.call(message, "viewport")) + $root.google.geo.type.Viewport.encode(message.viewport, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.optimizedIntermediateWaypointIndex != null && message.optimizedIntermediateWaypointIndex.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.optimizedIntermediateWaypointIndex.length; ++i) + writer.int32(message.optimizedIntermediateWaypointIndex[i]); + writer.ldelim(); + } + if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) + $root.google.maps.routing.v2.Route.RouteLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.routeToken != null && Object.hasOwnProperty.call(message, "routeToken")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.routeToken); + if (message.routeLabels != null && message.routeLabels.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (var i = 0; i < message.routeLabels.length; ++i) + writer.int32(message.routeLabels[i]); + writer.ldelim(); + } + if (message.polylineDetails != null && Object.hasOwnProperty.call(message, "polylineDetails")) + $root.google.maps.routing.v2.PolylineDetails.encode(message.polylineDetails, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Route.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Route message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Route} Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Route.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Route(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 13: { + if (!(message.routeLabels && message.routeLabels.length)) + message.routeLabels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.routeLabels.push(reader.int32()); + } else + message.routeLabels.push(reader.int32()); + break; + } + case 1: { + if (!(message.legs && message.legs.length)) + message.legs = []; + message.legs.push($root.google.maps.routing.v2.RouteLeg.decode(reader, reader.uint32())); + break; + } + case 2: { + message.distanceMeters = reader.int32(); + break; + } + case 3: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + case 8: { + message.viewport = $root.google.geo.type.Viewport.decode(reader, reader.uint32()); + break; + } + case 9: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.optimizedIntermediateWaypointIndex && message.optimizedIntermediateWaypointIndex.length)) + message.optimizedIntermediateWaypointIndex = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.optimizedIntermediateWaypointIndex.push(reader.int32()); + } else + message.optimizedIntermediateWaypointIndex.push(reader.int32()); + break; + } + case 11: { + message.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.routeToken = reader.string(); + break; + } + case 14: { + message.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Route message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Route} Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Route.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Route message. + * @function verify + * @memberof google.maps.routing.v2.Route + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Route.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routeLabels != null && message.hasOwnProperty("routeLabels")) { + if (!Array.isArray(message.routeLabels)) + return "routeLabels: array expected"; + for (var i = 0; i < message.routeLabels.length; ++i) + switch (message.routeLabels[i]) { + default: + return "routeLabels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.legs != null && message.hasOwnProperty("legs")) { + if (!Array.isArray(message.legs)) + return "legs: array expected"; + for (var i = 0; i < message.legs.length; ++i) { + var error = $root.google.maps.routing.v2.RouteLeg.verify(message.legs[i]); + if (error) + return "legs." + error; + } + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + if (message.viewport != null && message.hasOwnProperty("viewport")) { + var error = $root.google.geo.type.Viewport.verify(message.viewport); + if (error) + return "viewport." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + if (message.optimizedIntermediateWaypointIndex != null && message.hasOwnProperty("optimizedIntermediateWaypointIndex")) { + if (!Array.isArray(message.optimizedIntermediateWaypointIndex)) + return "optimizedIntermediateWaypointIndex: array expected"; + for (var i = 0; i < message.optimizedIntermediateWaypointIndex.length; ++i) + if (!$util.isInteger(message.optimizedIntermediateWaypointIndex[i])) + return "optimizedIntermediateWaypointIndex: integer[] expected"; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { + var error = $root.google.maps.routing.v2.Route.RouteLocalizedValues.verify(message.localizedValues); + if (error) + return "localizedValues." + error; + } + if (message.routeToken != null && message.hasOwnProperty("routeToken")) + if (!$util.isString(message.routeToken)) + return "routeToken: string expected"; + if (message.polylineDetails != null && message.hasOwnProperty("polylineDetails")) { + var error = $root.google.maps.routing.v2.PolylineDetails.verify(message.polylineDetails); + if (error) + return "polylineDetails." + error; + } + return null; + }; + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Route + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Route} Route + */ + Route.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Route) + return object; + var message = new $root.google.maps.routing.v2.Route(); + if (object.routeLabels) { + if (!Array.isArray(object.routeLabels)) + throw TypeError(".google.maps.routing.v2.Route.routeLabels: array expected"); + message.routeLabels = []; + for (var i = 0; i < object.routeLabels.length; ++i) + switch (object.routeLabels[i]) { + default: + if (typeof object.routeLabels[i] === "number") { + message.routeLabels[i] = object.routeLabels[i]; + break; + } + case "ROUTE_LABEL_UNSPECIFIED": + case 0: + message.routeLabels[i] = 0; + break; + case "DEFAULT_ROUTE": + case 1: + message.routeLabels[i] = 1; + break; + case "DEFAULT_ROUTE_ALTERNATE": + case 2: + message.routeLabels[i] = 2; + break; + case "FUEL_EFFICIENT": + case 3: + message.routeLabels[i] = 3; + break; + case "SHORTER_DISTANCE": + case 4: + message.routeLabels[i] = 4; + break; + } + } + if (object.legs) { + if (!Array.isArray(object.legs)) + throw TypeError(".google.maps.routing.v2.Route.legs: array expected"); + message.legs = []; + for (var i = 0; i < object.legs.length; ++i) { + if (typeof object.legs[i] !== "object") + throw TypeError(".google.maps.routing.v2.Route.legs: object expected"); + message.legs[i] = $root.google.maps.routing.v2.RouteLeg.fromObject(object.legs[i]); + } + } + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.Route.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.Route.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.Route.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.description != null) + message.description = String(object.description); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.maps.routing.v2.Route.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + if (object.viewport != null) { + if (typeof object.viewport !== "object") + throw TypeError(".google.maps.routing.v2.Route.viewport: object expected"); + message.viewport = $root.google.geo.type.Viewport.fromObject(object.viewport); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.Route.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); + } + if (object.optimizedIntermediateWaypointIndex) { + if (!Array.isArray(object.optimizedIntermediateWaypointIndex)) + throw TypeError(".google.maps.routing.v2.Route.optimizedIntermediateWaypointIndex: array expected"); + message.optimizedIntermediateWaypointIndex = []; + for (var i = 0; i < object.optimizedIntermediateWaypointIndex.length; ++i) + message.optimizedIntermediateWaypointIndex[i] = object.optimizedIntermediateWaypointIndex[i] | 0; + } + if (object.localizedValues != null) { + if (typeof object.localizedValues !== "object") + throw TypeError(".google.maps.routing.v2.Route.localizedValues: object expected"); + message.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.fromObject(object.localizedValues); + } + if (object.routeToken != null) + message.routeToken = String(object.routeToken); + if (object.polylineDetails != null) { + if (typeof object.polylineDetails !== "object") + throw TypeError(".google.maps.routing.v2.Route.polylineDetails: object expected"); + message.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.fromObject(object.polylineDetails); + } + return message; + }; + + /** + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.Route} message Route + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Route.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.legs = []; + object.warnings = []; + object.optimizedIntermediateWaypointIndex = []; + object.routeLabels = []; + } + if (options.defaults) { + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.polyline = null; + object.description = ""; + object.viewport = null; + object.travelAdvisory = null; + object.localizedValues = null; + object.routeToken = ""; + object.polylineDetails = null; + } + if (message.legs && message.legs.length) { + object.legs = []; + for (var j = 0; j < message.legs.length; ++j) + object.legs[j] = $root.google.maps.routing.v2.RouteLeg.toObject(message.legs[j], options); + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + if (message.viewport != null && message.hasOwnProperty("viewport")) + object.viewport = $root.google.geo.type.Viewport.toObject(message.viewport, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); + if (message.optimizedIntermediateWaypointIndex && message.optimizedIntermediateWaypointIndex.length) { + object.optimizedIntermediateWaypointIndex = []; + for (var j = 0; j < message.optimizedIntermediateWaypointIndex.length; ++j) + object.optimizedIntermediateWaypointIndex[j] = message.optimizedIntermediateWaypointIndex[j]; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) + object.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.toObject(message.localizedValues, options); + if (message.routeToken != null && message.hasOwnProperty("routeToken")) + object.routeToken = message.routeToken; + if (message.routeLabels && message.routeLabels.length) { + object.routeLabels = []; + for (var j = 0; j < message.routeLabels.length; ++j) + object.routeLabels[j] = options.enums === String ? $root.google.maps.routing.v2.RouteLabel[message.routeLabels[j]] === undefined ? message.routeLabels[j] : $root.google.maps.routing.v2.RouteLabel[message.routeLabels[j]] : message.routeLabels[j]; + } + if (message.polylineDetails != null && message.hasOwnProperty("polylineDetails")) + object.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.toObject(message.polylineDetails, options); + return object; + }; + + /** + * Converts this Route to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Route + * @instance + * @returns {Object.} JSON object + */ + Route.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Route + * @function getTypeUrl + * @memberof google.maps.routing.v2.Route + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Route.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Route"; + }; + + Route.RouteLocalizedValues = (function() { + + /** + * Properties of a RouteLocalizedValues. + * @memberof google.maps.routing.v2.Route + * @interface IRouteLocalizedValues + * @property {google.type.ILocalizedText|null} [distance] RouteLocalizedValues distance + * @property {google.type.ILocalizedText|null} [duration] RouteLocalizedValues duration + * @property {google.type.ILocalizedText|null} [staticDuration] RouteLocalizedValues staticDuration + * @property {google.type.ILocalizedText|null} [transitFare] RouteLocalizedValues transitFare + */ + + /** + * Constructs a new RouteLocalizedValues. + * @memberof google.maps.routing.v2.Route + * @classdesc Represents a RouteLocalizedValues. + * @implements IRouteLocalizedValues + * @constructor + * @param {google.maps.routing.v2.Route.IRouteLocalizedValues=} [properties] Properties to set + */ + function RouteLocalizedValues(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLocalizedValues distance. + * @member {google.type.ILocalizedText|null|undefined} distance + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @instance + */ + RouteLocalizedValues.prototype.distance = null; + + /** + * RouteLocalizedValues duration. + * @member {google.type.ILocalizedText|null|undefined} duration + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @instance + */ + RouteLocalizedValues.prototype.duration = null; + + /** + * RouteLocalizedValues staticDuration. + * @member {google.type.ILocalizedText|null|undefined} staticDuration + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @instance + */ + RouteLocalizedValues.prototype.staticDuration = null; + + /** + * RouteLocalizedValues transitFare. + * @member {google.type.ILocalizedText|null|undefined} transitFare + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @instance + */ + RouteLocalizedValues.prototype.transitFare = null; + + /** + * Creates a new RouteLocalizedValues instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {google.maps.routing.v2.Route.IRouteLocalizedValues=} [properties] Properties to set + * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues instance + */ + RouteLocalizedValues.create = function create(properties) { + return new RouteLocalizedValues(properties); + }; + + /** + * Encodes the specified RouteLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {google.maps.routing.v2.Route.IRouteLocalizedValues} message RouteLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLocalizedValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) + $root.google.type.LocalizedText.encode(message.transitFare, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {google.maps.routing.v2.Route.IRouteLocalizedValues} message RouteLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLocalizedValues message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLocalizedValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Route.RouteLocalizedValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 2: { + message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 4: { + message.transitFare = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLocalizedValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLocalizedValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLocalizedValues message. + * @function verify + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLocalizedValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distance != null && message.hasOwnProperty("distance")) { + var error = $root.google.type.LocalizedText.verify(message.distance); + if (error) + return "distance." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.type.LocalizedText.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.type.LocalizedText.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.transitFare != null && message.hasOwnProperty("transitFare")) { + var error = $root.google.type.LocalizedText.verify(message.transitFare); + if (error) + return "transitFare." + error; + } + return null; + }; + + /** + * Creates a RouteLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues + */ + RouteLocalizedValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Route.RouteLocalizedValues) + return object; + var message = new $root.google.maps.routing.v2.Route.RouteLocalizedValues(); + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.distance: object expected"); + message.distance = $root.google.type.LocalizedText.fromObject(object.distance); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.duration: object expected"); + message.duration = $root.google.type.LocalizedText.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.staticDuration: object expected"); + message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); + } + if (object.transitFare != null) { + if (typeof object.transitFare !== "object") + throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.transitFare: object expected"); + message.transitFare = $root.google.type.LocalizedText.fromObject(object.transitFare); + } + return message; + }; + + /** + * Creates a plain object from a RouteLocalizedValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {google.maps.routing.v2.Route.RouteLocalizedValues} message RouteLocalizedValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLocalizedValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distance = null; + object.duration = null; + object.staticDuration = null; + object.transitFare = null; + } + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); + if (message.transitFare != null && message.hasOwnProperty("transitFare")) + object.transitFare = $root.google.type.LocalizedText.toObject(message.transitFare, options); + return object; + }; + + /** + * Converts this RouteLocalizedValues to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @instance + * @returns {Object.} JSON object + */ + RouteLocalizedValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLocalizedValues + * @function getTypeUrl + * @memberof google.maps.routing.v2.Route.RouteLocalizedValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Route.RouteLocalizedValues"; + }; + + return RouteLocalizedValues; + })(); + + return Route; + })(); + + v2.RouteTravelAdvisory = (function() { + + /** + * Properties of a RouteTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteTravelAdvisory + * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteTravelAdvisory tollInfo + * @property {Array.|null} [speedReadingIntervals] RouteTravelAdvisory speedReadingIntervals + * @property {number|Long|null} [fuelConsumptionMicroliters] RouteTravelAdvisory fuelConsumptionMicroliters + * @property {boolean|null} [routeRestrictionsPartiallyIgnored] RouteTravelAdvisory routeRestrictionsPartiallyIgnored + * @property {google.type.IMoney|null} [transitFare] RouteTravelAdvisory transitFare + */ + + /** + * Constructs a new RouteTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteTravelAdvisory. + * @implements IRouteTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set + */ + function RouteTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteTravelAdvisory tollInfo. + * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.tollInfo = null; + + /** + * RouteTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * RouteTravelAdvisory fuelConsumptionMicroliters. + * @member {number|Long} fuelConsumptionMicroliters + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.fuelConsumptionMicroliters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RouteTravelAdvisory routeRestrictionsPartiallyIgnored. + * @member {boolean} routeRestrictionsPartiallyIgnored + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.routeRestrictionsPartiallyIgnored = false; + + /** + * RouteTravelAdvisory transitFare. + * @member {google.type.IMoney|null|undefined} transitFare + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.transitFare = null; + + /** + * Creates a new RouteTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory instance + */ + RouteTravelAdvisory.create = function create(properties) { + return new RouteTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) + $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fuelConsumptionMicroliters != null && Object.hasOwnProperty.call(message, "fuelConsumptionMicroliters")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.fuelConsumptionMicroliters); + if (message.routeRestrictionsPartiallyIgnored != null && Object.hasOwnProperty.call(message, "routeRestrictionsPartiallyIgnored")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.routeRestrictionsPartiallyIgnored); + if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) + $root.google.type.Money.encode(message.transitFare, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteTravelAdvisory.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + case 5: { + message.fuelConsumptionMicroliters = reader.int64(); + break; + } + case 6: { + message.routeRestrictionsPartiallyIgnored = reader.bool(); + break; + } + case 7: { + message.transitFare = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { + var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); + if (error) + return "tollInfo." + error; + } + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + if (message.fuelConsumptionMicroliters != null && message.hasOwnProperty("fuelConsumptionMicroliters")) + if (!$util.isInteger(message.fuelConsumptionMicroliters) && !(message.fuelConsumptionMicroliters && $util.isInteger(message.fuelConsumptionMicroliters.low) && $util.isInteger(message.fuelConsumptionMicroliters.high))) + return "fuelConsumptionMicroliters: integer|Long expected"; + if (message.routeRestrictionsPartiallyIgnored != null && message.hasOwnProperty("routeRestrictionsPartiallyIgnored")) + if (typeof message.routeRestrictionsPartiallyIgnored !== "boolean") + return "routeRestrictionsPartiallyIgnored: boolean expected"; + if (message.transitFare != null && message.hasOwnProperty("transitFare")) { + var error = $root.google.type.Money.verify(message.transitFare); + if (error) + return "transitFare." + error; + } + return null; + }; + + /** + * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + */ + RouteTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); + if (object.tollInfo != null) { + if (typeof object.tollInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.tollInfo: object expected"); + message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); + } + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + if (object.fuelConsumptionMicroliters != null) + if ($util.Long) + (message.fuelConsumptionMicroliters = $util.Long.fromValue(object.fuelConsumptionMicroliters)).unsigned = false; + else if (typeof object.fuelConsumptionMicroliters === "string") + message.fuelConsumptionMicroliters = parseInt(object.fuelConsumptionMicroliters, 10); + else if (typeof object.fuelConsumptionMicroliters === "number") + message.fuelConsumptionMicroliters = object.fuelConsumptionMicroliters; + else if (typeof object.fuelConsumptionMicroliters === "object") + message.fuelConsumptionMicroliters = new $util.LongBits(object.fuelConsumptionMicroliters.low >>> 0, object.fuelConsumptionMicroliters.high >>> 0).toNumber(); + if (object.routeRestrictionsPartiallyIgnored != null) + message.routeRestrictionsPartiallyIgnored = Boolean(object.routeRestrictionsPartiallyIgnored); + if (object.transitFare != null) { + if (typeof object.transitFare !== "object") + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.transitFare: object expected"); + message.transitFare = $root.google.type.Money.fromObject(object.transitFare); + } + return message; + }; + + /** + * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteTravelAdvisory} message RouteTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (options.defaults) { + object.tollInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.fuelConsumptionMicroliters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fuelConsumptionMicroliters = options.longs === String ? "0" : 0; + object.routeRestrictionsPartiallyIgnored = false; + object.transitFare = null; + } + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) + object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + if (message.fuelConsumptionMicroliters != null && message.hasOwnProperty("fuelConsumptionMicroliters")) + if (typeof message.fuelConsumptionMicroliters === "number") + object.fuelConsumptionMicroliters = options.longs === String ? String(message.fuelConsumptionMicroliters) : message.fuelConsumptionMicroliters; + else + object.fuelConsumptionMicroliters = options.longs === String ? $util.Long.prototype.toString.call(message.fuelConsumptionMicroliters) : options.longs === Number ? new $util.LongBits(message.fuelConsumptionMicroliters.low >>> 0, message.fuelConsumptionMicroliters.high >>> 0).toNumber() : message.fuelConsumptionMicroliters; + if (message.routeRestrictionsPartiallyIgnored != null && message.hasOwnProperty("routeRestrictionsPartiallyIgnored")) + object.routeRestrictionsPartiallyIgnored = message.routeRestrictionsPartiallyIgnored; + if (message.transitFare != null && message.hasOwnProperty("transitFare")) + object.transitFare = $root.google.type.Money.toObject(message.transitFare, options); + return object; + }; + + /** + * Converts this RouteTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteTravelAdvisory"; + }; + + return RouteTravelAdvisory; + })(); + + v2.RouteLegTravelAdvisory = (function() { + + /** + * Properties of a RouteLegTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteLegTravelAdvisory + * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteLegTravelAdvisory tollInfo + * @property {Array.|null} [speedReadingIntervals] RouteLegTravelAdvisory speedReadingIntervals + */ + + /** + * Constructs a new RouteLegTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegTravelAdvisory. + * @implements IRouteLegTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set + */ + function RouteLegTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegTravelAdvisory tollInfo. + * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + */ + RouteLegTravelAdvisory.prototype.tollInfo = null; + + /** + * RouteLegTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + */ + RouteLegTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * Creates a new RouteLegTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory instance + */ + RouteLegTravelAdvisory.create = function create(properties) { + return new RouteLegTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) + $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegTravelAdvisory.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { + var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); + if (error) + return "tollInfo." + error; + } + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + return null; + }; + + /** + * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + */ + RouteLegTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); + if (object.tollInfo != null) { + if (typeof object.tollInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.tollInfo: object expected"); + message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); + } + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteLegTravelAdvisory} message RouteLegTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (options.defaults) + object.tollInfo = null; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) + object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + return object; + }; + + /** + * Converts this RouteLegTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteLegTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegTravelAdvisory"; + }; + + return RouteLegTravelAdvisory; + })(); + + v2.RouteLegStepTravelAdvisory = (function() { + + /** + * Properties of a RouteLegStepTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteLegStepTravelAdvisory + * @property {Array.|null} [speedReadingIntervals] RouteLegStepTravelAdvisory speedReadingIntervals + */ + + /** + * Constructs a new RouteLegStepTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegStepTravelAdvisory. + * @implements IRouteLegStepTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set + */ + function RouteLegStepTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegStepTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @instance + */ + RouteLegStepTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory instance + */ + RouteLegStepTravelAdvisory.create = function create(properties) { + return new RouteLegStepTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTravelAdvisory.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStepTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStepTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + return null; + }; + + /** + * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + */ + RouteLegStepTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStepTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStepTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + return object; + }; + + /** + * Converts this RouteLegStepTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteLegStepTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStepTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStepTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTravelAdvisory"; + }; + + return RouteLegStepTravelAdvisory; + })(); + + v2.RouteLeg = (function() { + + /** + * Properties of a RouteLeg. + * @memberof google.maps.routing.v2 + * @interface IRouteLeg + * @property {number|null} [distanceMeters] RouteLeg distanceMeters + * @property {google.protobuf.IDuration|null} [duration] RouteLeg duration + * @property {google.protobuf.IDuration|null} [staticDuration] RouteLeg staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLeg polyline + * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLeg startLocation + * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLeg endLocation + * @property {Array.|null} [steps] RouteLeg steps + * @property {google.maps.routing.v2.IRouteLegTravelAdvisory|null} [travelAdvisory] RouteLeg travelAdvisory + * @property {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null} [localizedValues] RouteLeg localizedValues + * @property {google.maps.routing.v2.RouteLeg.IStepsOverview|null} [stepsOverview] RouteLeg stepsOverview + */ + + /** + * Constructs a new RouteLeg. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLeg. + * @implements IRouteLeg + * @constructor + * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set + */ + function RouteLeg(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLeg distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.distanceMeters = 0; + + /** + * RouteLeg duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.duration = null; + + /** + * RouteLeg staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.staticDuration = null; + + /** + * RouteLeg polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.polyline = null; + + /** + * RouteLeg startLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.startLocation = null; + + /** + * RouteLeg endLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.endLocation = null; + + /** + * RouteLeg steps. + * @member {Array.} steps + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.steps = $util.emptyArray; + + /** + * RouteLeg travelAdvisory. + * @member {google.maps.routing.v2.IRouteLegTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.travelAdvisory = null; + + /** + * RouteLeg localizedValues. + * @member {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null|undefined} localizedValues + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.localizedValues = null; + + /** + * RouteLeg stepsOverview. + * @member {google.maps.routing.v2.RouteLeg.IStepsOverview|null|undefined} stepsOverview + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.stepsOverview = null; + + /** + * Creates a new RouteLeg instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg instance + */ + RouteLeg.create = function create(properties) { + return new RouteLeg(properties); + }; + + /** + * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLeg.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); + 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(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) + $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) + $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.maps.routing.v2.RouteLegStep.encode(message.steps[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteLegTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) + $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stepsOverview != null && Object.hasOwnProperty.call(message, "stepsOverview")) + $root.google.maps.routing.v2.RouteLeg.StepsOverview.encode(message.stepsOverview, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLeg.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLeg message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLeg.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distanceMeters = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 5: { + message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.maps.routing.v2.RouteLegStep.decode(reader, reader.uint32())); + break; + } + case 8: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.decode(reader, reader.uint32()); + break; + } + case 9: { + message.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.decode(reader, reader.uint32()); + break; + } + case 10: { + message.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLeg message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLeg.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLeg message. + * @function verify + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLeg.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.startLocation != null && message.hasOwnProperty("startLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); + if (error) + return "startLocation." + error; + } + if (message.endLocation != null && message.hasOwnProperty("endLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); + if (error) + return "endLocation." + error; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.maps.routing.v2.RouteLegStep.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteLegTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { + var error = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify(message.localizedValues); + if (error) + return "localizedValues." + error; + } + if (message.stepsOverview != null && message.hasOwnProperty("stepsOverview")) { + var error = $root.google.maps.routing.v2.RouteLeg.StepsOverview.verify(message.stepsOverview); + if (error) + return "stepsOverview." + error; + } + return null; + }; + + /** + * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + */ + RouteLeg.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLeg) + return object; + var message = new $root.google.maps.routing.v2.RouteLeg(); + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.startLocation != null) { + if (typeof object.startLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.startLocation: object expected"); + message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); + } + if (object.endLocation != null) { + if (typeof object.endLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.endLocation: object expected"); + message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.maps.routing.v2.RouteLeg.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.steps: object expected"); + message.steps[i] = $root.google.maps.routing.v2.RouteLegStep.fromObject(object.steps[i]); + } + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.fromObject(object.travelAdvisory); + } + if (object.localizedValues != null) { + if (typeof object.localizedValues !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.localizedValues: object expected"); + message.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.fromObject(object.localizedValues); + } + if (object.stepsOverview != null) { + if (typeof object.stepsOverview !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.stepsOverview: object expected"); + message.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.fromObject(object.stepsOverview); + } + return message; + }; + + /** + * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.RouteLeg} message RouteLeg + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLeg.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) { + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.polyline = null; + object.startLocation = null; + object.endLocation = null; + object.travelAdvisory = null; + object.localizedValues = null; + object.stepsOverview = null; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.startLocation != null && message.hasOwnProperty("startLocation")) + object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); + if (message.endLocation != null && message.hasOwnProperty("endLocation")) + object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.maps.routing.v2.RouteLegStep.toObject(message.steps[j], options); + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.toObject(message.travelAdvisory, options); + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) + object.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.toObject(message.localizedValues, options); + if (message.stepsOverview != null && message.hasOwnProperty("stepsOverview")) + object.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.toObject(message.stepsOverview, options); + return object; + }; + + /** + * Converts this RouteLeg to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLeg + * @instance + * @returns {Object.} JSON object + */ + RouteLeg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLeg + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLeg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg"; + }; + + RouteLeg.RouteLegLocalizedValues = (function() { + + /** + * Properties of a RouteLegLocalizedValues. + * @memberof google.maps.routing.v2.RouteLeg + * @interface IRouteLegLocalizedValues + * @property {google.type.ILocalizedText|null} [distance] RouteLegLocalizedValues distance + * @property {google.type.ILocalizedText|null} [duration] RouteLegLocalizedValues duration + * @property {google.type.ILocalizedText|null} [staticDuration] RouteLegLocalizedValues staticDuration + */ + + /** + * Constructs a new RouteLegLocalizedValues. + * @memberof google.maps.routing.v2.RouteLeg + * @classdesc Represents a RouteLegLocalizedValues. + * @implements IRouteLegLocalizedValues + * @constructor + * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues=} [properties] Properties to set + */ + function RouteLegLocalizedValues(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegLocalizedValues distance. + * @member {google.type.ILocalizedText|null|undefined} distance + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @instance + */ + RouteLegLocalizedValues.prototype.distance = null; + + /** + * RouteLegLocalizedValues duration. + * @member {google.type.ILocalizedText|null|undefined} duration + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @instance + */ + RouteLegLocalizedValues.prototype.duration = null; + + /** + * RouteLegLocalizedValues staticDuration. + * @member {google.type.ILocalizedText|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @instance + */ + RouteLegLocalizedValues.prototype.staticDuration = null; + + /** + * Creates a new RouteLegLocalizedValues instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues instance + */ + RouteLegLocalizedValues.create = function create(properties) { + return new RouteLegLocalizedValues(properties); + }; + + /** + * Encodes the specified RouteLegLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues} message RouteLegLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegLocalizedValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues} message RouteLegLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegLocalizedValues message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegLocalizedValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 2: { + message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegLocalizedValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegLocalizedValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegLocalizedValues message. + * @function verify + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegLocalizedValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distance != null && message.hasOwnProperty("distance")) { + var error = $root.google.type.LocalizedText.verify(message.distance); + if (error) + return "distance." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.type.LocalizedText.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.type.LocalizedText.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + return null; + }; + + /** + * Creates a RouteLegLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues + */ + RouteLegLocalizedValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues) + return object; + var message = new $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues(); + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.distance: object expected"); + message.distance = $root.google.type.LocalizedText.fromObject(object.distance); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.duration: object expected"); + message.duration = $root.google.type.LocalizedText.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.staticDuration: object expected"); + message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); + } + return message; + }; + + /** + * Creates a plain object from a RouteLegLocalizedValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} message RouteLegLocalizedValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegLocalizedValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distance = null; + object.duration = null; + object.staticDuration = null; + } + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); + return object; + }; + + /** + * Converts this RouteLegLocalizedValues to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @instance + * @returns {Object.} JSON object + */ + RouteLegLocalizedValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegLocalizedValues + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues"; + }; + + return RouteLegLocalizedValues; + })(); + + RouteLeg.StepsOverview = (function() { + + /** + * Properties of a StepsOverview. + * @memberof google.maps.routing.v2.RouteLeg + * @interface IStepsOverview + * @property {Array.|null} [multiModalSegments] StepsOverview multiModalSegments + */ + + /** + * Constructs a new StepsOverview. + * @memberof google.maps.routing.v2.RouteLeg + * @classdesc Represents a StepsOverview. + * @implements IStepsOverview + * @constructor + * @param {google.maps.routing.v2.RouteLeg.IStepsOverview=} [properties] Properties to set + */ + function StepsOverview(properties) { + this.multiModalSegments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StepsOverview multiModalSegments. + * @member {Array.} multiModalSegments + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @instance + */ + StepsOverview.prototype.multiModalSegments = $util.emptyArray; + + /** + * Creates a new StepsOverview instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {google.maps.routing.v2.RouteLeg.IStepsOverview=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview instance + */ + StepsOverview.create = function create(properties) { + return new StepsOverview(properties); + }; + + /** + * Encodes the specified StepsOverview message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {google.maps.routing.v2.RouteLeg.IStepsOverview} message StepsOverview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StepsOverview.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.multiModalSegments != null && message.multiModalSegments.length) + for (var i = 0; i < message.multiModalSegments.length; ++i) + $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.encode(message.multiModalSegments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StepsOverview message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {google.maps.routing.v2.RouteLeg.IStepsOverview} message StepsOverview message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StepsOverview.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StepsOverview message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StepsOverview.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.multiModalSegments && message.multiModalSegments.length)) + message.multiModalSegments = []; + message.multiModalSegments.push($root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StepsOverview message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StepsOverview.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StepsOverview message. + * @function verify + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StepsOverview.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.multiModalSegments != null && message.hasOwnProperty("multiModalSegments")) { + if (!Array.isArray(message.multiModalSegments)) + return "multiModalSegments: array expected"; + for (var i = 0; i < message.multiModalSegments.length; ++i) { + var error = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify(message.multiModalSegments[i]); + if (error) + return "multiModalSegments." + error; + } + } + return null; + }; + + /** + * Creates a StepsOverview message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview + */ + StepsOverview.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLeg.StepsOverview) + return object; + var message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview(); + if (object.multiModalSegments) { + if (!Array.isArray(object.multiModalSegments)) + throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.multiModalSegments: array expected"); + message.multiModalSegments = []; + for (var i = 0; i < object.multiModalSegments.length; ++i) { + if (typeof object.multiModalSegments[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.multiModalSegments: object expected"); + message.multiModalSegments[i] = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.fromObject(object.multiModalSegments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StepsOverview message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {google.maps.routing.v2.RouteLeg.StepsOverview} message StepsOverview + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StepsOverview.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.multiModalSegments = []; + if (message.multiModalSegments && message.multiModalSegments.length) { + object.multiModalSegments = []; + for (var j = 0; j < message.multiModalSegments.length; ++j) + object.multiModalSegments[j] = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.toObject(message.multiModalSegments[j], options); + } + return object; + }; + + /** + * Converts this StepsOverview to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @instance + * @returns {Object.} JSON object + */ + StepsOverview.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StepsOverview + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StepsOverview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.StepsOverview"; + }; + + StepsOverview.MultiModalSegment = (function() { + + /** + * Properties of a MultiModalSegment. + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @interface IMultiModalSegment + * @property {number|null} [stepStartIndex] MultiModalSegment stepStartIndex + * @property {number|null} [stepEndIndex] MultiModalSegment stepEndIndex + * @property {google.maps.routing.v2.INavigationInstruction|null} [navigationInstruction] MultiModalSegment navigationInstruction + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] MultiModalSegment travelMode + */ + + /** + * Constructs a new MultiModalSegment. + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview + * @classdesc Represents a MultiModalSegment. + * @implements IMultiModalSegment + * @constructor + * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment=} [properties] Properties to set + */ + function MultiModalSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiModalSegment stepStartIndex. + * @member {number|null|undefined} stepStartIndex + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @instance + */ + MultiModalSegment.prototype.stepStartIndex = null; + + /** + * MultiModalSegment stepEndIndex. + * @member {number|null|undefined} stepEndIndex + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @instance + */ + MultiModalSegment.prototype.stepEndIndex = null; + + /** + * MultiModalSegment navigationInstruction. + * @member {google.maps.routing.v2.INavigationInstruction|null|undefined} navigationInstruction + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @instance + */ + MultiModalSegment.prototype.navigationInstruction = null; + + /** + * MultiModalSegment travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @instance + */ + MultiModalSegment.prototype.travelMode = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MultiModalSegment.prototype, "_stepStartIndex", { + get: $util.oneOfGetter($oneOfFields = ["stepStartIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MultiModalSegment.prototype, "_stepEndIndex", { + get: $util.oneOfGetter($oneOfFields = ["stepEndIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MultiModalSegment instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment instance + */ + MultiModalSegment.create = function create(properties) { + return new MultiModalSegment(properties); + }; + + /** + * Encodes the specified MultiModalSegment message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment} message MultiModalSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiModalSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stepStartIndex != null && Object.hasOwnProperty.call(message, "stepStartIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stepStartIndex); + if (message.stepEndIndex != null && Object.hasOwnProperty.call(message, "stepEndIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stepEndIndex); + if (message.navigationInstruction != null && Object.hasOwnProperty.call(message, "navigationInstruction")) + $root.google.maps.routing.v2.NavigationInstruction.encode(message.navigationInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.travelMode); + return writer; + }; + + /** + * Encodes the specified MultiModalSegment message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment} message MultiModalSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiModalSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiModalSegment message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiModalSegment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stepStartIndex = reader.int32(); + break; + } + case 2: { + message.stepEndIndex = reader.int32(); + break; + } + case 3: { + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.decode(reader, reader.uint32()); + break; + } + case 4: { + message.travelMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiModalSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiModalSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiModalSegment message. + * @function verify + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiModalSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stepStartIndex != null && message.hasOwnProperty("stepStartIndex")) { + properties._stepStartIndex = 1; + if (!$util.isInteger(message.stepStartIndex)) + return "stepStartIndex: integer expected"; + } + if (message.stepEndIndex != null && message.hasOwnProperty("stepEndIndex")) { + properties._stepEndIndex = 1; + if (!$util.isInteger(message.stepEndIndex)) + return "stepEndIndex: integer expected"; + } + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) { + var error = $root.google.maps.routing.v2.NavigationInstruction.verify(message.navigationInstruction); + if (error) + return "navigationInstruction." + error; + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + break; + } + return null; + }; + + /** + * Creates a MultiModalSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment + */ + MultiModalSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment) + return object; + var message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment(); + if (object.stepStartIndex != null) + message.stepStartIndex = object.stepStartIndex | 0; + if (object.stepEndIndex != null) + message.stepEndIndex = object.stepEndIndex | 0; + if (object.navigationInstruction != null) { + if (typeof object.navigationInstruction !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.navigationInstruction: object expected"); + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.fromObject(object.navigationInstruction); + } + 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 "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + case "TRANSIT": + case 7: + message.travelMode = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a MultiModalSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} message MultiModalSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiModalSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.navigationInstruction = null; + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + } + if (message.stepStartIndex != null && message.hasOwnProperty("stepStartIndex")) { + object.stepStartIndex = message.stepStartIndex; + if (options.oneofs) + object._stepStartIndex = "stepStartIndex"; + } + if (message.stepEndIndex != null && message.hasOwnProperty("stepEndIndex")) { + object.stepEndIndex = message.stepEndIndex; + if (options.oneofs) + object._stepEndIndex = "stepEndIndex"; + } + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) + object.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.toObject(message.navigationInstruction, options); + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + return object; + }; + + /** + * Converts this MultiModalSegment to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @instance + * @returns {Object.} JSON object + */ + MultiModalSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiModalSegment + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiModalSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment"; + }; + + return MultiModalSegment; + })(); + + return StepsOverview; + })(); + + return RouteLeg; + })(); + + v2.RouteLegStep = (function() { + + /** + * Properties of a RouteLegStep. + * @memberof google.maps.routing.v2 + * @interface IRouteLegStep + * @property {number|null} [distanceMeters] RouteLegStep distanceMeters + * @property {google.protobuf.IDuration|null} [staticDuration] RouteLegStep staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLegStep polyline + * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLegStep startLocation + * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLegStep endLocation + * @property {google.maps.routing.v2.INavigationInstruction|null} [navigationInstruction] RouteLegStep navigationInstruction + * @property {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null} [travelAdvisory] RouteLegStep travelAdvisory + * @property {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null} [localizedValues] RouteLegStep localizedValues + * @property {google.maps.routing.v2.IRouteLegStepTransitDetails|null} [transitDetails] RouteLegStep transitDetails + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] RouteLegStep travelMode + */ + + /** + * Constructs a new RouteLegStep. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegStep. + * @implements IRouteLegStep + * @constructor + * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set + */ + function RouteLegStep(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegStep distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.distanceMeters = 0; + + /** + * RouteLegStep staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.staticDuration = null; + + /** + * RouteLegStep polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.polyline = null; + + /** + * RouteLegStep startLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.startLocation = null; + + /** + * RouteLegStep endLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.endLocation = null; + + /** + * RouteLegStep navigationInstruction. + * @member {google.maps.routing.v2.INavigationInstruction|null|undefined} navigationInstruction + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.navigationInstruction = null; + + /** + * RouteLegStep travelAdvisory. + * @member {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.travelAdvisory = null; + + /** + * RouteLegStep localizedValues. + * @member {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null|undefined} localizedValues + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.localizedValues = null; + + /** + * RouteLegStep transitDetails. + * @member {google.maps.routing.v2.IRouteLegStepTransitDetails|null|undefined} transitDetails + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.transitDetails = null; + + /** + * RouteLegStep travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.travelMode = 0; + + /** + * Creates a new RouteLegStep instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep instance + */ + RouteLegStep.create = function create(properties) { + return new RouteLegStep(properties); + }; + + /** + * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) + $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) + $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.navigationInstruction != null && Object.hasOwnProperty.call(message, "navigationInstruction")) + $root.google.maps.routing.v2.NavigationInstruction.encode(message.navigationInstruction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) + $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transitDetails != null && Object.hasOwnProperty.call(message, "transitDetails")) + $root.google.maps.routing.v2.RouteLegStepTransitDetails.encode(message.transitDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.travelMode); + return writer; + }; + + /** + * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStep.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distanceMeters = reader.int32(); + break; + } + case 2: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 6: { + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.decode(reader, reader.uint32()); + break; + } + case 7: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.decode(reader, reader.uint32()); + break; + } + case 8: { + message.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.decode(reader, reader.uint32()); + break; + } + case 9: { + message.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.decode(reader, reader.uint32()); + break; + } + case 10: { + message.travelMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStep message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.startLocation != null && message.hasOwnProperty("startLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); + if (error) + return "startLocation." + error; + } + if (message.endLocation != null && message.hasOwnProperty("endLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); + if (error) + return "endLocation." + error; + } + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) { + var error = $root.google.maps.routing.v2.NavigationInstruction.verify(message.navigationInstruction); + if (error) + return "navigationInstruction." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { + var error = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify(message.localizedValues); + if (error) + return "localizedValues." + error; + } + if (message.transitDetails != null && message.hasOwnProperty("transitDetails")) { + var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.verify(message.transitDetails); + if (error) + return "transitDetails." + error; + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + break; + } + return null; + }; + + /** + * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + */ + RouteLegStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStep) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStep(); + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.startLocation != null) { + if (typeof object.startLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.startLocation: object expected"); + message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); + } + if (object.endLocation != null) { + if (typeof object.endLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.endLocation: object expected"); + message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); + } + if (object.navigationInstruction != null) { + if (typeof object.navigationInstruction !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.navigationInstruction: object expected"); + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.fromObject(object.navigationInstruction); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.fromObject(object.travelAdvisory); + } + if (object.localizedValues != null) { + if (typeof object.localizedValues !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.localizedValues: object expected"); + message.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.fromObject(object.localizedValues); + } + if (object.transitDetails != null) { + if (typeof object.transitDetails !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.transitDetails: object expected"); + message.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.fromObject(object.transitDetails); + } + 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 "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + case "TRANSIT": + case 7: + message.travelMode = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.RouteLegStep} message RouteLegStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distanceMeters = 0; + object.staticDuration = null; + object.polyline = null; + object.startLocation = null; + object.endLocation = null; + object.navigationInstruction = null; + object.travelAdvisory = null; + object.localizedValues = null; + object.transitDetails = null; + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.startLocation != null && message.hasOwnProperty("startLocation")) + object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); + if (message.endLocation != null && message.hasOwnProperty("endLocation")) + object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) + object.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.toObject(message.navigationInstruction, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.toObject(message.travelAdvisory, options); + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) + object.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.toObject(message.localizedValues, options); + if (message.transitDetails != null && message.hasOwnProperty("transitDetails")) + object.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.toObject(message.transitDetails, options); + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + return object; + }; + + /** + * Converts this RouteLegStep to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + * @returns {Object.} JSON object + */ + RouteLegStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStep + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStep"; + }; + + RouteLegStep.RouteLegStepLocalizedValues = (function() { + + /** + * Properties of a RouteLegStepLocalizedValues. + * @memberof google.maps.routing.v2.RouteLegStep + * @interface IRouteLegStepLocalizedValues + * @property {google.type.ILocalizedText|null} [distance] RouteLegStepLocalizedValues distance + * @property {google.type.ILocalizedText|null} [staticDuration] RouteLegStepLocalizedValues staticDuration + */ + + /** + * Constructs a new RouteLegStepLocalizedValues. + * @memberof google.maps.routing.v2.RouteLegStep + * @classdesc Represents a RouteLegStepLocalizedValues. + * @implements IRouteLegStepLocalizedValues + * @constructor + * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues=} [properties] Properties to set + */ + function RouteLegStepLocalizedValues(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegStepLocalizedValues distance. + * @member {google.type.ILocalizedText|null|undefined} distance + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @instance + */ + RouteLegStepLocalizedValues.prototype.distance = null; + + /** + * RouteLegStepLocalizedValues staticDuration. + * @member {google.type.ILocalizedText|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @instance + */ + RouteLegStepLocalizedValues.prototype.staticDuration = null; + + /** + * Creates a new RouteLegStepLocalizedValues instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues instance + */ + RouteLegStepLocalizedValues.create = function create(properties) { + return new RouteLegStepLocalizedValues(properties); + }; + + /** + * Encodes the specified RouteLegStepLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues} message RouteLegStepLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepLocalizedValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegStepLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues} message RouteLegStepLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepLocalizedValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepLocalizedValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStepLocalizedValues message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStepLocalizedValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distance != null && message.hasOwnProperty("distance")) { + var error = $root.google.type.LocalizedText.verify(message.distance); + if (error) + return "distance." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.type.LocalizedText.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + return null; + }; + + /** + * Creates a RouteLegStepLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues + */ + RouteLegStepLocalizedValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues(); + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.distance: object expected"); + message.distance = $root.google.type.LocalizedText.fromObject(object.distance); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.staticDuration: object expected"); + message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); + } + return message; + }; + + /** + * Creates a plain object from a RouteLegStepLocalizedValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} message RouteLegStepLocalizedValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStepLocalizedValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distance = null; + object.staticDuration = null; + } + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); + return object; + }; + + /** + * Converts this RouteLegStepLocalizedValues to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @instance + * @returns {Object.} JSON object + */ + RouteLegStepLocalizedValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStepLocalizedValues + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStepLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues"; + }; + + return RouteLegStepLocalizedValues; + })(); + + return RouteLegStep; + })(); + + v2.RouteLegStepTransitDetails = (function() { + + /** + * Properties of a RouteLegStepTransitDetails. + * @memberof google.maps.routing.v2 + * @interface IRouteLegStepTransitDetails + * @property {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null} [stopDetails] RouteLegStepTransitDetails stopDetails + * @property {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null} [localizedValues] RouteLegStepTransitDetails localizedValues + * @property {string|null} [headsign] RouteLegStepTransitDetails headsign + * @property {google.protobuf.IDuration|null} [headway] RouteLegStepTransitDetails headway + * @property {google.maps.routing.v2.ITransitLine|null} [transitLine] RouteLegStepTransitDetails transitLine + * @property {number|null} [stopCount] RouteLegStepTransitDetails stopCount + * @property {string|null} [tripShortText] RouteLegStepTransitDetails tripShortText + */ + + /** + * Constructs a new RouteLegStepTransitDetails. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegStepTransitDetails. + * @implements IRouteLegStepTransitDetails + * @constructor + * @param {google.maps.routing.v2.IRouteLegStepTransitDetails=} [properties] Properties to set + */ + function RouteLegStepTransitDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegStepTransitDetails stopDetails. + * @member {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null|undefined} stopDetails + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.stopDetails = null; + + /** + * RouteLegStepTransitDetails localizedValues. + * @member {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null|undefined} localizedValues + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.localizedValues = null; + + /** + * RouteLegStepTransitDetails headsign. + * @member {string} headsign + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.headsign = ""; + + /** + * RouteLegStepTransitDetails headway. + * @member {google.protobuf.IDuration|null|undefined} headway + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.headway = null; + + /** + * RouteLegStepTransitDetails transitLine. + * @member {google.maps.routing.v2.ITransitLine|null|undefined} transitLine + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.transitLine = null; + + /** + * RouteLegStepTransitDetails stopCount. + * @member {number} stopCount + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.stopCount = 0; + + /** + * RouteLegStepTransitDetails tripShortText. + * @member {string} tripShortText + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + */ + RouteLegStepTransitDetails.prototype.tripShortText = ""; + + /** + * Creates a new RouteLegStepTransitDetails instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {google.maps.routing.v2.IRouteLegStepTransitDetails=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails instance + */ + RouteLegStepTransitDetails.create = function create(properties) { + return new RouteLegStepTransitDetails(properties); + }; + + /** + * Encodes the specified RouteLegStepTransitDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {google.maps.routing.v2.IRouteLegStepTransitDetails} message RouteLegStepTransitDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTransitDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stopDetails != null && Object.hasOwnProperty.call(message, "stopDetails")) + $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.encode(message.stopDetails, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) + $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.headsign != null && Object.hasOwnProperty.call(message, "headsign")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.headsign); + if (message.headway != null && Object.hasOwnProperty.call(message, "headway")) + $root.google.protobuf.Duration.encode(message.headway, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.transitLine != null && Object.hasOwnProperty.call(message, "transitLine")) + $root.google.maps.routing.v2.TransitLine.encode(message.transitLine, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.stopCount != null && Object.hasOwnProperty.call(message, "stopCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.stopCount); + if (message.tripShortText != null && Object.hasOwnProperty.call(message, "tripShortText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tripShortText); + return writer; + }; + + /** + * Encodes the specified RouteLegStepTransitDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {google.maps.routing.v2.IRouteLegStepTransitDetails} message RouteLegStepTransitDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTransitDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTransitDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.decode(reader, reader.uint32()); + break; + } + case 2: { + message.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.decode(reader, reader.uint32()); + break; + } + case 3: { + message.headsign = reader.string(); + break; + } + case 4: { + message.headway = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.transitLine = $root.google.maps.routing.v2.TransitLine.decode(reader, reader.uint32()); + break; + } + case 6: { + message.stopCount = reader.int32(); + break; + } + case 7: { + message.tripShortText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTransitDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStepTransitDetails message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStepTransitDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stopDetails != null && message.hasOwnProperty("stopDetails")) { + var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify(message.stopDetails); + if (error) + return "stopDetails." + error; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { + var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify(message.localizedValues); + if (error) + return "localizedValues." + error; + } + if (message.headsign != null && message.hasOwnProperty("headsign")) + if (!$util.isString(message.headsign)) + return "headsign: string expected"; + if (message.headway != null && message.hasOwnProperty("headway")) { + var error = $root.google.protobuf.Duration.verify(message.headway); + if (error) + return "headway." + error; + } + if (message.transitLine != null && message.hasOwnProperty("transitLine")) { + var error = $root.google.maps.routing.v2.TransitLine.verify(message.transitLine); + if (error) + return "transitLine." + error; + } + if (message.stopCount != null && message.hasOwnProperty("stopCount")) + if (!$util.isInteger(message.stopCount)) + return "stopCount: integer expected"; + if (message.tripShortText != null && message.hasOwnProperty("tripShortText")) + if (!$util.isString(message.tripShortText)) + return "tripShortText: string expected"; + return null; + }; + + /** + * Creates a RouteLegStepTransitDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails + */ + RouteLegStepTransitDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails(); + if (object.stopDetails != null) { + if (typeof object.stopDetails !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.stopDetails: object expected"); + message.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.fromObject(object.stopDetails); + } + if (object.localizedValues != null) { + if (typeof object.localizedValues !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.localizedValues: object expected"); + message.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.fromObject(object.localizedValues); + } + if (object.headsign != null) + message.headsign = String(object.headsign); + if (object.headway != null) { + if (typeof object.headway !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.headway: object expected"); + message.headway = $root.google.protobuf.Duration.fromObject(object.headway); + } + if (object.transitLine != null) { + if (typeof object.transitLine !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.transitLine: object expected"); + message.transitLine = $root.google.maps.routing.v2.TransitLine.fromObject(object.transitLine); + } + if (object.stopCount != null) + message.stopCount = object.stopCount | 0; + if (object.tripShortText != null) + message.tripShortText = String(object.tripShortText); + return message; + }; + + /** + * Creates a plain object from a RouteLegStepTransitDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails} message RouteLegStepTransitDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStepTransitDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stopDetails = null; + object.localizedValues = null; + object.headsign = ""; + object.headway = null; + object.transitLine = null; + object.stopCount = 0; + object.tripShortText = ""; + } + if (message.stopDetails != null && message.hasOwnProperty("stopDetails")) + object.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.toObject(message.stopDetails, options); + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) + object.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.toObject(message.localizedValues, options); + if (message.headsign != null && message.hasOwnProperty("headsign")) + object.headsign = message.headsign; + if (message.headway != null && message.hasOwnProperty("headway")) + object.headway = $root.google.protobuf.Duration.toObject(message.headway, options); + if (message.transitLine != null && message.hasOwnProperty("transitLine")) + object.transitLine = $root.google.maps.routing.v2.TransitLine.toObject(message.transitLine, options); + if (message.stopCount != null && message.hasOwnProperty("stopCount")) + object.stopCount = message.stopCount; + if (message.tripShortText != null && message.hasOwnProperty("tripShortText")) + object.tripShortText = message.tripShortText; + return object; + }; + + /** + * Converts this RouteLegStepTransitDetails to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @instance + * @returns {Object.} JSON object + */ + RouteLegStepTransitDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStepTransitDetails + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStepTransitDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails"; + }; + + RouteLegStepTransitDetails.TransitStopDetails = (function() { + + /** + * Properties of a TransitStopDetails. + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @interface ITransitStopDetails + * @property {google.maps.routing.v2.ITransitStop|null} [arrivalStop] TransitStopDetails arrivalStop + * @property {google.protobuf.ITimestamp|null} [arrivalTime] TransitStopDetails arrivalTime + * @property {google.maps.routing.v2.ITransitStop|null} [departureStop] TransitStopDetails departureStop + * @property {google.protobuf.ITimestamp|null} [departureTime] TransitStopDetails departureTime + */ + + /** + * Constructs a new TransitStopDetails. + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @classdesc Represents a TransitStopDetails. + * @implements ITransitStopDetails + * @constructor + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails=} [properties] Properties to set + */ + function TransitStopDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitStopDetails arrivalStop. + * @member {google.maps.routing.v2.ITransitStop|null|undefined} arrivalStop + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @instance + */ + TransitStopDetails.prototype.arrivalStop = null; + + /** + * TransitStopDetails arrivalTime. + * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @instance + */ + TransitStopDetails.prototype.arrivalTime = null; + + /** + * TransitStopDetails departureStop. + * @member {google.maps.routing.v2.ITransitStop|null|undefined} departureStop + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @instance + */ + TransitStopDetails.prototype.departureStop = null; + + /** + * TransitStopDetails departureTime. + * @member {google.protobuf.ITimestamp|null|undefined} departureTime + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @instance + */ + TransitStopDetails.prototype.departureTime = null; + + /** + * Creates a new TransitStopDetails instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails instance + */ + TransitStopDetails.create = function create(properties) { + return new TransitStopDetails(properties); + }; + + /** + * Encodes the specified TransitStopDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails} message TransitStopDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitStopDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arrivalStop != null && Object.hasOwnProperty.call(message, "arrivalStop")) + $root.google.maps.routing.v2.TransitStop.encode(message.arrivalStop, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) + $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.departureStop != null && Object.hasOwnProperty.call(message, "departureStop")) + $root.google.maps.routing.v2.TransitStop.encode(message.departureStop, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitStopDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails} message TransitStopDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitStopDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitStopDetails message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitStopDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.arrivalStop = $root.google.maps.routing.v2.TransitStop.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.departureStop = $root.google.maps.routing.v2.TransitStop.decode(reader, reader.uint32()); + break; + } + case 4: { + message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitStopDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitStopDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitStopDetails message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitStopDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arrivalStop != null && message.hasOwnProperty("arrivalStop")) { + var error = $root.google.maps.routing.v2.TransitStop.verify(message.arrivalStop); + if (error) + return "arrivalStop." + error; + } + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); + if (error) + return "arrivalTime." + error; + } + if (message.departureStop != null && message.hasOwnProperty("departureStop")) { + var error = $root.google.maps.routing.v2.TransitStop.verify(message.departureStop); + if (error) + return "departureStop." + error; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + return null; + }; + + /** + * Creates a TransitStopDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails + */ + TransitStopDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails(); + if (object.arrivalStop != null) { + if (typeof object.arrivalStop !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.arrivalStop: object expected"); + message.arrivalStop = $root.google.maps.routing.v2.TransitStop.fromObject(object.arrivalStop); + } + if (object.arrivalTime != null) { + if (typeof object.arrivalTime !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.arrivalTime: object expected"); + message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); + } + if (object.departureStop != null) { + if (typeof object.departureStop !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.departureStop: object expected"); + message.departureStop = $root.google.maps.routing.v2.TransitStop.fromObject(object.departureStop); + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.departureTime: object expected"); + message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); + } + return message; + }; + + /** + * Creates a plain object from a TransitStopDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} message TransitStopDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitStopDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.arrivalStop = null; + object.arrivalTime = null; + object.departureStop = null; + object.departureTime = null; + } + if (message.arrivalStop != null && message.hasOwnProperty("arrivalStop")) + object.arrivalStop = $root.google.maps.routing.v2.TransitStop.toObject(message.arrivalStop, options); + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) + object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); + if (message.departureStop != null && message.hasOwnProperty("departureStop")) + object.departureStop = $root.google.maps.routing.v2.TransitStop.toObject(message.departureStop, options); + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); + return object; + }; + + /** + * Converts this TransitStopDetails to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @instance + * @returns {Object.} JSON object + */ + TransitStopDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitStopDetails + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitStopDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails"; + }; + + return TransitStopDetails; + })(); + + RouteLegStepTransitDetails.TransitDetailsLocalizedValues = (function() { + + /** + * Properties of a TransitDetailsLocalizedValues. + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @interface ITransitDetailsLocalizedValues + * @property {google.maps.routing.v2.ILocalizedTime|null} [arrivalTime] TransitDetailsLocalizedValues arrivalTime + * @property {google.maps.routing.v2.ILocalizedTime|null} [departureTime] TransitDetailsLocalizedValues departureTime + */ + + /** + * Constructs a new TransitDetailsLocalizedValues. + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails + * @classdesc Represents a TransitDetailsLocalizedValues. + * @implements ITransitDetailsLocalizedValues + * @constructor + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues=} [properties] Properties to set + */ + function TransitDetailsLocalizedValues(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitDetailsLocalizedValues arrivalTime. + * @member {google.maps.routing.v2.ILocalizedTime|null|undefined} arrivalTime + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @instance + */ + TransitDetailsLocalizedValues.prototype.arrivalTime = null; + + /** + * TransitDetailsLocalizedValues departureTime. + * @member {google.maps.routing.v2.ILocalizedTime|null|undefined} departureTime + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @instance + */ + TransitDetailsLocalizedValues.prototype.departureTime = null; + + /** + * Creates a new TransitDetailsLocalizedValues instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues instance + */ + TransitDetailsLocalizedValues.create = function create(properties) { + return new TransitDetailsLocalizedValues(properties); + }; + + /** + * Encodes the specified TransitDetailsLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues} message TransitDetailsLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitDetailsLocalizedValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) + $root.google.maps.routing.v2.LocalizedTime.encode(message.arrivalTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.maps.routing.v2.LocalizedTime.encode(message.departureTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitDetailsLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues} message TransitDetailsLocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitDetailsLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitDetailsLocalizedValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.departureTime = $root.google.maps.routing.v2.LocalizedTime.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitDetailsLocalizedValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitDetailsLocalizedValues message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitDetailsLocalizedValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { + var error = $root.google.maps.routing.v2.LocalizedTime.verify(message.arrivalTime); + if (error) + return "arrivalTime." + error; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.maps.routing.v2.LocalizedTime.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + return null; + }; + + /** + * Creates a TransitDetailsLocalizedValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues + */ + TransitDetailsLocalizedValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues(); + if (object.arrivalTime != null) { + if (typeof object.arrivalTime !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.arrivalTime: object expected"); + message.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.fromObject(object.arrivalTime); + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.departureTime: object expected"); + message.departureTime = $root.google.maps.routing.v2.LocalizedTime.fromObject(object.departureTime); + } + return message; + }; + + /** + * Creates a plain object from a TransitDetailsLocalizedValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} message TransitDetailsLocalizedValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitDetailsLocalizedValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.arrivalTime = null; + object.departureTime = null; + } + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) + object.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.toObject(message.arrivalTime, options); + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.maps.routing.v2.LocalizedTime.toObject(message.departureTime, options); + return object; + }; + + /** + * Converts this TransitDetailsLocalizedValues to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @instance + * @returns {Object.} JSON object + */ + TransitDetailsLocalizedValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitDetailsLocalizedValues + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitDetailsLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues"; + }; + + return TransitDetailsLocalizedValues; + })(); + + return RouteLegStepTransitDetails; + })(); + + /** + * RouteLabel enum. + * @name google.maps.routing.v2.RouteLabel + * @enum {number} + * @property {number} ROUTE_LABEL_UNSPECIFIED=0 ROUTE_LABEL_UNSPECIFIED value + * @property {number} DEFAULT_ROUTE=1 DEFAULT_ROUTE value + * @property {number} DEFAULT_ROUTE_ALTERNATE=2 DEFAULT_ROUTE_ALTERNATE value + * @property {number} FUEL_EFFICIENT=3 FUEL_EFFICIENT value + * @property {number} SHORTER_DISTANCE=4 SHORTER_DISTANCE value + */ + v2.RouteLabel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTE_LABEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT_ROUTE"] = 1; + values[valuesById[2] = "DEFAULT_ROUTE_ALTERNATE"] = 2; + values[valuesById[3] = "FUEL_EFFICIENT"] = 3; + values[valuesById[4] = "SHORTER_DISTANCE"] = 4; + return values; + })(); + + /** + * RouteTravelMode enum. + * @name google.maps.routing.v2.RouteTravelMode + * @enum {number} + * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value + * @property {number} DRIVE=1 DRIVE value + * @property {number} BICYCLE=2 BICYCLE value + * @property {number} WALK=3 WALK value + * @property {number} TWO_WHEELER=4 TWO_WHEELER value + * @property {number} TRANSIT=7 TRANSIT value + */ + v2.RouteTravelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVE"] = 1; + values[valuesById[2] = "BICYCLE"] = 2; + values[valuesById[3] = "WALK"] = 3; + values[valuesById[4] = "TWO_WHEELER"] = 4; + values[valuesById[7] = "TRANSIT"] = 7; + return values; + })(); + + v2.SpeedReadingInterval = (function() { + + /** + * Properties of a SpeedReadingInterval. + * @memberof google.maps.routing.v2 + * @interface ISpeedReadingInterval + * @property {number|null} [startPolylinePointIndex] SpeedReadingInterval startPolylinePointIndex + * @property {number|null} [endPolylinePointIndex] SpeedReadingInterval endPolylinePointIndex + * @property {google.maps.routing.v2.SpeedReadingInterval.Speed|null} [speed] SpeedReadingInterval speed + */ + + /** + * Constructs a new SpeedReadingInterval. + * @memberof google.maps.routing.v2 + * @classdesc Represents a SpeedReadingInterval. + * @implements ISpeedReadingInterval + * @constructor + * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set + */ + function SpeedReadingInterval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeedReadingInterval startPolylinePointIndex. + * @member {number|null|undefined} startPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.startPolylinePointIndex = null; + + /** + * SpeedReadingInterval endPolylinePointIndex. + * @member {number|null|undefined} endPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.endPolylinePointIndex = null; + + /** + * SpeedReadingInterval speed. + * @member {google.maps.routing.v2.SpeedReadingInterval.Speed|null|undefined} speed + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.speed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpeedReadingInterval.prototype, "_startPolylinePointIndex", { + get: $util.oneOfGetter($oneOfFields = ["startPolylinePointIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpeedReadingInterval.prototype, "_endPolylinePointIndex", { + get: $util.oneOfGetter($oneOfFields = ["endPolylinePointIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SpeedReadingInterval speedType. + * @member {"speed"|undefined} speedType + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + Object.defineProperty(SpeedReadingInterval.prototype, "speedType", { + get: $util.oneOfGetter($oneOfFields = ["speed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpeedReadingInterval instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval instance + */ + SpeedReadingInterval.create = function create(properties) { + return new SpeedReadingInterval(properties); + }; + + /** + * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeedReadingInterval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startPolylinePointIndex != null && Object.hasOwnProperty.call(message, "startPolylinePointIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startPolylinePointIndex); + if (message.endPolylinePointIndex != null && Object.hasOwnProperty.call(message, "endPolylinePointIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endPolylinePointIndex); + if (message.speed != null && Object.hasOwnProperty.call(message, "speed")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speed); + return writer; + }; + + /** + * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeedReadingInterval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeedReadingInterval.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.SpeedReadingInterval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startPolylinePointIndex = reader.int32(); + break; + } + case 2: { + message.endPolylinePointIndex = reader.int32(); + break; + } + case 3: { + message.speed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeedReadingInterval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeedReadingInterval message. + * @function verify + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeedReadingInterval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { + properties._startPolylinePointIndex = 1; + if (!$util.isInteger(message.startPolylinePointIndex)) + return "startPolylinePointIndex: integer expected"; + } + if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { + properties._endPolylinePointIndex = 1; + if (!$util.isInteger(message.endPolylinePointIndex)) + return "endPolylinePointIndex: integer expected"; + } + if (message.speed != null && message.hasOwnProperty("speed")) { + properties.speedType = 1; + switch (message.speed) { + default: + return "speed: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + */ + SpeedReadingInterval.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.SpeedReadingInterval) + return object; + var message = new $root.google.maps.routing.v2.SpeedReadingInterval(); + if (object.startPolylinePointIndex != null) + message.startPolylinePointIndex = object.startPolylinePointIndex | 0; + if (object.endPolylinePointIndex != null) + message.endPolylinePointIndex = object.endPolylinePointIndex | 0; + switch (object.speed) { + default: + if (typeof object.speed === "number") { + message.speed = object.speed; + break; + } + break; + case "SPEED_UNSPECIFIED": + case 0: + message.speed = 0; + break; + case "NORMAL": + case 1: + message.speed = 1; + break; + case "SLOW": + case 2: + message.speed = 2; + break; + case "TRAFFIC_JAM": + case 3: + message.speed = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.SpeedReadingInterval} message SpeedReadingInterval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeedReadingInterval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { + object.startPolylinePointIndex = message.startPolylinePointIndex; + if (options.oneofs) + object._startPolylinePointIndex = "startPolylinePointIndex"; + } + if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { + object.endPolylinePointIndex = message.endPolylinePointIndex; + if (options.oneofs) + object._endPolylinePointIndex = "endPolylinePointIndex"; + } + if (message.speed != null && message.hasOwnProperty("speed")) { + object.speed = options.enums === String ? $root.google.maps.routing.v2.SpeedReadingInterval.Speed[message.speed] === undefined ? message.speed : $root.google.maps.routing.v2.SpeedReadingInterval.Speed[message.speed] : message.speed; + if (options.oneofs) + object.speedType = "speed"; + } + return object; + }; + + /** + * Converts this SpeedReadingInterval to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + * @returns {Object.} JSON object + */ + SpeedReadingInterval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeedReadingInterval + * @function getTypeUrl + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeedReadingInterval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.SpeedReadingInterval"; + }; + + /** + * Speed enum. + * @name google.maps.routing.v2.SpeedReadingInterval.Speed + * @enum {number} + * @property {number} SPEED_UNSPECIFIED=0 SPEED_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} SLOW=2 SLOW value + * @property {number} TRAFFIC_JAM=3 TRAFFIC_JAM value + */ + SpeedReadingInterval.Speed = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEED_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "SLOW"] = 2; + values[valuesById[3] = "TRAFFIC_JAM"] = 3; + return values; + })(); + + return SpeedReadingInterval; + })(); + + v2.TollInfo = (function() { + + /** + * Properties of a TollInfo. + * @memberof google.maps.routing.v2 + * @interface ITollInfo + * @property {Array.|null} [estimatedPrice] TollInfo estimatedPrice + */ + + /** + * Constructs a new TollInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TollInfo. + * @implements ITollInfo + * @constructor + * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set + */ + function TollInfo(properties) { + this.estimatedPrice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TollInfo estimatedPrice. + * @member {Array.} estimatedPrice + * @memberof google.maps.routing.v2.TollInfo + * @instance + */ + TollInfo.prototype.estimatedPrice = $util.emptyArray; + + /** + * Creates a new TollInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.TollInfo} TollInfo instance + */ + TollInfo.create = function create(properties) { + return new TollInfo(properties); + }; + + /** + * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TollInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedPrice != null && message.estimatedPrice.length) + for (var i = 0; i < message.estimatedPrice.length; ++i) + $root.google.type.Money.encode(message.estimatedPrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TollInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TollInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TollInfo} TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TollInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TollInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.estimatedPrice && message.estimatedPrice.length)) + message.estimatedPrice = []; + message.estimatedPrice.push($root.google.type.Money.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TollInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TollInfo} TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TollInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TollInfo message. + * @function verify + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TollInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedPrice != null && message.hasOwnProperty("estimatedPrice")) { + if (!Array.isArray(message.estimatedPrice)) + return "estimatedPrice: array expected"; + for (var i = 0; i < message.estimatedPrice.length; ++i) { + var error = $root.google.type.Money.verify(message.estimatedPrice[i]); + if (error) + return "estimatedPrice." + error; + } + } + return null; + }; + + /** + * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TollInfo} TollInfo + */ + TollInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TollInfo) + return object; + var message = new $root.google.maps.routing.v2.TollInfo(); + if (object.estimatedPrice) { + if (!Array.isArray(object.estimatedPrice)) + throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: array expected"); + message.estimatedPrice = []; + for (var i = 0; i < object.estimatedPrice.length; ++i) { + if (typeof object.estimatedPrice[i] !== "object") + throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: object expected"); + message.estimatedPrice[i] = $root.google.type.Money.fromObject(object.estimatedPrice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TollInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.TollInfo} message TollInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TollInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.estimatedPrice = []; + if (message.estimatedPrice && message.estimatedPrice.length) { + object.estimatedPrice = []; + for (var j = 0; j < message.estimatedPrice.length; ++j) + object.estimatedPrice[j] = $root.google.type.Money.toObject(message.estimatedPrice[j], options); + } + return object; + }; + + /** + * Converts this TollInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TollInfo + * @instance + * @returns {Object.} JSON object + */ + TollInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TollInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TollInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TollInfo"; + }; + + return TollInfo; + })(); + + v2.TransitAgency = (function() { + + /** + * Properties of a TransitAgency. + * @memberof google.maps.routing.v2 + * @interface ITransitAgency + * @property {string|null} [name] TransitAgency name + * @property {string|null} [phoneNumber] TransitAgency phoneNumber + * @property {string|null} [uri] TransitAgency uri + */ + + /** + * Constructs a new TransitAgency. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TransitAgency. + * @implements ITransitAgency + * @constructor + * @param {google.maps.routing.v2.ITransitAgency=} [properties] Properties to set + */ + function TransitAgency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitAgency name. + * @member {string} name + * @memberof google.maps.routing.v2.TransitAgency + * @instance + */ + TransitAgency.prototype.name = ""; + + /** + * TransitAgency phoneNumber. + * @member {string} phoneNumber + * @memberof google.maps.routing.v2.TransitAgency + * @instance + */ + TransitAgency.prototype.phoneNumber = ""; + + /** + * TransitAgency uri. + * @member {string} uri + * @memberof google.maps.routing.v2.TransitAgency + * @instance + */ + TransitAgency.prototype.uri = ""; + + /** + * Creates a new TransitAgency instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {google.maps.routing.v2.ITransitAgency=} [properties] Properties to set + * @returns {google.maps.routing.v2.TransitAgency} TransitAgency instance + */ + TransitAgency.create = function create(properties) { + return new TransitAgency(properties); + }; + + /** + * Encodes the specified TransitAgency message. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {google.maps.routing.v2.ITransitAgency} message TransitAgency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitAgency.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.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + return writer; + }; + + /** + * Encodes the specified TransitAgency message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {google.maps.routing.v2.ITransitAgency} message TransitAgency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitAgency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitAgency message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TransitAgency} TransitAgency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitAgency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitAgency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.phoneNumber = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitAgency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TransitAgency} TransitAgency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitAgency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitAgency message. + * @function verify + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitAgency.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.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a TransitAgency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TransitAgency} TransitAgency + */ + TransitAgency.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TransitAgency) + return object; + var message = new $root.google.maps.routing.v2.TransitAgency(); + if (object.name != null) + message.name = String(object.name); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a TransitAgency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {google.maps.routing.v2.TransitAgency} message TransitAgency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitAgency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.phoneNumber = ""; + object.uri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this TransitAgency to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TransitAgency + * @instance + * @returns {Object.} JSON object + */ + TransitAgency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitAgency + * @function getTypeUrl + * @memberof google.maps.routing.v2.TransitAgency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitAgency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TransitAgency"; + }; + + return TransitAgency; + })(); + + v2.TransitLine = (function() { + + /** + * Properties of a TransitLine. + * @memberof google.maps.routing.v2 + * @interface ITransitLine + * @property {Array.|null} [agencies] TransitLine agencies + * @property {string|null} [name] TransitLine name + * @property {string|null} [uri] TransitLine uri + * @property {string|null} [color] TransitLine color + * @property {string|null} [iconUri] TransitLine iconUri + * @property {string|null} [nameShort] TransitLine nameShort + * @property {string|null} [textColor] TransitLine textColor + * @property {google.maps.routing.v2.ITransitVehicle|null} [vehicle] TransitLine vehicle + */ + + /** + * Constructs a new TransitLine. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TransitLine. + * @implements ITransitLine + * @constructor + * @param {google.maps.routing.v2.ITransitLine=} [properties] Properties to set + */ + function TransitLine(properties) { + this.agencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitLine agencies. + * @member {Array.} agencies + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.agencies = $util.emptyArray; + + /** + * TransitLine name. + * @member {string} name + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.name = ""; + + /** + * TransitLine uri. + * @member {string} uri + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.uri = ""; + + /** + * TransitLine color. + * @member {string} color + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.color = ""; + + /** + * TransitLine iconUri. + * @member {string} iconUri + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.iconUri = ""; + + /** + * TransitLine nameShort. + * @member {string} nameShort + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.nameShort = ""; + + /** + * TransitLine textColor. + * @member {string} textColor + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.textColor = ""; + + /** + * TransitLine vehicle. + * @member {google.maps.routing.v2.ITransitVehicle|null|undefined} vehicle + * @memberof google.maps.routing.v2.TransitLine + * @instance + */ + TransitLine.prototype.vehicle = null; + + /** + * Creates a new TransitLine instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {google.maps.routing.v2.ITransitLine=} [properties] Properties to set + * @returns {google.maps.routing.v2.TransitLine} TransitLine instance + */ + TransitLine.create = function create(properties) { + return new TransitLine(properties); + }; + + /** + * Encodes the specified TransitLine message. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {google.maps.routing.v2.ITransitLine} message TransitLine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitLine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agencies != null && message.agencies.length) + for (var i = 0; i < message.agencies.length; ++i) + $root.google.maps.routing.v2.TransitAgency.encode(message.agencies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.color != null && Object.hasOwnProperty.call(message, "color")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.color); + if (message.iconUri != null && Object.hasOwnProperty.call(message, "iconUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.iconUri); + if (message.nameShort != null && Object.hasOwnProperty.call(message, "nameShort")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.nameShort); + if (message.textColor != null && Object.hasOwnProperty.call(message, "textColor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.textColor); + if (message.vehicle != null && Object.hasOwnProperty.call(message, "vehicle")) + $root.google.maps.routing.v2.TransitVehicle.encode(message.vehicle, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitLine message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {google.maps.routing.v2.ITransitLine} message TransitLine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitLine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitLine message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TransitLine} TransitLine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitLine.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitLine(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agencies && message.agencies.length)) + message.agencies = []; + message.agencies.push($root.google.maps.routing.v2.TransitAgency.decode(reader, reader.uint32())); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.color = reader.string(); + break; + } + case 5: { + message.iconUri = reader.string(); + break; + } + case 6: { + message.nameShort = reader.string(); + break; + } + case 7: { + message.textColor = reader.string(); + break; + } + case 8: { + message.vehicle = $root.google.maps.routing.v2.TransitVehicle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitLine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TransitLine} TransitLine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitLine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitLine message. + * @function verify + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitLine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agencies != null && message.hasOwnProperty("agencies")) { + if (!Array.isArray(message.agencies)) + return "agencies: array expected"; + for (var i = 0; i < message.agencies.length; ++i) { + var error = $root.google.maps.routing.v2.TransitAgency.verify(message.agencies[i]); + if (error) + return "agencies." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.color != null && message.hasOwnProperty("color")) + if (!$util.isString(message.color)) + return "color: string expected"; + if (message.iconUri != null && message.hasOwnProperty("iconUri")) + if (!$util.isString(message.iconUri)) + return "iconUri: string expected"; + if (message.nameShort != null && message.hasOwnProperty("nameShort")) + if (!$util.isString(message.nameShort)) + return "nameShort: string expected"; + if (message.textColor != null && message.hasOwnProperty("textColor")) + if (!$util.isString(message.textColor)) + return "textColor: string expected"; + if (message.vehicle != null && message.hasOwnProperty("vehicle")) { + var error = $root.google.maps.routing.v2.TransitVehicle.verify(message.vehicle); + if (error) + return "vehicle." + error; + } + return null; + }; + + /** + * Creates a TransitLine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TransitLine} TransitLine + */ + TransitLine.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TransitLine) + return object; + var message = new $root.google.maps.routing.v2.TransitLine(); + if (object.agencies) { + if (!Array.isArray(object.agencies)) + throw TypeError(".google.maps.routing.v2.TransitLine.agencies: array expected"); + message.agencies = []; + for (var i = 0; i < object.agencies.length; ++i) { + if (typeof object.agencies[i] !== "object") + throw TypeError(".google.maps.routing.v2.TransitLine.agencies: object expected"); + message.agencies[i] = $root.google.maps.routing.v2.TransitAgency.fromObject(object.agencies[i]); + } + } + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.color != null) + message.color = String(object.color); + if (object.iconUri != null) + message.iconUri = String(object.iconUri); + if (object.nameShort != null) + message.nameShort = String(object.nameShort); + if (object.textColor != null) + message.textColor = String(object.textColor); + if (object.vehicle != null) { + if (typeof object.vehicle !== "object") + throw TypeError(".google.maps.routing.v2.TransitLine.vehicle: object expected"); + message.vehicle = $root.google.maps.routing.v2.TransitVehicle.fromObject(object.vehicle); + } + return message; + }; + + /** + * Creates a plain object from a TransitLine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {google.maps.routing.v2.TransitLine} message TransitLine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitLine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agencies = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + object.color = ""; + object.iconUri = ""; + object.nameShort = ""; + object.textColor = ""; + object.vehicle = null; + } + if (message.agencies && message.agencies.length) { + object.agencies = []; + for (var j = 0; j < message.agencies.length; ++j) + object.agencies[j] = $root.google.maps.routing.v2.TransitAgency.toObject(message.agencies[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.color != null && message.hasOwnProperty("color")) + object.color = message.color; + if (message.iconUri != null && message.hasOwnProperty("iconUri")) + object.iconUri = message.iconUri; + if (message.nameShort != null && message.hasOwnProperty("nameShort")) + object.nameShort = message.nameShort; + if (message.textColor != null && message.hasOwnProperty("textColor")) + object.textColor = message.textColor; + if (message.vehicle != null && message.hasOwnProperty("vehicle")) + object.vehicle = $root.google.maps.routing.v2.TransitVehicle.toObject(message.vehicle, options); + return object; + }; + + /** + * Converts this TransitLine to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TransitLine + * @instance + * @returns {Object.} JSON object + */ + TransitLine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitLine + * @function getTypeUrl + * @memberof google.maps.routing.v2.TransitLine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitLine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TransitLine"; + }; + + return TransitLine; + })(); + + v2.TransitStop = (function() { + + /** + * Properties of a TransitStop. + * @memberof google.maps.routing.v2 + * @interface ITransitStop + * @property {string|null} [name] TransitStop name + * @property {google.maps.routing.v2.ILocation|null} [location] TransitStop location + */ + + /** + * Constructs a new TransitStop. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TransitStop. + * @implements ITransitStop + * @constructor + * @param {google.maps.routing.v2.ITransitStop=} [properties] Properties to set + */ + function TransitStop(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitStop name. + * @member {string} name + * @memberof google.maps.routing.v2.TransitStop + * @instance + */ + TransitStop.prototype.name = ""; + + /** + * TransitStop location. + * @member {google.maps.routing.v2.ILocation|null|undefined} location + * @memberof google.maps.routing.v2.TransitStop + * @instance + */ + TransitStop.prototype.location = null; + + /** + * Creates a new TransitStop instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {google.maps.routing.v2.ITransitStop=} [properties] Properties to set + * @returns {google.maps.routing.v2.TransitStop} TransitStop instance + */ + TransitStop.create = function create(properties) { + return new TransitStop(properties); + }; + + /** + * Encodes the specified TransitStop message. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {google.maps.routing.v2.ITransitStop} message TransitStop message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitStop.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.maps.routing.v2.Location.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitStop message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {google.maps.routing.v2.ITransitStop} message TransitStop message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitStop.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitStop message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TransitStop} TransitStop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitStop.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitStop(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.location = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitStop message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TransitStop} TransitStop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitStop.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitStop message. + * @function verify + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitStop.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.maps.routing.v2.Location.verify(message.location); + if (error) + return "location." + error; + } + return null; + }; + + /** + * Creates a TransitStop message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TransitStop} TransitStop + */ + TransitStop.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TransitStop) + return object; + var message = new $root.google.maps.routing.v2.TransitStop(); + if (object.name != null) + message.name = String(object.name); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.maps.routing.v2.TransitStop.location: object expected"); + message.location = $root.google.maps.routing.v2.Location.fromObject(object.location); + } + return message; + }; + + /** + * Creates a plain object from a TransitStop message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {google.maps.routing.v2.TransitStop} message TransitStop + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitStop.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.location = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.maps.routing.v2.Location.toObject(message.location, options); + return object; + }; + + /** + * Converts this TransitStop to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TransitStop + * @instance + * @returns {Object.} JSON object + */ + TransitStop.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitStop + * @function getTypeUrl + * @memberof google.maps.routing.v2.TransitStop + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitStop.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TransitStop"; + }; + + return TransitStop; + })(); + + v2.TransitVehicle = (function() { + + /** + * Properties of a TransitVehicle. + * @memberof google.maps.routing.v2 + * @interface ITransitVehicle + * @property {google.type.ILocalizedText|null} [name] TransitVehicle name + * @property {google.maps.routing.v2.TransitVehicle.TransitVehicleType|null} [type] TransitVehicle type + * @property {string|null} [iconUri] TransitVehicle iconUri + * @property {string|null} [localIconUri] TransitVehicle localIconUri + */ + + /** + * Constructs a new TransitVehicle. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TransitVehicle. + * @implements ITransitVehicle + * @constructor + * @param {google.maps.routing.v2.ITransitVehicle=} [properties] Properties to set + */ + function TransitVehicle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitVehicle name. + * @member {google.type.ILocalizedText|null|undefined} name + * @memberof google.maps.routing.v2.TransitVehicle + * @instance + */ + TransitVehicle.prototype.name = null; + + /** + * TransitVehicle type. + * @member {google.maps.routing.v2.TransitVehicle.TransitVehicleType} type + * @memberof google.maps.routing.v2.TransitVehicle + * @instance + */ + TransitVehicle.prototype.type = 0; + + /** + * TransitVehicle iconUri. + * @member {string} iconUri + * @memberof google.maps.routing.v2.TransitVehicle + * @instance + */ + TransitVehicle.prototype.iconUri = ""; + + /** + * TransitVehicle localIconUri. + * @member {string} localIconUri + * @memberof google.maps.routing.v2.TransitVehicle + * @instance + */ + TransitVehicle.prototype.localIconUri = ""; + + /** + * Creates a new TransitVehicle instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {google.maps.routing.v2.ITransitVehicle=} [properties] Properties to set + * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle instance + */ + TransitVehicle.create = function create(properties) { + return new TransitVehicle(properties); + }; + + /** + * Encodes the specified TransitVehicle message. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {google.maps.routing.v2.ITransitVehicle} message TransitVehicle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitVehicle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + $root.google.type.LocalizedText.encode(message.name, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.iconUri != null && Object.hasOwnProperty.call(message, "iconUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.iconUri); + if (message.localIconUri != null && Object.hasOwnProperty.call(message, "localIconUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.localIconUri); + return writer; + }; + + /** + * Encodes the specified TransitVehicle message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {google.maps.routing.v2.ITransitVehicle} message TransitVehicle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitVehicle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitVehicle message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitVehicle.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitVehicle(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.iconUri = reader.string(); + break; + } + case 4: { + message.localIconUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitVehicle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitVehicle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitVehicle message. + * @function verify + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitVehicle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + var error = $root.google.type.LocalizedText.verify(message.name); + if (error) + return "name." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + 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.iconUri != null && message.hasOwnProperty("iconUri")) + if (!$util.isString(message.iconUri)) + return "iconUri: string expected"; + if (message.localIconUri != null && message.hasOwnProperty("localIconUri")) + if (!$util.isString(message.localIconUri)) + return "localIconUri: string expected"; + return null; + }; + + /** + * Creates a TransitVehicle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle + */ + TransitVehicle.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TransitVehicle) + return object; + var message = new $root.google.maps.routing.v2.TransitVehicle(); + if (object.name != null) { + if (typeof object.name !== "object") + throw TypeError(".google.maps.routing.v2.TransitVehicle.name: object expected"); + message.name = $root.google.type.LocalizedText.fromObject(object.name); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TRANSIT_VEHICLE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BUS": + case 1: + message.type = 1; + break; + case "CABLE_CAR": + case 2: + message.type = 2; + break; + case "COMMUTER_TRAIN": + case 3: + message.type = 3; + break; + case "FERRY": + case 4: + message.type = 4; + break; + case "FUNICULAR": + case 5: + message.type = 5; + break; + case "GONDOLA_LIFT": + case 6: + message.type = 6; + break; + case "HEAVY_RAIL": + case 7: + message.type = 7; + break; + case "HIGH_SPEED_TRAIN": + case 8: + message.type = 8; + break; + case "INTERCITY_BUS": + case 9: + message.type = 9; + break; + case "LONG_DISTANCE_TRAIN": + case 10: + message.type = 10; + break; + case "METRO_RAIL": + case 11: + message.type = 11; + break; + case "MONORAIL": + case 12: + message.type = 12; + break; + case "OTHER": + case 13: + message.type = 13; + break; + case "RAIL": + case 14: + message.type = 14; + break; + case "SHARE_TAXI": + case 15: + message.type = 15; + break; + case "SUBWAY": + case 16: + message.type = 16; + break; + case "TRAM": + case 17: + message.type = 17; + break; + case "TROLLEYBUS": + case 18: + message.type = 18; + break; + } + if (object.iconUri != null) + message.iconUri = String(object.iconUri); + if (object.localIconUri != null) + message.localIconUri = String(object.localIconUri); + return message; + }; + + /** + * Creates a plain object from a TransitVehicle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {google.maps.routing.v2.TransitVehicle} message TransitVehicle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitVehicle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = null; + object.type = options.enums === String ? "TRANSIT_VEHICLE_TYPE_UNSPECIFIED" : 0; + object.iconUri = ""; + object.localIconUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = $root.google.type.LocalizedText.toObject(message.name, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.maps.routing.v2.TransitVehicle.TransitVehicleType[message.type] === undefined ? message.type : $root.google.maps.routing.v2.TransitVehicle.TransitVehicleType[message.type] : message.type; + if (message.iconUri != null && message.hasOwnProperty("iconUri")) + object.iconUri = message.iconUri; + if (message.localIconUri != null && message.hasOwnProperty("localIconUri")) + object.localIconUri = message.localIconUri; + return object; + }; + + /** + * Converts this TransitVehicle to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TransitVehicle + * @instance + * @returns {Object.} JSON object + */ + TransitVehicle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitVehicle + * @function getTypeUrl + * @memberof google.maps.routing.v2.TransitVehicle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitVehicle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TransitVehicle"; + }; + + /** + * TransitVehicleType enum. + * @name google.maps.routing.v2.TransitVehicle.TransitVehicleType + * @enum {number} + * @property {number} TRANSIT_VEHICLE_TYPE_UNSPECIFIED=0 TRANSIT_VEHICLE_TYPE_UNSPECIFIED value + * @property {number} BUS=1 BUS value + * @property {number} CABLE_CAR=2 CABLE_CAR value + * @property {number} COMMUTER_TRAIN=3 COMMUTER_TRAIN value + * @property {number} FERRY=4 FERRY value + * @property {number} FUNICULAR=5 FUNICULAR value + * @property {number} GONDOLA_LIFT=6 GONDOLA_LIFT value + * @property {number} HEAVY_RAIL=7 HEAVY_RAIL value + * @property {number} HIGH_SPEED_TRAIN=8 HIGH_SPEED_TRAIN value + * @property {number} INTERCITY_BUS=9 INTERCITY_BUS value + * @property {number} LONG_DISTANCE_TRAIN=10 LONG_DISTANCE_TRAIN value + * @property {number} METRO_RAIL=11 METRO_RAIL value + * @property {number} MONORAIL=12 MONORAIL value + * @property {number} OTHER=13 OTHER value + * @property {number} RAIL=14 RAIL value + * @property {number} SHARE_TAXI=15 SHARE_TAXI value + * @property {number} SUBWAY=16 SUBWAY value + * @property {number} TRAM=17 TRAM value + * @property {number} TROLLEYBUS=18 TROLLEYBUS value + */ + TransitVehicle.TransitVehicleType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSIT_VEHICLE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BUS"] = 1; + values[valuesById[2] = "CABLE_CAR"] = 2; + values[valuesById[3] = "COMMUTER_TRAIN"] = 3; + values[valuesById[4] = "FERRY"] = 4; + values[valuesById[5] = "FUNICULAR"] = 5; + values[valuesById[6] = "GONDOLA_LIFT"] = 6; + values[valuesById[7] = "HEAVY_RAIL"] = 7; + values[valuesById[8] = "HIGH_SPEED_TRAIN"] = 8; + values[valuesById[9] = "INTERCITY_BUS"] = 9; + values[valuesById[10] = "LONG_DISTANCE_TRAIN"] = 10; + values[valuesById[11] = "METRO_RAIL"] = 11; + values[valuesById[12] = "MONORAIL"] = 12; + values[valuesById[13] = "OTHER"] = 13; + values[valuesById[14] = "RAIL"] = 14; + values[valuesById[15] = "SHARE_TAXI"] = 15; + values[valuesById[16] = "SUBWAY"] = 16; + values[valuesById[17] = "TRAM"] = 17; + values[valuesById[18] = "TROLLEYBUS"] = 18; + return values; + })(); + + return TransitVehicle; + })(); + + v2.RouteModifiers = (function() { + + /** + * Properties of a RouteModifiers. + * @memberof google.maps.routing.v2 + * @interface IRouteModifiers + * @property {boolean|null} [avoidTolls] RouteModifiers avoidTolls + * @property {boolean|null} [avoidHighways] RouteModifiers avoidHighways + * @property {boolean|null} [avoidFerries] RouteModifiers avoidFerries + * @property {boolean|null} [avoidIndoor] RouteModifiers avoidIndoor + * @property {google.maps.routing.v2.IVehicleInfo|null} [vehicleInfo] RouteModifiers vehicleInfo + * @property {Array.|null} [tollPasses] RouteModifiers tollPasses + */ + + /** + * Constructs a new RouteModifiers. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteModifiers. + * @implements IRouteModifiers + * @constructor + * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set + */ + function RouteModifiers(properties) { + this.tollPasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteModifiers avoidTolls. + * @member {boolean} avoidTolls + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidTolls = false; + + /** + * RouteModifiers avoidHighways. + * @member {boolean} avoidHighways + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidHighways = false; + + /** + * RouteModifiers avoidFerries. + * @member {boolean} avoidFerries + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidFerries = false; + + /** + * RouteModifiers avoidIndoor. + * @member {boolean} avoidIndoor + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidIndoor = false; + + /** + * RouteModifiers vehicleInfo. + * @member {google.maps.routing.v2.IVehicleInfo|null|undefined} vehicleInfo + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.vehicleInfo = null; + + /** + * RouteModifiers tollPasses. + * @member {Array.} tollPasses + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.tollPasses = $util.emptyArray; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers instance + */ + RouteModifiers.create = function create(properties) { + return new RouteModifiers(properties); + }; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.avoidTolls != null && Object.hasOwnProperty.call(message, "avoidTolls")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.avoidTolls); + if (message.avoidHighways != null && Object.hasOwnProperty.call(message, "avoidHighways")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.avoidHighways); + if (message.avoidFerries != null && Object.hasOwnProperty.call(message, "avoidFerries")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.avoidFerries); + if (message.avoidIndoor != null && Object.hasOwnProperty.call(message, "avoidIndoor")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.avoidIndoor); + if (message.vehicleInfo != null && Object.hasOwnProperty.call(message, "vehicleInfo")) + $root.google.maps.routing.v2.VehicleInfo.encode(message.vehicleInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tollPasses != null && message.tollPasses.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.tollPasses.length; ++i) + writer.int32(message.tollPasses[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.avoidTolls = reader.bool(); + break; + } + case 2: { + message.avoidHighways = reader.bool(); + break; + } + case 3: { + message.avoidFerries = reader.bool(); + break; + } + case 4: { + message.avoidIndoor = reader.bool(); + break; + } + case 5: { + message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.tollPasses && message.tollPasses.length)) + message.tollPasses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.tollPasses.push(reader.int32()); + } else + message.tollPasses.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteModifiers message. + * @function verify + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + if (typeof message.avoidTolls !== "boolean") + return "avoidTolls: boolean expected"; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + if (typeof message.avoidHighways !== "boolean") + return "avoidHighways: boolean expected"; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + if (typeof message.avoidFerries !== "boolean") + return "avoidFerries: boolean expected"; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + if (typeof message.avoidIndoor !== "boolean") + return "avoidIndoor: boolean expected"; + if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) { + var error = $root.google.maps.routing.v2.VehicleInfo.verify(message.vehicleInfo); + if (error) + return "vehicleInfo." + error; + } + if (message.tollPasses != null && message.hasOwnProperty("tollPasses")) { + if (!Array.isArray(message.tollPasses)) + return "tollPasses: array expected"; + for (var i = 0; i < message.tollPasses.length; ++i) + switch (message.tollPasses[i]) { + default: + return "tollPasses: enum value[] expected"; + case 0: + case 82: + case 83: + case 2: + case 3: + case 81: + case 7: + case 8: + case 88: + case 9: + case 10: + case 11: + case 84: + case 85: + case 18: + case 19: + case 20: + case 16: + case 78: + case 79: + case 98: + case 99: + case 90: + case 91: + case 93: + case 89: + case 12: + case 13: + case 92: + case 14: + case 21: + case 22: + case 4: + case 86: + case 23: + case 24: + case 25: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 73: + case 72: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 6: + case 34: + case 35: + case 36: + case 94: + case 37: + case 38: + case 95: + case 39: + case 40: + case 41: + case 42: + case 87: + case 43: + case 80: + case 75: + case 74: + case 76: + case 77: + case 44: + case 45: + case 46: + case 47: + case 97: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 96: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 17: + case 1: + case 62: + case 63: + case 100: + case 64: + break; + } + } + return null; + }; + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + */ + RouteModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteModifiers) + return object; + var message = new $root.google.maps.routing.v2.RouteModifiers(); + if (object.avoidTolls != null) + message.avoidTolls = Boolean(object.avoidTolls); + if (object.avoidHighways != null) + message.avoidHighways = Boolean(object.avoidHighways); + if (object.avoidFerries != null) + message.avoidFerries = Boolean(object.avoidFerries); + if (object.avoidIndoor != null) + message.avoidIndoor = Boolean(object.avoidIndoor); + if (object.vehicleInfo != null) { + if (typeof object.vehicleInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteModifiers.vehicleInfo: object expected"); + message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.fromObject(object.vehicleInfo); + } + if (object.tollPasses) { + if (!Array.isArray(object.tollPasses)) + throw TypeError(".google.maps.routing.v2.RouteModifiers.tollPasses: array expected"); + message.tollPasses = []; + for (var i = 0; i < object.tollPasses.length; ++i) + switch (object.tollPasses[i]) { + default: + if (typeof object.tollPasses[i] === "number") { + message.tollPasses[i] = object.tollPasses[i]; + break; + } + case "TOLL_PASS_UNSPECIFIED": + case 0: + message.tollPasses[i] = 0; + break; + case "AU_ETOLL_TAG": + case 82: + message.tollPasses[i] = 82; + break; + case "AU_EWAY_TAG": + case 83: + message.tollPasses[i] = 83; + break; + case "AU_LINKT": + case 2: + message.tollPasses[i] = 2; + break; + case "AR_TELEPASE": + case 3: + message.tollPasses[i] = 3; + break; + case "BR_AUTO_EXPRESO": + case 81: + message.tollPasses[i] = 81; + break; + case "BR_CONECTCAR": + case 7: + message.tollPasses[i] = 7; + break; + case "BR_MOVE_MAIS": + case 8: + message.tollPasses[i] = 8; + break; + case "BR_PASSA_RAPIDO": + case 88: + message.tollPasses[i] = 88; + break; + case "BR_SEM_PARAR": + case 9: + message.tollPasses[i] = 9; + break; + case "BR_TAGGY": + case 10: + message.tollPasses[i] = 10; + break; + case "BR_VELOE": + case 11: + message.tollPasses[i] = 11; + break; + case "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": + case 84: + message.tollPasses[i] = 84; + break; + case "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": + case 85: + message.tollPasses[i] = 85; + break; + case "CA_US_BLUE_WATER_EDGE_PASS": + case 18: + message.tollPasses[i] = 18; + break; + case "CA_US_CONNEXION": + case 19: + message.tollPasses[i] = 19; + break; + case "CA_US_NEXUS_CARD": + case 20: + message.tollPasses[i] = 20; + break; + case "ID_E_TOLL": + case 16: + message.tollPasses[i] = 16; + break; + case "IN_FASTAG": + case 78: + message.tollPasses[i] = 78; + break; + case "IN_LOCAL_HP_PLATE_EXEMPT": + case 79: + message.tollPasses[i] = 79; + break; + case "JP_ETC": + case 98: + message.tollPasses[i] = 98; + break; + case "JP_ETC2": + case 99: + message.tollPasses[i] = 99; + break; + case "MX_IAVE": + case 90: + message.tollPasses[i] = 90; + break; + case "MX_PASE": + case 91: + message.tollPasses[i] = 91; + break; + case "MX_QUICKPASS": + case 93: + message.tollPasses[i] = 93; + break; + case "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": + case 89: + message.tollPasses[i] = 89; + break; + case "MX_TAG_IAVE": + case 12: + message.tollPasses[i] = 12; + break; + case "MX_TAG_TELEVIA": + case 13: + message.tollPasses[i] = 13; + break; + case "MX_TELEVIA": + case 92: + message.tollPasses[i] = 92; + break; + case "MX_VIAPASS": + case 14: + message.tollPasses[i] = 14; + break; + case "US_AL_FREEDOM_PASS": + case 21: + message.tollPasses[i] = 21; + break; + case "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": + case 22: + message.tollPasses[i] = 22; + break; + case "US_CA_FASTRAK": + case 4: + message.tollPasses[i] = 4; + break; + case "US_CA_FASTRAK_CAV_STICKER": + case 86: + message.tollPasses[i] = 86; + break; + case "US_CO_EXPRESSTOLL": + case 23: + message.tollPasses[i] = 23; + break; + case "US_CO_GO_PASS": + case 24: + message.tollPasses[i] = 24; + break; + case "US_DE_EZPASSDE": + case 25: + message.tollPasses[i] = 25; + break; + case "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": + case 65: + message.tollPasses[i] = 65; + break; + case "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": + case 66: + message.tollPasses[i] = 66; + break; + case "US_FL_EPASS": + case 67: + message.tollPasses[i] = 67; + break; + case "US_FL_GIBA_TOLL_PASS": + case 68: + message.tollPasses[i] = 68; + break; + case "US_FL_LEEWAY": + case 69: + message.tollPasses[i] = 69; + break; + case "US_FL_SUNPASS": + case 70: + message.tollPasses[i] = 70; + break; + case "US_FL_SUNPASS_PRO": + case 71: + message.tollPasses[i] = 71; + break; + case "US_IL_EZPASSIL": + case 73: + message.tollPasses[i] = 73; + break; + case "US_IL_IPASS": + case 72: + message.tollPasses[i] = 72; + break; + case "US_IN_EZPASSIN": + case 26: + message.tollPasses[i] = 26; + break; + case "US_KS_BESTPASS_HORIZON": + case 27: + message.tollPasses[i] = 27; + break; + case "US_KS_KTAG": + case 28: + message.tollPasses[i] = 28; + break; + case "US_KS_NATIONALPASS": + case 29: + message.tollPasses[i] = 29; + break; + case "US_KS_PREPASS_ELITEPASS": + case 30: + message.tollPasses[i] = 30; + break; + case "US_KY_RIVERLINK": + case 31: + message.tollPasses[i] = 31; + break; + case "US_LA_GEAUXPASS": + case 32: + message.tollPasses[i] = 32; + break; + case "US_LA_TOLL_TAG": + case 33: + message.tollPasses[i] = 33; + break; + case "US_MA_EZPASSMA": + case 6: + message.tollPasses[i] = 6; + break; + case "US_MD_EZPASSMD": + case 34: + message.tollPasses[i] = 34; + break; + case "US_ME_EZPASSME": + case 35: + message.tollPasses[i] = 35; + break; + case "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": + case 36: + message.tollPasses[i] = 36; + break; + case "US_MI_BCPASS": + case 94: + message.tollPasses[i] = 94; + break; + case "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": + case 37: + message.tollPasses[i] = 37; + break; + case "US_MI_IQ_PROX_CARD": + case 38: + message.tollPasses[i] = 38; + break; + case "US_MI_IQ_TAG": + case 95: + message.tollPasses[i] = 95; + break; + case "US_MI_MACKINAC_BRIDGE_MAC_PASS": + case 39: + message.tollPasses[i] = 39; + break; + case "US_MI_NEXPRESS_TOLL": + case 40: + message.tollPasses[i] = 40; + break; + case "US_MN_EZPASSMN": + case 41: + message.tollPasses[i] = 41; + break; + case "US_NC_EZPASSNC": + case 42: + message.tollPasses[i] = 42; + break; + case "US_NC_PEACH_PASS": + case 87: + message.tollPasses[i] = 87; + break; + case "US_NC_QUICK_PASS": + case 43: + message.tollPasses[i] = 43; + break; + case "US_NH_EZPASSNH": + case 80: + message.tollPasses[i] = 80; + break; + case "US_NJ_DOWNBEACH_EXPRESS_PASS": + case 75: + message.tollPasses[i] = 75; + break; + case "US_NJ_EZPASSNJ": + case 74: + message.tollPasses[i] = 74; + break; + case "US_NY_EXPRESSPASS": + case 76: + message.tollPasses[i] = 76; + break; + case "US_NY_EZPASSNY": + case 77: + message.tollPasses[i] = 77; + break; + case "US_OH_EZPASSOH": + case 44: + message.tollPasses[i] = 44; + break; + case "US_PA_EZPASSPA": + case 45: + message.tollPasses[i] = 45; + break; + case "US_RI_EZPASSRI": + case 46: + message.tollPasses[i] = 46; + break; + case "US_SC_PALPASS": + case 47: + message.tollPasses[i] = 47; + break; + case "US_TX_AVI_TAG": + case 97: + message.tollPasses[i] = 97; + break; + case "US_TX_BANCPASS": + case 48: + message.tollPasses[i] = 48; + break; + case "US_TX_DEL_RIO_PASS": + case 49: + message.tollPasses[i] = 49; + break; + case "US_TX_EFAST_PASS": + case 50: + message.tollPasses[i] = 50; + break; + case "US_TX_EAGLE_PASS_EXPRESS_CARD": + case 51: + message.tollPasses[i] = 51; + break; + case "US_TX_EPTOLL": + case 52: + message.tollPasses[i] = 52; + break; + case "US_TX_EZ_CROSS": + case 53: + message.tollPasses[i] = 53; + break; + case "US_TX_EZTAG": + case 54: + message.tollPasses[i] = 54; + break; + case "US_TX_FUEGO_TAG": + case 96: + message.tollPasses[i] = 96; + break; + case "US_TX_LAREDO_TRADE_TAG": + case 55: + message.tollPasses[i] = 55; + break; + case "US_TX_PLUSPASS": + case 56: + message.tollPasses[i] = 56; + break; + case "US_TX_TOLLTAG": + case 57: + message.tollPasses[i] = 57; + break; + case "US_TX_TXTAG": + case 58: + message.tollPasses[i] = 58; + break; + case "US_TX_XPRESS_CARD": + case 59: + message.tollPasses[i] = 59; + break; + case "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": + case 60: + message.tollPasses[i] = 60; + break; + case "US_VA_EZPASSVA": + case 61: + message.tollPasses[i] = 61; + break; + case "US_WA_BREEZEBY": + case 17: + message.tollPasses[i] = 17; + break; + case "US_WA_GOOD_TO_GO": + case 1: + message.tollPasses[i] = 1; + break; + case "US_WV_EZPASSWV": + case 62: + message.tollPasses[i] = 62; + break; + case "US_WV_MEMORIAL_BRIDGE_TICKETS": + case 63: + message.tollPasses[i] = 63; + break; + case "US_WV_MOV_PASS": + case 100: + message.tollPasses[i] = 100; + break; + case "US_WV_NEWELL_TOLL_BRIDGE_TICKET": + case 64: + message.tollPasses[i] = 64; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.RouteModifiers} message RouteModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tollPasses = []; + if (options.defaults) { + object.avoidTolls = false; + object.avoidHighways = false; + object.avoidFerries = false; + object.avoidIndoor = false; + object.vehicleInfo = null; + } + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + object.avoidTolls = message.avoidTolls; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + object.avoidHighways = message.avoidHighways; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + object.avoidFerries = message.avoidFerries; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + object.avoidIndoor = message.avoidIndoor; + if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) + object.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.toObject(message.vehicleInfo, options); + if (message.tollPasses && message.tollPasses.length) { + object.tollPasses = []; + for (var j = 0; j < message.tollPasses.length; ++j) + object.tollPasses[j] = options.enums === String ? $root.google.maps.routing.v2.TollPass[message.tollPasses[j]] === undefined ? message.tollPasses[j] : $root.google.maps.routing.v2.TollPass[message.tollPasses[j]] : message.tollPasses[j]; + } + return object; + }; + + /** + * Converts this RouteModifiers to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + * @returns {Object.} JSON object + */ + RouteModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteModifiers + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteModifiers"; + }; + + return RouteModifiers; + })(); + + /** + * TollPass enum. + * @name google.maps.routing.v2.TollPass + * @enum {number} + * @property {number} TOLL_PASS_UNSPECIFIED=0 TOLL_PASS_UNSPECIFIED value + * @property {number} AU_ETOLL_TAG=82 AU_ETOLL_TAG value + * @property {number} AU_EWAY_TAG=83 AU_EWAY_TAG value + * @property {number} AU_LINKT=2 AU_LINKT value + * @property {number} AR_TELEPASE=3 AR_TELEPASE value + * @property {number} BR_AUTO_EXPRESO=81 BR_AUTO_EXPRESO value + * @property {number} BR_CONECTCAR=7 BR_CONECTCAR value + * @property {number} BR_MOVE_MAIS=8 BR_MOVE_MAIS value + * @property {number} BR_PASSA_RAPIDO=88 BR_PASSA_RAPIDO value + * @property {number} BR_SEM_PARAR=9 BR_SEM_PARAR value + * @property {number} BR_TAGGY=10 BR_TAGGY value + * @property {number} BR_VELOE=11 BR_VELOE value + * @property {number} CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD=84 CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD value + * @property {number} CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD=85 CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD value + * @property {number} CA_US_BLUE_WATER_EDGE_PASS=18 CA_US_BLUE_WATER_EDGE_PASS value + * @property {number} CA_US_CONNEXION=19 CA_US_CONNEXION value + * @property {number} CA_US_NEXUS_CARD=20 CA_US_NEXUS_CARD value + * @property {number} ID_E_TOLL=16 ID_E_TOLL value + * @property {number} IN_FASTAG=78 IN_FASTAG value + * @property {number} IN_LOCAL_HP_PLATE_EXEMPT=79 IN_LOCAL_HP_PLATE_EXEMPT value + * @property {number} JP_ETC=98 JP_ETC value + * @property {number} JP_ETC2=99 JP_ETC2 value + * @property {number} MX_IAVE=90 MX_IAVE value + * @property {number} MX_PASE=91 MX_PASE value + * @property {number} MX_QUICKPASS=93 MX_QUICKPASS value + * @property {number} MX_SISTEMA_TELEPEAJE_CHIHUAHUA=89 MX_SISTEMA_TELEPEAJE_CHIHUAHUA value + * @property {number} MX_TAG_IAVE=12 MX_TAG_IAVE value + * @property {number} MX_TAG_TELEVIA=13 MX_TAG_TELEVIA value + * @property {number} MX_TELEVIA=92 MX_TELEVIA value + * @property {number} MX_VIAPASS=14 MX_VIAPASS value + * @property {number} US_AL_FREEDOM_PASS=21 US_AL_FREEDOM_PASS value + * @property {number} US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS=22 US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS value + * @property {number} US_CA_FASTRAK=4 US_CA_FASTRAK value + * @property {number} US_CA_FASTRAK_CAV_STICKER=86 US_CA_FASTRAK_CAV_STICKER value + * @property {number} US_CO_EXPRESSTOLL=23 US_CO_EXPRESSTOLL value + * @property {number} US_CO_GO_PASS=24 US_CO_GO_PASS value + * @property {number} US_DE_EZPASSDE=25 US_DE_EZPASSDE value + * @property {number} US_FL_BOB_SIKES_TOLL_BRIDGE_PASS=65 US_FL_BOB_SIKES_TOLL_BRIDGE_PASS value + * @property {number} US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD=66 US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD value + * @property {number} US_FL_EPASS=67 US_FL_EPASS value + * @property {number} US_FL_GIBA_TOLL_PASS=68 US_FL_GIBA_TOLL_PASS value + * @property {number} US_FL_LEEWAY=69 US_FL_LEEWAY value + * @property {number} US_FL_SUNPASS=70 US_FL_SUNPASS value + * @property {number} US_FL_SUNPASS_PRO=71 US_FL_SUNPASS_PRO value + * @property {number} US_IL_EZPASSIL=73 US_IL_EZPASSIL value + * @property {number} US_IL_IPASS=72 US_IL_IPASS value + * @property {number} US_IN_EZPASSIN=26 US_IN_EZPASSIN value + * @property {number} US_KS_BESTPASS_HORIZON=27 US_KS_BESTPASS_HORIZON value + * @property {number} US_KS_KTAG=28 US_KS_KTAG value + * @property {number} US_KS_NATIONALPASS=29 US_KS_NATIONALPASS value + * @property {number} US_KS_PREPASS_ELITEPASS=30 US_KS_PREPASS_ELITEPASS value + * @property {number} US_KY_RIVERLINK=31 US_KY_RIVERLINK value + * @property {number} US_LA_GEAUXPASS=32 US_LA_GEAUXPASS value + * @property {number} US_LA_TOLL_TAG=33 US_LA_TOLL_TAG value + * @property {number} US_MA_EZPASSMA=6 US_MA_EZPASSMA value + * @property {number} US_MD_EZPASSMD=34 US_MD_EZPASSMD value + * @property {number} US_ME_EZPASSME=35 US_ME_EZPASSME value + * @property {number} US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD=36 US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD value + * @property {number} US_MI_BCPASS=94 US_MI_BCPASS value + * @property {number} US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG=37 US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG value + * @property {number} US_MI_IQ_PROX_CARD=38 US_MI_IQ_PROX_CARD value + * @property {number} US_MI_IQ_TAG=95 US_MI_IQ_TAG value + * @property {number} US_MI_MACKINAC_BRIDGE_MAC_PASS=39 US_MI_MACKINAC_BRIDGE_MAC_PASS value + * @property {number} US_MI_NEXPRESS_TOLL=40 US_MI_NEXPRESS_TOLL value + * @property {number} US_MN_EZPASSMN=41 US_MN_EZPASSMN value + * @property {number} US_NC_EZPASSNC=42 US_NC_EZPASSNC value + * @property {number} US_NC_PEACH_PASS=87 US_NC_PEACH_PASS value + * @property {number} US_NC_QUICK_PASS=43 US_NC_QUICK_PASS value + * @property {number} US_NH_EZPASSNH=80 US_NH_EZPASSNH value + * @property {number} US_NJ_DOWNBEACH_EXPRESS_PASS=75 US_NJ_DOWNBEACH_EXPRESS_PASS value + * @property {number} US_NJ_EZPASSNJ=74 US_NJ_EZPASSNJ value + * @property {number} US_NY_EXPRESSPASS=76 US_NY_EXPRESSPASS value + * @property {number} US_NY_EZPASSNY=77 US_NY_EZPASSNY value + * @property {number} US_OH_EZPASSOH=44 US_OH_EZPASSOH value + * @property {number} US_PA_EZPASSPA=45 US_PA_EZPASSPA value + * @property {number} US_RI_EZPASSRI=46 US_RI_EZPASSRI value + * @property {number} US_SC_PALPASS=47 US_SC_PALPASS value + * @property {number} US_TX_AVI_TAG=97 US_TX_AVI_TAG value + * @property {number} US_TX_BANCPASS=48 US_TX_BANCPASS value + * @property {number} US_TX_DEL_RIO_PASS=49 US_TX_DEL_RIO_PASS value + * @property {number} US_TX_EFAST_PASS=50 US_TX_EFAST_PASS value + * @property {number} US_TX_EAGLE_PASS_EXPRESS_CARD=51 US_TX_EAGLE_PASS_EXPRESS_CARD value + * @property {number} US_TX_EPTOLL=52 US_TX_EPTOLL value + * @property {number} US_TX_EZ_CROSS=53 US_TX_EZ_CROSS value + * @property {number} US_TX_EZTAG=54 US_TX_EZTAG value + * @property {number} US_TX_FUEGO_TAG=96 US_TX_FUEGO_TAG value + * @property {number} US_TX_LAREDO_TRADE_TAG=55 US_TX_LAREDO_TRADE_TAG value + * @property {number} US_TX_PLUSPASS=56 US_TX_PLUSPASS value + * @property {number} US_TX_TOLLTAG=57 US_TX_TOLLTAG value + * @property {number} US_TX_TXTAG=58 US_TX_TXTAG value + * @property {number} US_TX_XPRESS_CARD=59 US_TX_XPRESS_CARD value + * @property {number} US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD=60 US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD value + * @property {number} US_VA_EZPASSVA=61 US_VA_EZPASSVA value + * @property {number} US_WA_BREEZEBY=17 US_WA_BREEZEBY value + * @property {number} US_WA_GOOD_TO_GO=1 US_WA_GOOD_TO_GO value + * @property {number} US_WV_EZPASSWV=62 US_WV_EZPASSWV value + * @property {number} US_WV_MEMORIAL_BRIDGE_TICKETS=63 US_WV_MEMORIAL_BRIDGE_TICKETS value + * @property {number} US_WV_MOV_PASS=100 US_WV_MOV_PASS value + * @property {number} US_WV_NEWELL_TOLL_BRIDGE_TICKET=64 US_WV_NEWELL_TOLL_BRIDGE_TICKET value + */ + v2.TollPass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOLL_PASS_UNSPECIFIED"] = 0; + values[valuesById[82] = "AU_ETOLL_TAG"] = 82; + values[valuesById[83] = "AU_EWAY_TAG"] = 83; + values[valuesById[2] = "AU_LINKT"] = 2; + values[valuesById[3] = "AR_TELEPASE"] = 3; + values[valuesById[81] = "BR_AUTO_EXPRESO"] = 81; + values[valuesById[7] = "BR_CONECTCAR"] = 7; + values[valuesById[8] = "BR_MOVE_MAIS"] = 8; + values[valuesById[88] = "BR_PASSA_RAPIDO"] = 88; + values[valuesById[9] = "BR_SEM_PARAR"] = 9; + values[valuesById[10] = "BR_TAGGY"] = 10; + values[valuesById[11] = "BR_VELOE"] = 11; + values[valuesById[84] = "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD"] = 84; + values[valuesById[85] = "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD"] = 85; + values[valuesById[18] = "CA_US_BLUE_WATER_EDGE_PASS"] = 18; + values[valuesById[19] = "CA_US_CONNEXION"] = 19; + values[valuesById[20] = "CA_US_NEXUS_CARD"] = 20; + values[valuesById[16] = "ID_E_TOLL"] = 16; + values[valuesById[78] = "IN_FASTAG"] = 78; + values[valuesById[79] = "IN_LOCAL_HP_PLATE_EXEMPT"] = 79; + values[valuesById[98] = "JP_ETC"] = 98; + values[valuesById[99] = "JP_ETC2"] = 99; + values[valuesById[90] = "MX_IAVE"] = 90; + values[valuesById[91] = "MX_PASE"] = 91; + values[valuesById[93] = "MX_QUICKPASS"] = 93; + values[valuesById[89] = "MX_SISTEMA_TELEPEAJE_CHIHUAHUA"] = 89; + values[valuesById[12] = "MX_TAG_IAVE"] = 12; + values[valuesById[13] = "MX_TAG_TELEVIA"] = 13; + values[valuesById[92] = "MX_TELEVIA"] = 92; + values[valuesById[14] = "MX_VIAPASS"] = 14; + values[valuesById[21] = "US_AL_FREEDOM_PASS"] = 21; + values[valuesById[22] = "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS"] = 22; + values[valuesById[4] = "US_CA_FASTRAK"] = 4; + values[valuesById[86] = "US_CA_FASTRAK_CAV_STICKER"] = 86; + values[valuesById[23] = "US_CO_EXPRESSTOLL"] = 23; + values[valuesById[24] = "US_CO_GO_PASS"] = 24; + values[valuesById[25] = "US_DE_EZPASSDE"] = 25; + values[valuesById[65] = "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS"] = 65; + values[valuesById[66] = "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD"] = 66; + values[valuesById[67] = "US_FL_EPASS"] = 67; + values[valuesById[68] = "US_FL_GIBA_TOLL_PASS"] = 68; + values[valuesById[69] = "US_FL_LEEWAY"] = 69; + values[valuesById[70] = "US_FL_SUNPASS"] = 70; + values[valuesById[71] = "US_FL_SUNPASS_PRO"] = 71; + values[valuesById[73] = "US_IL_EZPASSIL"] = 73; + values[valuesById[72] = "US_IL_IPASS"] = 72; + values[valuesById[26] = "US_IN_EZPASSIN"] = 26; + values[valuesById[27] = "US_KS_BESTPASS_HORIZON"] = 27; + values[valuesById[28] = "US_KS_KTAG"] = 28; + values[valuesById[29] = "US_KS_NATIONALPASS"] = 29; + values[valuesById[30] = "US_KS_PREPASS_ELITEPASS"] = 30; + values[valuesById[31] = "US_KY_RIVERLINK"] = 31; + values[valuesById[32] = "US_LA_GEAUXPASS"] = 32; + values[valuesById[33] = "US_LA_TOLL_TAG"] = 33; + values[valuesById[6] = "US_MA_EZPASSMA"] = 6; + values[valuesById[34] = "US_MD_EZPASSMD"] = 34; + values[valuesById[35] = "US_ME_EZPASSME"] = 35; + values[valuesById[36] = "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD"] = 36; + values[valuesById[94] = "US_MI_BCPASS"] = 94; + values[valuesById[37] = "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG"] = 37; + values[valuesById[38] = "US_MI_IQ_PROX_CARD"] = 38; + values[valuesById[95] = "US_MI_IQ_TAG"] = 95; + values[valuesById[39] = "US_MI_MACKINAC_BRIDGE_MAC_PASS"] = 39; + values[valuesById[40] = "US_MI_NEXPRESS_TOLL"] = 40; + values[valuesById[41] = "US_MN_EZPASSMN"] = 41; + values[valuesById[42] = "US_NC_EZPASSNC"] = 42; + values[valuesById[87] = "US_NC_PEACH_PASS"] = 87; + values[valuesById[43] = "US_NC_QUICK_PASS"] = 43; + values[valuesById[80] = "US_NH_EZPASSNH"] = 80; + values[valuesById[75] = "US_NJ_DOWNBEACH_EXPRESS_PASS"] = 75; + values[valuesById[74] = "US_NJ_EZPASSNJ"] = 74; + values[valuesById[76] = "US_NY_EXPRESSPASS"] = 76; + values[valuesById[77] = "US_NY_EZPASSNY"] = 77; + values[valuesById[44] = "US_OH_EZPASSOH"] = 44; + values[valuesById[45] = "US_PA_EZPASSPA"] = 45; + values[valuesById[46] = "US_RI_EZPASSRI"] = 46; + values[valuesById[47] = "US_SC_PALPASS"] = 47; + values[valuesById[97] = "US_TX_AVI_TAG"] = 97; + values[valuesById[48] = "US_TX_BANCPASS"] = 48; + values[valuesById[49] = "US_TX_DEL_RIO_PASS"] = 49; + values[valuesById[50] = "US_TX_EFAST_PASS"] = 50; + values[valuesById[51] = "US_TX_EAGLE_PASS_EXPRESS_CARD"] = 51; + values[valuesById[52] = "US_TX_EPTOLL"] = 52; + values[valuesById[53] = "US_TX_EZ_CROSS"] = 53; + values[valuesById[54] = "US_TX_EZTAG"] = 54; + values[valuesById[96] = "US_TX_FUEGO_TAG"] = 96; + values[valuesById[55] = "US_TX_LAREDO_TRADE_TAG"] = 55; + values[valuesById[56] = "US_TX_PLUSPASS"] = 56; + values[valuesById[57] = "US_TX_TOLLTAG"] = 57; + values[valuesById[58] = "US_TX_TXTAG"] = 58; + values[valuesById[59] = "US_TX_XPRESS_CARD"] = 59; + values[valuesById[60] = "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD"] = 60; + values[valuesById[61] = "US_VA_EZPASSVA"] = 61; + values[valuesById[17] = "US_WA_BREEZEBY"] = 17; + values[valuesById[1] = "US_WA_GOOD_TO_GO"] = 1; + values[valuesById[62] = "US_WV_EZPASSWV"] = 62; + values[valuesById[63] = "US_WV_MEMORIAL_BRIDGE_TICKETS"] = 63; + values[valuesById[100] = "US_WV_MOV_PASS"] = 100; + values[valuesById[64] = "US_WV_NEWELL_TOLL_BRIDGE_TICKET"] = 64; + return values; + })(); + + v2.VehicleInfo = (function() { + + /** + * Properties of a VehicleInfo. + * @memberof google.maps.routing.v2 + * @interface IVehicleInfo + * @property {google.maps.routing.v2.VehicleEmissionType|null} [emissionType] VehicleInfo emissionType + */ + + /** + * Constructs a new VehicleInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a VehicleInfo. + * @implements IVehicleInfo + * @constructor + * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set + */ + function VehicleInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VehicleInfo emissionType. + * @member {google.maps.routing.v2.VehicleEmissionType} emissionType + * @memberof google.maps.routing.v2.VehicleInfo + * @instance + */ + VehicleInfo.prototype.emissionType = 0; + + /** + * Creates a new VehicleInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo instance + */ + VehicleInfo.create = function create(properties) { + return new VehicleInfo(properties); + }; + + /** + * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emissionType != null && Object.hasOwnProperty.call(message, "emissionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.emissionType); + return writer; + }; + + /** + * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.VehicleInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.emissionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VehicleInfo message. + * @function verify + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VehicleInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emissionType != null && message.hasOwnProperty("emissionType")) + switch (message.emissionType) { + default: + return "emissionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + */ + VehicleInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.VehicleInfo) + return object; + var message = new $root.google.maps.routing.v2.VehicleInfo(); + switch (object.emissionType) { + default: + if (typeof object.emissionType === "number") { + message.emissionType = object.emissionType; + break; + } + break; + case "VEHICLE_EMISSION_TYPE_UNSPECIFIED": + case 0: + message.emissionType = 0; + break; + case "GASOLINE": + case 1: + message.emissionType = 1; + break; + case "ELECTRIC": + case 2: + message.emissionType = 2; + break; + case "HYBRID": + case 3: + message.emissionType = 3; + break; + case "DIESEL": + case 4: + message.emissionType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.VehicleInfo} message VehicleInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VehicleInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.emissionType = options.enums === String ? "VEHICLE_EMISSION_TYPE_UNSPECIFIED" : 0; + if (message.emissionType != null && message.hasOwnProperty("emissionType")) + object.emissionType = options.enums === String ? $root.google.maps.routing.v2.VehicleEmissionType[message.emissionType] === undefined ? message.emissionType : $root.google.maps.routing.v2.VehicleEmissionType[message.emissionType] : message.emissionType; + return object; + }; + + /** + * Converts this VehicleInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.VehicleInfo + * @instance + * @returns {Object.} JSON object + */ + VehicleInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VehicleInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VehicleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.VehicleInfo"; + }; + + return VehicleInfo; + })(); + + /** + * VehicleEmissionType enum. + * @name google.maps.routing.v2.VehicleEmissionType + * @enum {number} + * @property {number} VEHICLE_EMISSION_TYPE_UNSPECIFIED=0 VEHICLE_EMISSION_TYPE_UNSPECIFIED value + * @property {number} GASOLINE=1 GASOLINE value + * @property {number} ELECTRIC=2 ELECTRIC value + * @property {number} HYBRID=3 HYBRID value + * @property {number} DIESEL=4 DIESEL value + */ + v2.VehicleEmissionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VEHICLE_EMISSION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GASOLINE"] = 1; + values[valuesById[2] = "ELECTRIC"] = 2; + values[valuesById[3] = "HYBRID"] = 3; + values[valuesById[4] = "DIESEL"] = 4; + return values; + })(); + + v2.Routes = (function() { + + /** + * Constructs a new Routes service. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Routes + * @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 Routes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Routes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Routes; + + /** + * Creates new Routes service using the specified rpc implementation. + * @function create + * @memberof google.maps.routing.v2.Routes + * @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 {Routes} RPC service. Useful where requests and/or responses are streamed. + */ + Routes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. + * @memberof google.maps.routing.v2.Routes + * @typedef ComputeRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.routing.v2.ComputeRoutesResponse} [response] ComputeRoutesResponse + */ + + /** + * Calls ComputeRoutes. + * @function computeRoutes + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object + * @param {google.maps.routing.v2.Routes.ComputeRoutesCallback} callback Node-style callback called with the error, if any, and ComputeRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.computeRoutes = function computeRoutes(request, callback) { + return this.rpcCall(computeRoutes, $root.google.maps.routing.v2.ComputeRoutesRequest, $root.google.maps.routing.v2.ComputeRoutesResponse, request, callback); + }, "name", { value: "ComputeRoutes" }); + + /** + * Calls ComputeRoutes. + * @function computeRoutes + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. + * @memberof google.maps.routing.v2.Routes + * @typedef ComputeRouteMatrixCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.routing.v2.RouteMatrixElement} [response] RouteMatrixElement + */ + + /** + * Calls ComputeRouteMatrix. + * @function computeRouteMatrix + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object + * @param {google.maps.routing.v2.Routes.ComputeRouteMatrixCallback} callback Node-style callback called with the error, if any, and RouteMatrixElement + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.computeRouteMatrix = function computeRouteMatrix(request, callback) { + return this.rpcCall(computeRouteMatrix, $root.google.maps.routing.v2.ComputeRouteMatrixRequest, $root.google.maps.routing.v2.RouteMatrixElement, request, callback); + }, "name", { value: "ComputeRouteMatrix" }); + + /** + * Calls ComputeRouteMatrix. + * @function computeRouteMatrix + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Routes; + })(); + + v2.ComputeRoutesRequest = (function() { + + /** + * Properties of a ComputeRoutesRequest. + * @memberof google.maps.routing.v2 + * @interface IComputeRoutesRequest + * @property {google.maps.routing.v2.IWaypoint|null} [origin] ComputeRoutesRequest origin + * @property {google.maps.routing.v2.IWaypoint|null} [destination] ComputeRoutesRequest destination + * @property {Array.|null} [intermediates] ComputeRoutesRequest intermediates + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRoutesRequest travelMode + * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRoutesRequest routingPreference + * @property {google.maps.routing.v2.PolylineQuality|null} [polylineQuality] ComputeRoutesRequest polylineQuality + * @property {google.maps.routing.v2.PolylineEncoding|null} [polylineEncoding] ComputeRoutesRequest polylineEncoding + * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRoutesRequest departureTime + * @property {google.protobuf.ITimestamp|null} [arrivalTime] ComputeRoutesRequest arrivalTime + * @property {boolean|null} [computeAlternativeRoutes] ComputeRoutesRequest computeAlternativeRoutes + * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] ComputeRoutesRequest routeModifiers + * @property {string|null} [languageCode] ComputeRoutesRequest languageCode + * @property {string|null} [regionCode] ComputeRoutesRequest regionCode + * @property {google.maps.routing.v2.Units|null} [units] ComputeRoutesRequest units + * @property {boolean|null} [optimizeWaypointOrder] ComputeRoutesRequest optimizeWaypointOrder + * @property {Array.|null} [requestedReferenceRoutes] ComputeRoutesRequest requestedReferenceRoutes + * @property {Array.|null} [extraComputations] ComputeRoutesRequest extraComputations + * @property {google.maps.routing.v2.TrafficModel|null} [trafficModel] ComputeRoutesRequest trafficModel + * @property {google.maps.routing.v2.ITransitPreferences|null} [transitPreferences] ComputeRoutesRequest transitPreferences + */ + + /** + * Constructs a new ComputeRoutesRequest. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRoutesRequest. + * @implements IComputeRoutesRequest + * @constructor + * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set + */ + function ComputeRoutesRequest(properties) { + this.intermediates = []; + this.requestedReferenceRoutes = []; + this.extraComputations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeRoutesRequest origin. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} origin + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.origin = null; + + /** + * ComputeRoutesRequest destination. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} destination + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.destination = null; + + /** + * ComputeRoutesRequest intermediates. + * @member {Array.} intermediates + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.intermediates = $util.emptyArray; + + /** + * ComputeRoutesRequest travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.travelMode = 0; + + /** + * ComputeRoutesRequest routingPreference. + * @member {google.maps.routing.v2.RoutingPreference} routingPreference + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.routingPreference = 0; + + /** + * ComputeRoutesRequest polylineQuality. + * @member {google.maps.routing.v2.PolylineQuality} polylineQuality + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.polylineQuality = 0; + + /** + * ComputeRoutesRequest polylineEncoding. + * @member {google.maps.routing.v2.PolylineEncoding} polylineEncoding + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.polylineEncoding = 0; + + /** + * ComputeRoutesRequest departureTime. + * @member {google.protobuf.ITimestamp|null|undefined} departureTime + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.departureTime = null; + + /** + * ComputeRoutesRequest arrivalTime. + * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.arrivalTime = null; + + /** + * ComputeRoutesRequest computeAlternativeRoutes. + * @member {boolean} computeAlternativeRoutes + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.computeAlternativeRoutes = false; + + /** + * ComputeRoutesRequest routeModifiers. + * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.routeModifiers = null; + + /** + * ComputeRoutesRequest languageCode. + * @member {string} languageCode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.languageCode = ""; + + /** + * ComputeRoutesRequest regionCode. + * @member {string} regionCode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.regionCode = ""; + + /** + * ComputeRoutesRequest units. + * @member {google.maps.routing.v2.Units} units + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.units = 0; + + /** + * ComputeRoutesRequest optimizeWaypointOrder. + * @member {boolean} optimizeWaypointOrder + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.optimizeWaypointOrder = false; + + /** + * ComputeRoutesRequest requestedReferenceRoutes. + * @member {Array.} requestedReferenceRoutes + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.requestedReferenceRoutes = $util.emptyArray; + + /** + * ComputeRoutesRequest extraComputations. + * @member {Array.} extraComputations + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.extraComputations = $util.emptyArray; + + /** + * ComputeRoutesRequest trafficModel. + * @member {google.maps.routing.v2.TrafficModel} trafficModel + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.trafficModel = 0; + + /** + * ComputeRoutesRequest transitPreferences. + * @member {google.maps.routing.v2.ITransitPreferences|null|undefined} transitPreferences + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.transitPreferences = null; + + /** + * Creates a new ComputeRoutesRequest instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest instance + */ + ComputeRoutesRequest.create = function create(properties) { + return new ComputeRoutesRequest(properties); + }; + + /** + * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) + $root.google.maps.routing.v2.Waypoint.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.maps.routing.v2.Waypoint.encode(message.destination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intermediates != null && message.intermediates.length) + for (var i = 0; i < message.intermediates.length; ++i) + $root.google.maps.routing.v2.Waypoint.encode(message.intermediates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.travelMode); + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.routingPreference); + if (message.polylineQuality != null && Object.hasOwnProperty.call(message, "polylineQuality")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.polylineQuality); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.computeAlternativeRoutes != null && Object.hasOwnProperty.call(message, "computeAlternativeRoutes")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeAlternativeRoutes); + if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) + $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.units); + if (message.polylineEncoding != null && Object.hasOwnProperty.call(message, "polylineEncoding")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.polylineEncoding); + if (message.optimizeWaypointOrder != null && Object.hasOwnProperty.call(message, "optimizeWaypointOrder")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.optimizeWaypointOrder); + if (message.requestedReferenceRoutes != null && message.requestedReferenceRoutes.length) { + writer.uint32(/* id 14, wireType 2 =*/114).fork(); + for (var i = 0; i < message.requestedReferenceRoutes.length; ++i) + writer.int32(message.requestedReferenceRoutes[i]); + writer.ldelim(); + } + if (message.extraComputations != null && message.extraComputations.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < message.extraComputations.length; ++i) + writer.int32(message.extraComputations[i]); + writer.ldelim(); + } + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.regionCode); + if (message.trafficModel != null && Object.hasOwnProperty.call(message, "trafficModel")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.trafficModel); + if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) + $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.transitPreferences != null && Object.hasOwnProperty.call(message, "transitPreferences")) + $root.google.maps.routing.v2.TransitPreferences.encode(message.transitPreferences, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.origin = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.destination = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.intermediates && message.intermediates.length)) + message.intermediates = []; + message.intermediates.push($root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32())); + break; + } + case 4: { + message.travelMode = reader.int32(); + break; + } + case 5: { + message.routingPreference = reader.int32(); + break; + } + case 6: { + message.polylineQuality = reader.int32(); + break; + } + case 12: { + message.polylineEncoding = reader.int32(); + break; + } + case 7: { + message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.computeAlternativeRoutes = reader.bool(); + break; + } + case 9: { + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); + break; + } + case 10: { + message.languageCode = reader.string(); + break; + } + case 16: { + message.regionCode = reader.string(); + break; + } + case 11: { + message.units = reader.int32(); + break; + } + case 13: { + message.optimizeWaypointOrder = reader.bool(); + break; + } + case 14: { + if (!(message.requestedReferenceRoutes && message.requestedReferenceRoutes.length)) + message.requestedReferenceRoutes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.requestedReferenceRoutes.push(reader.int32()); + } else + message.requestedReferenceRoutes.push(reader.int32()); + break; + } + case 15: { + if (!(message.extraComputations && message.extraComputations.length)) + message.extraComputations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.extraComputations.push(reader.int32()); + } else + message.extraComputations.push(reader.int32()); + break; + } + case 18: { + message.trafficModel = reader.int32(); + break; + } + case 20: { + message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRoutesRequest message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRoutesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.origin); + if (error) + return "origin." + error; + } + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.intermediates != null && message.hasOwnProperty("intermediates")) { + if (!Array.isArray(message.intermediates)) + return "intermediates: array expected"; + for (var i = 0; i < message.intermediates.length; ++i) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.intermediates[i]); + if (error) + return "intermediates." + error; + } + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + break; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) + switch (message.polylineQuality) { + default: + return "polylineQuality: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) + switch (message.polylineEncoding) { + default: + return "polylineEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); + if (error) + return "arrivalTime." + error; + } + if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) + if (typeof message.computeAlternativeRoutes !== "boolean") + return "computeAlternativeRoutes: boolean expected"; + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { + var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); + if (error) + return "routeModifiers." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + switch (message.units) { + default: + return "units: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.optimizeWaypointOrder != null && message.hasOwnProperty("optimizeWaypointOrder")) + if (typeof message.optimizeWaypointOrder !== "boolean") + return "optimizeWaypointOrder: boolean expected"; + if (message.requestedReferenceRoutes != null && message.hasOwnProperty("requestedReferenceRoutes")) { + if (!Array.isArray(message.requestedReferenceRoutes)) + return "requestedReferenceRoutes: array expected"; + for (var i = 0; i < message.requestedReferenceRoutes.length; ++i) + switch (message.requestedReferenceRoutes[i]) { + default: + return "requestedReferenceRoutes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.extraComputations != null && message.hasOwnProperty("extraComputations")) { + if (!Array.isArray(message.extraComputations)) + return "extraComputations: array expected"; + for (var i = 0; i < message.extraComputations.length; ++i) + switch (message.extraComputations[i]) { + default: + return "extraComputations: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + case 8: + break; + } + } + if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) + switch (message.trafficModel) { + default: + return "trafficModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) { + var error = $root.google.maps.routing.v2.TransitPreferences.verify(message.transitPreferences); + if (error) + return "transitPreferences." + error; + } + return null; + }; + + /** + * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + */ + ComputeRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRoutesRequest) + return object; + var message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); + if (object.origin != null) { + if (typeof object.origin !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.origin: object expected"); + message.origin = $root.google.maps.routing.v2.Waypoint.fromObject(object.origin); + } + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.destination: object expected"); + message.destination = $root.google.maps.routing.v2.Waypoint.fromObject(object.destination); + } + if (object.intermediates) { + if (!Array.isArray(object.intermediates)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: array expected"); + message.intermediates = []; + for (var i = 0; i < object.intermediates.length; ++i) { + if (typeof object.intermediates[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: object expected"); + message.intermediates[i] = $root.google.maps.routing.v2.Waypoint.fromObject(object.intermediates[i]); + } + } + 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 "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + case "TRANSIT": + case 7: + message.travelMode = 7; + break; + } + switch (object.routingPreference) { + default: + if (typeof object.routingPreference === "number") { + message.routingPreference = object.routingPreference; + break; + } + break; + case "ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "TRAFFIC_UNAWARE": + case 1: + message.routingPreference = 1; + break; + case "TRAFFIC_AWARE": + case 2: + message.routingPreference = 2; + break; + case "TRAFFIC_AWARE_OPTIMAL": + case 3: + message.routingPreference = 3; + break; + } + switch (object.polylineQuality) { + default: + if (typeof object.polylineQuality === "number") { + message.polylineQuality = object.polylineQuality; + break; + } + break; + case "POLYLINE_QUALITY_UNSPECIFIED": + case 0: + message.polylineQuality = 0; + break; + case "HIGH_QUALITY": + case 1: + message.polylineQuality = 1; + break; + case "OVERVIEW": + case 2: + message.polylineQuality = 2; + break; + } + switch (object.polylineEncoding) { + default: + if (typeof object.polylineEncoding === "number") { + message.polylineEncoding = object.polylineEncoding; + break; + } + break; + case "POLYLINE_ENCODING_UNSPECIFIED": + case 0: + message.polylineEncoding = 0; + break; + case "ENCODED_POLYLINE": + case 1: + message.polylineEncoding = 1; + break; + case "GEO_JSON_LINESTRING": + case 2: + message.polylineEncoding = 2; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.departureTime: object expected"); + message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); + } + if (object.arrivalTime != null) { + if (typeof object.arrivalTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.arrivalTime: object expected"); + message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); + } + if (object.computeAlternativeRoutes != null) + message.computeAlternativeRoutes = Boolean(object.computeAlternativeRoutes); + if (object.routeModifiers != null) { + if (typeof object.routeModifiers !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.routeModifiers: object expected"); + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.units) { + default: + if (typeof object.units === "number") { + message.units = object.units; + break; + } + break; + case "UNITS_UNSPECIFIED": + case 0: + message.units = 0; + break; + case "METRIC": + case 1: + message.units = 1; + break; + case "IMPERIAL": + case 2: + message.units = 2; + break; + } + if (object.optimizeWaypointOrder != null) + message.optimizeWaypointOrder = Boolean(object.optimizeWaypointOrder); + if (object.requestedReferenceRoutes) { + if (!Array.isArray(object.requestedReferenceRoutes)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.requestedReferenceRoutes: array expected"); + message.requestedReferenceRoutes = []; + for (var i = 0; i < object.requestedReferenceRoutes.length; ++i) + switch (object.requestedReferenceRoutes[i]) { + default: + if (typeof object.requestedReferenceRoutes[i] === "number") { + message.requestedReferenceRoutes[i] = object.requestedReferenceRoutes[i]; + break; + } + case "REFERENCE_ROUTE_UNSPECIFIED": + case 0: + message.requestedReferenceRoutes[i] = 0; + break; + case "FUEL_EFFICIENT": + case 1: + message.requestedReferenceRoutes[i] = 1; + break; + case "SHORTER_DISTANCE": + case 2: + message.requestedReferenceRoutes[i] = 2; + break; + } + } + if (object.extraComputations) { + if (!Array.isArray(object.extraComputations)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.extraComputations: array expected"); + message.extraComputations = []; + for (var i = 0; i < object.extraComputations.length; ++i) + switch (object.extraComputations[i]) { + default: + if (typeof object.extraComputations[i] === "number") { + message.extraComputations[i] = object.extraComputations[i]; + break; + } + case "EXTRA_COMPUTATION_UNSPECIFIED": + case 0: + message.extraComputations[i] = 0; + break; + case "TOLLS": + case 1: + message.extraComputations[i] = 1; + break; + case "FUEL_CONSUMPTION": + case 2: + message.extraComputations[i] = 2; + break; + case "TRAFFIC_ON_POLYLINE": + case 3: + message.extraComputations[i] = 3; + break; + case "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": + case 4: + message.extraComputations[i] = 4; + break; + case "FLYOVER_INFO_ON_POLYLINE": + case 7: + message.extraComputations[i] = 7; + break; + case "NARROW_ROAD_INFO_ON_POLYLINE": + case 8: + message.extraComputations[i] = 8; + break; + } + } + switch (object.trafficModel) { + default: + if (typeof object.trafficModel === "number") { + message.trafficModel = object.trafficModel; + break; + } + break; + case "TRAFFIC_MODEL_UNSPECIFIED": + case 0: + message.trafficModel = 0; + break; + case "BEST_GUESS": + case 1: + message.trafficModel = 1; + break; + case "PESSIMISTIC": + case 2: + message.trafficModel = 2; + break; + case "OPTIMISTIC": + case 3: + message.trafficModel = 3; + break; + } + if (object.transitPreferences != null) { + if (typeof object.transitPreferences !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.transitPreferences: object expected"); + message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.fromObject(object.transitPreferences); + } + return message; + }; + + /** + * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.ComputeRoutesRequest} message ComputeRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intermediates = []; + object.requestedReferenceRoutes = []; + object.extraComputations = []; + } + if (options.defaults) { + object.origin = null; + object.destination = null; + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; + object.polylineQuality = options.enums === String ? "POLYLINE_QUALITY_UNSPECIFIED" : 0; + object.departureTime = null; + object.computeAlternativeRoutes = false; + object.routeModifiers = null; + object.languageCode = ""; + object.units = options.enums === String ? "UNITS_UNSPECIFIED" : 0; + object.polylineEncoding = options.enums === String ? "POLYLINE_ENCODING_UNSPECIFIED" : 0; + object.optimizeWaypointOrder = false; + object.regionCode = ""; + object.trafficModel = options.enums === String ? "TRAFFIC_MODEL_UNSPECIFIED" : 0; + object.arrivalTime = null; + object.transitPreferences = null; + } + if (message.origin != null && message.hasOwnProperty("origin")) + object.origin = $root.google.maps.routing.v2.Waypoint.toObject(message.origin, options); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.maps.routing.v2.Waypoint.toObject(message.destination, options); + if (message.intermediates && message.intermediates.length) { + object.intermediates = []; + for (var j = 0; j < message.intermediates.length; ++j) + object.intermediates[j] = $root.google.maps.routing.v2.Waypoint.toObject(message.intermediates[j], options); + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; + if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) + object.polylineQuality = options.enums === String ? $root.google.maps.routing.v2.PolylineQuality[message.polylineQuality] === undefined ? message.polylineQuality : $root.google.maps.routing.v2.PolylineQuality[message.polylineQuality] : message.polylineQuality; + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); + if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) + object.computeAlternativeRoutes = message.computeAlternativeRoutes; + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) + object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.units != null && message.hasOwnProperty("units")) + object.units = options.enums === String ? $root.google.maps.routing.v2.Units[message.units] === undefined ? message.units : $root.google.maps.routing.v2.Units[message.units] : message.units; + if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) + object.polylineEncoding = options.enums === String ? $root.google.maps.routing.v2.PolylineEncoding[message.polylineEncoding] === undefined ? message.polylineEncoding : $root.google.maps.routing.v2.PolylineEncoding[message.polylineEncoding] : message.polylineEncoding; + if (message.optimizeWaypointOrder != null && message.hasOwnProperty("optimizeWaypointOrder")) + object.optimizeWaypointOrder = message.optimizeWaypointOrder; + if (message.requestedReferenceRoutes && message.requestedReferenceRoutes.length) { + object.requestedReferenceRoutes = []; + for (var j = 0; j < message.requestedReferenceRoutes.length; ++j) + object.requestedReferenceRoutes[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[message.requestedReferenceRoutes[j]] === undefined ? message.requestedReferenceRoutes[j] : $root.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[message.requestedReferenceRoutes[j]] : message.requestedReferenceRoutes[j]; + } + if (message.extraComputations && message.extraComputations.length) { + object.extraComputations = []; + for (var j = 0; j < message.extraComputations.length; ++j) + object.extraComputations[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[message.extraComputations[j]] === undefined ? message.extraComputations[j] : $root.google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[message.extraComputations[j]] : message.extraComputations[j]; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) + object.trafficModel = options.enums === String ? $root.google.maps.routing.v2.TrafficModel[message.trafficModel] === undefined ? message.trafficModel : $root.google.maps.routing.v2.TrafficModel[message.trafficModel] : message.trafficModel; + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) + object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); + if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) + object.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.toObject(message.transitPreferences, options); + return object; + }; + + /** + * Converts this ComputeRoutesRequest to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRoutesRequest + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesRequest"; + }; + + /** + * ReferenceRoute enum. + * @name google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute + * @enum {number} + * @property {number} REFERENCE_ROUTE_UNSPECIFIED=0 REFERENCE_ROUTE_UNSPECIFIED value + * @property {number} FUEL_EFFICIENT=1 FUEL_EFFICIENT value + * @property {number} SHORTER_DISTANCE=2 SHORTER_DISTANCE value + */ + ComputeRoutesRequest.ReferenceRoute = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REFERENCE_ROUTE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FUEL_EFFICIENT"] = 1; + values[valuesById[2] = "SHORTER_DISTANCE"] = 2; + return values; + })(); + + /** + * ExtraComputation enum. + * @name google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation + * @enum {number} + * @property {number} EXTRA_COMPUTATION_UNSPECIFIED=0 EXTRA_COMPUTATION_UNSPECIFIED value + * @property {number} TOLLS=1 TOLLS value + * @property {number} FUEL_CONSUMPTION=2 FUEL_CONSUMPTION value + * @property {number} TRAFFIC_ON_POLYLINE=3 TRAFFIC_ON_POLYLINE value + * @property {number} HTML_FORMATTED_NAVIGATION_INSTRUCTIONS=4 HTML_FORMATTED_NAVIGATION_INSTRUCTIONS value + * @property {number} FLYOVER_INFO_ON_POLYLINE=7 FLYOVER_INFO_ON_POLYLINE value + * @property {number} NARROW_ROAD_INFO_ON_POLYLINE=8 NARROW_ROAD_INFO_ON_POLYLINE value + */ + ComputeRoutesRequest.ExtraComputation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXTRA_COMPUTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOLLS"] = 1; + values[valuesById[2] = "FUEL_CONSUMPTION"] = 2; + values[valuesById[3] = "TRAFFIC_ON_POLYLINE"] = 3; + values[valuesById[4] = "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS"] = 4; + values[valuesById[7] = "FLYOVER_INFO_ON_POLYLINE"] = 7; + values[valuesById[8] = "NARROW_ROAD_INFO_ON_POLYLINE"] = 8; + return values; + })(); + + return ComputeRoutesRequest; + })(); + + v2.ComputeRoutesResponse = (function() { + + /** + * Properties of a ComputeRoutesResponse. + * @memberof google.maps.routing.v2 + * @interface IComputeRoutesResponse + * @property {Array.|null} [routes] ComputeRoutesResponse routes + * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] ComputeRoutesResponse fallbackInfo + * @property {google.maps.routing.v2.IGeocodingResults|null} [geocodingResults] ComputeRoutesResponse geocodingResults + */ + + /** + * Constructs a new ComputeRoutesResponse. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRoutesResponse. + * @implements IComputeRoutesResponse + * @constructor + * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set + */ + function ComputeRoutesResponse(properties) { + this.routes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeRoutesResponse routes. + * @member {Array.} routes + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + */ + ComputeRoutesResponse.prototype.routes = $util.emptyArray; + + /** + * ComputeRoutesResponse fallbackInfo. + * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + */ + ComputeRoutesResponse.prototype.fallbackInfo = null; + + /** + * ComputeRoutesResponse geocodingResults. + * @member {google.maps.routing.v2.IGeocodingResults|null|undefined} geocodingResults + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + */ + ComputeRoutesResponse.prototype.geocodingResults = null; + + /** + * Creates a new ComputeRoutesResponse instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse instance + */ + ComputeRoutesResponse.create = function create(properties) { + return new ComputeRoutesResponse(properties); + }; + + /** + * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesResponse.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.routing.v2.Route.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) + $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.geocodingResults != null && Object.hasOwnProperty.call(message, "geocodingResults")) + $root.google.maps.routing.v2.GeocodingResults.encode(message.geocodingResults, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.routes && message.routes.length)) + message.routes = []; + message.routes.push($root.google.maps.routing.v2.Route.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRoutesResponse message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRoutesResponse.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.routing.v2.Route.verify(message.routes[i]); + if (error) + return "routes." + error; + } + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { + var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); + if (error) + return "fallbackInfo." + error; + } + if (message.geocodingResults != null && message.hasOwnProperty("geocodingResults")) { + var error = $root.google.maps.routing.v2.GeocodingResults.verify(message.geocodingResults); + if (error) + return "geocodingResults." + error; + } + return null; + }; + + /** + * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + */ + ComputeRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRoutesResponse) + return object; + var message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); + if (object.routes) { + if (!Array.isArray(object.routes)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: array expected"); + message.routes = []; + for (var i = 0; i < object.routes.length; ++i) { + if (typeof object.routes[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: object expected"); + message.routes[i] = $root.google.maps.routing.v2.Route.fromObject(object.routes[i]); + } + } + if (object.fallbackInfo != null) { + if (typeof object.fallbackInfo !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.fallbackInfo: object expected"); + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); + } + if (object.geocodingResults != null) { + if (typeof object.geocodingResults !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.geocodingResults: object expected"); + message.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.fromObject(object.geocodingResults); + } + return message; + }; + + /** + * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.ComputeRoutesResponse} message ComputeRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routes = []; + if (options.defaults) { + object.fallbackInfo = null; + object.geocodingResults = null; + } + if (message.routes && message.routes.length) { + object.routes = []; + for (var j = 0; j < message.routes.length; ++j) + object.routes[j] = $root.google.maps.routing.v2.Route.toObject(message.routes[j], options); + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) + object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); + if (message.geocodingResults != null && message.hasOwnProperty("geocodingResults")) + object.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.toObject(message.geocodingResults, options); + return object; + }; + + /** + * Converts this ComputeRoutesResponse to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ComputeRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRoutesResponse + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesResponse"; + }; + + return ComputeRoutesResponse; + })(); + + v2.ComputeRouteMatrixRequest = (function() { + + /** + * Properties of a ComputeRouteMatrixRequest. + * @memberof google.maps.routing.v2 + * @interface IComputeRouteMatrixRequest + * @property {Array.|null} [origins] ComputeRouteMatrixRequest origins + * @property {Array.|null} [destinations] ComputeRouteMatrixRequest destinations + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRouteMatrixRequest travelMode + * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRouteMatrixRequest routingPreference + * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRouteMatrixRequest departureTime + * @property {google.protobuf.ITimestamp|null} [arrivalTime] ComputeRouteMatrixRequest arrivalTime + * @property {string|null} [languageCode] ComputeRouteMatrixRequest languageCode + * @property {string|null} [regionCode] ComputeRouteMatrixRequest regionCode + * @property {google.maps.routing.v2.Units|null} [units] ComputeRouteMatrixRequest units + * @property {Array.|null} [extraComputations] ComputeRouteMatrixRequest extraComputations + * @property {google.maps.routing.v2.TrafficModel|null} [trafficModel] ComputeRouteMatrixRequest trafficModel + * @property {google.maps.routing.v2.ITransitPreferences|null} [transitPreferences] ComputeRouteMatrixRequest transitPreferences + */ + + /** + * Constructs a new ComputeRouteMatrixRequest. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRouteMatrixRequest. + * @implements IComputeRouteMatrixRequest + * @constructor + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set + */ + function ComputeRouteMatrixRequest(properties) { + this.origins = []; + this.destinations = []; + this.extraComputations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeRouteMatrixRequest origins. + * @member {Array.} origins + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.origins = $util.emptyArray; + + /** + * ComputeRouteMatrixRequest destinations. + * @member {Array.} destinations + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.destinations = $util.emptyArray; + + /** + * ComputeRouteMatrixRequest travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.travelMode = 0; + + /** + * ComputeRouteMatrixRequest routingPreference. + * @member {google.maps.routing.v2.RoutingPreference} routingPreference + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.routingPreference = 0; + + /** + * ComputeRouteMatrixRequest departureTime. + * @member {google.protobuf.ITimestamp|null|undefined} departureTime + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.departureTime = null; + + /** + * ComputeRouteMatrixRequest arrivalTime. + * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.arrivalTime = null; + + /** + * ComputeRouteMatrixRequest languageCode. + * @member {string} languageCode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.languageCode = ""; + + /** + * ComputeRouteMatrixRequest regionCode. + * @member {string} regionCode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.regionCode = ""; + + /** + * ComputeRouteMatrixRequest units. + * @member {google.maps.routing.v2.Units} units + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.units = 0; + + /** + * ComputeRouteMatrixRequest extraComputations. + * @member {Array.} extraComputations + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.extraComputations = $util.emptyArray; + + /** + * ComputeRouteMatrixRequest trafficModel. + * @member {google.maps.routing.v2.TrafficModel} trafficModel + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.trafficModel = 0; + + /** + * ComputeRouteMatrixRequest transitPreferences. + * @member {google.maps.routing.v2.ITransitPreferences|null|undefined} transitPreferences + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.transitPreferences = null; + + /** + * Creates a new ComputeRouteMatrixRequest instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest instance + */ + ComputeRouteMatrixRequest.create = function create(properties) { + return new ComputeRouteMatrixRequest(properties); + }; + + /** + * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRouteMatrixRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origins != null && message.origins.length) + for (var i = 0; i < message.origins.length; ++i) + $root.google.maps.routing.v2.RouteMatrixOrigin.encode(message.origins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.maps.routing.v2.RouteMatrixDestination.encode(message.destinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.travelMode); + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.routingPreference); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.units); + if (message.extraComputations != null && message.extraComputations.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.extraComputations.length; ++i) + writer.int32(message.extraComputations[i]); + writer.ldelim(); + } + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.regionCode); + if (message.trafficModel != null && Object.hasOwnProperty.call(message, "trafficModel")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.trafficModel); + if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) + $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.transitPreferences != null && Object.hasOwnProperty.call(message, "transitPreferences")) + $root.google.maps.routing.v2.TransitPreferences.encode(message.transitPreferences, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRouteMatrixRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRouteMatrixRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.origins && message.origins.length)) + message.origins = []; + message.origins.push($root.google.maps.routing.v2.RouteMatrixOrigin.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.maps.routing.v2.RouteMatrixDestination.decode(reader, reader.uint32())); + break; + } + case 3: { + message.travelMode = reader.int32(); + break; + } + case 4: { + message.routingPreference = reader.int32(); + break; + } + case 5: { + message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + case 9: { + message.regionCode = reader.string(); + break; + } + case 7: { + message.units = reader.int32(); + break; + } + case 8: { + if (!(message.extraComputations && message.extraComputations.length)) + message.extraComputations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.extraComputations.push(reader.int32()); + } else + message.extraComputations.push(reader.int32()); + break; + } + case 10: { + message.trafficModel = reader.int32(); + break; + } + case 12: { + message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRouteMatrixRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRouteMatrixRequest message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRouteMatrixRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origins != null && message.hasOwnProperty("origins")) { + if (!Array.isArray(message.origins)) + return "origins: array expected"; + for (var i = 0; i < message.origins.length; ++i) { + var error = $root.google.maps.routing.v2.RouteMatrixOrigin.verify(message.origins[i]); + if (error) + return "origins." + error; + } + } + 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) { + var error = $root.google.maps.routing.v2.RouteMatrixDestination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + break; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); + if (error) + return "arrivalTime." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + switch (message.units) { + default: + return "units: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.extraComputations != null && message.hasOwnProperty("extraComputations")) { + if (!Array.isArray(message.extraComputations)) + return "extraComputations: array expected"; + for (var i = 0; i < message.extraComputations.length; ++i) + switch (message.extraComputations[i]) { + default: + return "extraComputations: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) + switch (message.trafficModel) { + default: + return "trafficModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) { + var error = $root.google.maps.routing.v2.TransitPreferences.verify(message.transitPreferences); + if (error) + return "transitPreferences." + error; + } + return null; + }; + + /** + * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + */ + ComputeRouteMatrixRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRouteMatrixRequest) + return object; + var message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); + if (object.origins) { + if (!Array.isArray(object.origins)) + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: array expected"); + message.origins = []; + for (var i = 0; i < object.origins.length; ++i) { + if (typeof object.origins[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: object expected"); + message.origins[i] = $root.google.maps.routing.v2.RouteMatrixOrigin.fromObject(object.origins[i]); + } + } + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: object expected"); + message.destinations[i] = $root.google.maps.routing.v2.RouteMatrixDestination.fromObject(object.destinations[i]); + } + } + 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 "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + case "TRANSIT": + case 7: + message.travelMode = 7; + break; + } + switch (object.routingPreference) { + default: + if (typeof object.routingPreference === "number") { + message.routingPreference = object.routingPreference; + break; + } + break; + case "ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "TRAFFIC_UNAWARE": + case 1: + message.routingPreference = 1; + break; + case "TRAFFIC_AWARE": + case 2: + message.routingPreference = 2; + break; + case "TRAFFIC_AWARE_OPTIMAL": + case 3: + message.routingPreference = 3; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.departureTime: object expected"); + message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); + } + if (object.arrivalTime != null) { + if (typeof object.arrivalTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.arrivalTime: object expected"); + message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.units) { + default: + if (typeof object.units === "number") { + message.units = object.units; + break; + } + break; + case "UNITS_UNSPECIFIED": + case 0: + message.units = 0; + break; + case "METRIC": + case 1: + message.units = 1; + break; + case "IMPERIAL": + case 2: + message.units = 2; + break; + } + if (object.extraComputations) { + if (!Array.isArray(object.extraComputations)) + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.extraComputations: array expected"); + message.extraComputations = []; + for (var i = 0; i < object.extraComputations.length; ++i) + switch (object.extraComputations[i]) { + default: + if (typeof object.extraComputations[i] === "number") { + message.extraComputations[i] = object.extraComputations[i]; + break; + } + case "EXTRA_COMPUTATION_UNSPECIFIED": + case 0: + message.extraComputations[i] = 0; + break; + case "TOLLS": + case 1: + message.extraComputations[i] = 1; + break; + } + } + switch (object.trafficModel) { + default: + if (typeof object.trafficModel === "number") { + message.trafficModel = object.trafficModel; + break; + } + break; + case "TRAFFIC_MODEL_UNSPECIFIED": + case 0: + message.trafficModel = 0; + break; + case "BEST_GUESS": + case 1: + message.trafficModel = 1; + break; + case "PESSIMISTIC": + case 2: + message.trafficModel = 2; + break; + case "OPTIMISTIC": + case 3: + message.trafficModel = 3; + break; + } + if (object.transitPreferences != null) { + if (typeof object.transitPreferences !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.transitPreferences: object expected"); + message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.fromObject(object.transitPreferences); + } + return message; + }; + + /** + * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.ComputeRouteMatrixRequest} message ComputeRouteMatrixRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRouteMatrixRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.origins = []; + object.destinations = []; + object.extraComputations = []; + } + if (options.defaults) { + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; + object.departureTime = null; + object.languageCode = ""; + object.units = options.enums === String ? "UNITS_UNSPECIFIED" : 0; + object.regionCode = ""; + object.trafficModel = options.enums === String ? "TRAFFIC_MODEL_UNSPECIFIED" : 0; + object.arrivalTime = null; + object.transitPreferences = null; + } + if (message.origins && message.origins.length) { + object.origins = []; + for (var j = 0; j < message.origins.length; ++j) + object.origins[j] = $root.google.maps.routing.v2.RouteMatrixOrigin.toObject(message.origins[j], options); + } + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.maps.routing.v2.RouteMatrixDestination.toObject(message.destinations[j], options); + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.units != null && message.hasOwnProperty("units")) + object.units = options.enums === String ? $root.google.maps.routing.v2.Units[message.units] === undefined ? message.units : $root.google.maps.routing.v2.Units[message.units] : message.units; + if (message.extraComputations && message.extraComputations.length) { + object.extraComputations = []; + for (var j = 0; j < message.extraComputations.length; ++j) + object.extraComputations[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[message.extraComputations[j]] === undefined ? message.extraComputations[j] : $root.google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[message.extraComputations[j]] : message.extraComputations[j]; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) + object.trafficModel = options.enums === String ? $root.google.maps.routing.v2.TrafficModel[message.trafficModel] === undefined ? message.trafficModel : $root.google.maps.routing.v2.TrafficModel[message.trafficModel] : message.trafficModel; + if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) + object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); + if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) + object.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.toObject(message.transitPreferences, options); + return object; + }; + + /** + * Converts this ComputeRouteMatrixRequest to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeRouteMatrixRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRouteMatrixRequest + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRouteMatrixRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRouteMatrixRequest"; + }; + + /** + * ExtraComputation enum. + * @name google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation + * @enum {number} + * @property {number} EXTRA_COMPUTATION_UNSPECIFIED=0 EXTRA_COMPUTATION_UNSPECIFIED value + * @property {number} TOLLS=1 TOLLS value + */ + ComputeRouteMatrixRequest.ExtraComputation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXTRA_COMPUTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOLLS"] = 1; + return values; + })(); + + return ComputeRouteMatrixRequest; + })(); + + v2.RouteMatrixOrigin = (function() { + + /** + * Properties of a RouteMatrixOrigin. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixOrigin + * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixOrigin waypoint + * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] RouteMatrixOrigin routeModifiers + */ + + /** + * Constructs a new RouteMatrixOrigin. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixOrigin. + * @implements IRouteMatrixOrigin + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set + */ + function RouteMatrixOrigin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatrixOrigin waypoint. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + */ + RouteMatrixOrigin.prototype.waypoint = null; + + /** + * RouteMatrixOrigin routeModifiers. + * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + */ + RouteMatrixOrigin.prototype.routeModifiers = null; + + /** + * Creates a new RouteMatrixOrigin instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin instance + */ + RouteMatrixOrigin.create = function create(properties) { + return new RouteMatrixOrigin(properties); + }; + + /** + * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixOrigin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) + $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) + $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixOrigin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixOrigin.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixOrigin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixOrigin message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixOrigin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); + if (error) + return "waypoint." + error; + } + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { + var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); + if (error) + return "routeModifiers." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + */ + RouteMatrixOrigin.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixOrigin) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); + if (object.waypoint != null) { + if (typeof object.waypoint !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.waypoint: object expected"); + message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); + } + if (object.routeModifiers != null) { + if (typeof object.routeModifiers !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.routeModifiers: object expected"); + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.RouteMatrixOrigin} message RouteMatrixOrigin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixOrigin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.waypoint = null; + object.routeModifiers = null; + } + if (message.waypoint != null && message.hasOwnProperty("waypoint")) + object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) + object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); + return object; + }; + + /** + * Converts this RouteMatrixOrigin to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixOrigin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixOrigin + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixOrigin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixOrigin"; + }; + + return RouteMatrixOrigin; + })(); + + v2.RouteMatrixDestination = (function() { + + /** + * Properties of a RouteMatrixDestination. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixDestination + * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixDestination waypoint + */ + + /** + * Constructs a new RouteMatrixDestination. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixDestination. + * @implements IRouteMatrixDestination + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set + */ + function RouteMatrixDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatrixDestination waypoint. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @instance + */ + RouteMatrixDestination.prototype.waypoint = null; + + /** + * Creates a new RouteMatrixDestination instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination instance + */ + RouteMatrixDestination.create = function create(properties) { + return new RouteMatrixDestination(properties); + }; + + /** + * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) + $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixDestination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixDestination message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); + if (error) + return "waypoint." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + */ + RouteMatrixDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixDestination) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixDestination(); + if (object.waypoint != null) { + if (typeof object.waypoint !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixDestination.waypoint: object expected"); + message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.RouteMatrixDestination} message RouteMatrixDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.waypoint = null; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) + object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); + return object; + }; + + /** + * Converts this RouteMatrixDestination to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixDestination + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixDestination"; + }; + + return RouteMatrixDestination; + })(); + + v2.RouteMatrixElement = (function() { + + /** + * Properties of a RouteMatrixElement. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixElement + * @property {number|null} [originIndex] RouteMatrixElement originIndex + * @property {number|null} [destinationIndex] RouteMatrixElement destinationIndex + * @property {google.rpc.IStatus|null} [status] RouteMatrixElement status + * @property {google.maps.routing.v2.RouteMatrixElementCondition|null} [condition] RouteMatrixElement condition + * @property {number|null} [distanceMeters] RouteMatrixElement distanceMeters + * @property {google.protobuf.IDuration|null} [duration] RouteMatrixElement duration + * @property {google.protobuf.IDuration|null} [staticDuration] RouteMatrixElement staticDuration + * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] RouteMatrixElement travelAdvisory + * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] RouteMatrixElement fallbackInfo + * @property {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null} [localizedValues] RouteMatrixElement localizedValues + */ + + /** + * Constructs a new RouteMatrixElement. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixElement. + * @implements IRouteMatrixElement + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set + */ + function RouteMatrixElement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatrixElement originIndex. + * @member {number|null|undefined} originIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.originIndex = null; + + /** + * RouteMatrixElement destinationIndex. + * @member {number|null|undefined} destinationIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.destinationIndex = null; + + /** + * RouteMatrixElement status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.status = null; + + /** + * RouteMatrixElement condition. + * @member {google.maps.routing.v2.RouteMatrixElementCondition} condition + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.condition = 0; + + /** + * RouteMatrixElement distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.distanceMeters = 0; + + /** + * RouteMatrixElement duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.duration = null; + + /** + * RouteMatrixElement staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.staticDuration = null; + + /** + * RouteMatrixElement travelAdvisory. + * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.travelAdvisory = null; + + /** + * RouteMatrixElement fallbackInfo. + * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.fallbackInfo = null; + + /** + * RouteMatrixElement localizedValues. + * @member {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null|undefined} localizedValues + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.localizedValues = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RouteMatrixElement.prototype, "_originIndex", { + get: $util.oneOfGetter($oneOfFields = ["originIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RouteMatrixElement.prototype, "_destinationIndex", { + get: $util.oneOfGetter($oneOfFields = ["destinationIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteMatrixElement instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement instance + */ + RouteMatrixElement.create = function create(properties) { + return new RouteMatrixElement(properties); + }; + + /** + * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixElement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originIndex != null && Object.hasOwnProperty.call(message, "originIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.originIndex); + if (message.destinationIndex != null && Object.hasOwnProperty.call(message, "destinationIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.destinationIndex); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.distanceMeters); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) + $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.condition); + if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) + $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.encode(message.localizedValues, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixElement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.originIndex = reader.int32(); + break; + } + case 2: { + message.destinationIndex = reader.int32(); + break; + } + case 3: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 9: { + message.condition = reader.int32(); + break; + } + case 4: { + message.distanceMeters = reader.int32(); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); + break; + } + case 8: { + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + message.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixElement message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.originIndex != null && message.hasOwnProperty("originIndex")) { + properties._originIndex = 1; + if (!$util.isInteger(message.originIndex)) + return "originIndex: integer expected"; + } + if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { + properties._destinationIndex = 1; + if (!$util.isInteger(message.destinationIndex)) + return "destinationIndex: integer expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { + var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); + if (error) + return "fallbackInfo." + error; + } + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { + var error = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify(message.localizedValues); + if (error) + return "localizedValues." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + */ + RouteMatrixElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixElement) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixElement(); + if (object.originIndex != null) + message.originIndex = object.originIndex | 0; + if (object.destinationIndex != null) + message.destinationIndex = object.destinationIndex | 0; + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; + case "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "ROUTE_EXISTS": + case 1: + message.condition = 1; + break; + case "ROUTE_NOT_FOUND": + case 2: + message.condition = 2; + break; + } + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); + } + if (object.fallbackInfo != null) { + if (typeof object.fallbackInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.fallbackInfo: object expected"); + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); + } + if (object.localizedValues != null) { + if (typeof object.localizedValues !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.localizedValues: object expected"); + message.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.fromObject(object.localizedValues); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.RouteMatrixElement} message RouteMatrixElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.travelAdvisory = null; + object.fallbackInfo = null; + object.condition = options.enums === String ? "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED" : 0; + object.localizedValues = null; + } + if (message.originIndex != null && message.hasOwnProperty("originIndex")) { + object.originIndex = message.originIndex; + if (options.oneofs) + object._originIndex = "originIndex"; + } + if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { + object.destinationIndex = message.destinationIndex; + if (options.oneofs) + object._destinationIndex = "destinationIndex"; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) + object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.maps.routing.v2.RouteMatrixElementCondition[message.condition] === undefined ? message.condition : $root.google.maps.routing.v2.RouteMatrixElementCondition[message.condition] : message.condition; + if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) + object.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.toObject(message.localizedValues, options); + return object; + }; + + /** + * Converts this RouteMatrixElement to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixElement + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixElement"; + }; + + RouteMatrixElement.LocalizedValues = (function() { + + /** + * Properties of a LocalizedValues. + * @memberof google.maps.routing.v2.RouteMatrixElement + * @interface ILocalizedValues + * @property {google.type.ILocalizedText|null} [distance] LocalizedValues distance + * @property {google.type.ILocalizedText|null} [duration] LocalizedValues duration + * @property {google.type.ILocalizedText|null} [staticDuration] LocalizedValues staticDuration + * @property {google.type.ILocalizedText|null} [transitFare] LocalizedValues transitFare + */ + + /** + * Constructs a new LocalizedValues. + * @memberof google.maps.routing.v2.RouteMatrixElement + * @classdesc Represents a LocalizedValues. + * @implements ILocalizedValues + * @constructor + * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues=} [properties] Properties to set + */ + function LocalizedValues(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalizedValues distance. + * @member {google.type.ILocalizedText|null|undefined} distance + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @instance + */ + LocalizedValues.prototype.distance = null; + + /** + * LocalizedValues duration. + * @member {google.type.ILocalizedText|null|undefined} duration + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @instance + */ + LocalizedValues.prototype.duration = null; + + /** + * LocalizedValues staticDuration. + * @member {google.type.ILocalizedText|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @instance + */ + LocalizedValues.prototype.staticDuration = null; + + /** + * LocalizedValues transitFare. + * @member {google.type.ILocalizedText|null|undefined} transitFare + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @instance + */ + LocalizedValues.prototype.transitFare = null; + + /** + * Creates a new LocalizedValues instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues instance + */ + LocalizedValues.create = function create(properties) { + return new LocalizedValues(properties); + }; + + /** + * Encodes the specified LocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues} message LocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) + $root.google.type.LocalizedText.encode(message.transitFare, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues} message LocalizedValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedValues message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedValues.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 2: { + message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + case 4: { + message.transitFare = $root.google.type.LocalizedText.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedValues message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distance != null && message.hasOwnProperty("distance")) { + var error = $root.google.type.LocalizedText.verify(message.distance); + if (error) + return "distance." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.type.LocalizedText.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.type.LocalizedText.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.transitFare != null && message.hasOwnProperty("transitFare")) { + var error = $root.google.type.LocalizedText.verify(message.transitFare); + if (error) + return "transitFare." + error; + } + return null; + }; + + /** + * Creates a LocalizedValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues + */ + LocalizedValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues(); + if (object.distance != null) { + if (typeof object.distance !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.distance: object expected"); + message.distance = $root.google.type.LocalizedText.fromObject(object.distance); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.duration: object expected"); + message.duration = $root.google.type.LocalizedText.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.staticDuration: object expected"); + message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); + } + if (object.transitFare != null) { + if (typeof object.transitFare !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.transitFare: object expected"); + message.transitFare = $root.google.type.LocalizedText.fromObject(object.transitFare); + } + return message; + }; + + /** + * Creates a plain object from a LocalizedValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} message LocalizedValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distance = null; + object.duration = null; + object.staticDuration = null; + object.transitFare = null; + } + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); + if (message.transitFare != null && message.hasOwnProperty("transitFare")) + object.transitFare = $root.google.type.LocalizedText.toObject(message.transitFare, options); + return object; + }; + + /** + * Converts this LocalizedValues to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @instance + * @returns {Object.} JSON object + */ + LocalizedValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalizedValues + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixElement.LocalizedValues"; + }; + + return LocalizedValues; + })(); + + return RouteMatrixElement; + })(); + + /** + * RouteMatrixElementCondition enum. + * @name google.maps.routing.v2.RouteMatrixElementCondition + * @enum {number} + * @property {number} ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED=0 ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED value + * @property {number} ROUTE_EXISTS=1 ROUTE_EXISTS value + * @property {number} ROUTE_NOT_FOUND=2 ROUTE_NOT_FOUND value + */ + v2.RouteMatrixElementCondition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROUTE_EXISTS"] = 1; + values[valuesById[2] = "ROUTE_NOT_FOUND"] = 2; + return values; + })(); + + /** + * RoutingPreference enum. + * @name google.maps.routing.v2.RoutingPreference + * @enum {number} + * @property {number} ROUTING_PREFERENCE_UNSPECIFIED=0 ROUTING_PREFERENCE_UNSPECIFIED value + * @property {number} TRAFFIC_UNAWARE=1 TRAFFIC_UNAWARE value + * @property {number} TRAFFIC_AWARE=2 TRAFFIC_AWARE value + * @property {number} TRAFFIC_AWARE_OPTIMAL=3 TRAFFIC_AWARE_OPTIMAL value + */ + v2.RoutingPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTING_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_UNAWARE"] = 1; + values[valuesById[2] = "TRAFFIC_AWARE"] = 2; + values[valuesById[3] = "TRAFFIC_AWARE_OPTIMAL"] = 3; + return values; + })(); + + /** + * TrafficModel enum. + * @name google.maps.routing.v2.TrafficModel + * @enum {number} + * @property {number} TRAFFIC_MODEL_UNSPECIFIED=0 TRAFFIC_MODEL_UNSPECIFIED value + * @property {number} BEST_GUESS=1 BEST_GUESS value + * @property {number} PESSIMISTIC=2 PESSIMISTIC value + * @property {number} OPTIMISTIC=3 OPTIMISTIC value + */ + v2.TrafficModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAFFIC_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "BEST_GUESS"] = 1; + values[valuesById[2] = "PESSIMISTIC"] = 2; + values[valuesById[3] = "OPTIMISTIC"] = 3; + return values; + })(); + + v2.TransitPreferences = (function() { + + /** + * Properties of a TransitPreferences. + * @memberof google.maps.routing.v2 + * @interface ITransitPreferences + * @property {Array.|null} [allowedTravelModes] TransitPreferences allowedTravelModes + * @property {google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|null} [routingPreference] TransitPreferences routingPreference + */ + + /** + * Constructs a new TransitPreferences. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TransitPreferences. + * @implements ITransitPreferences + * @constructor + * @param {google.maps.routing.v2.ITransitPreferences=} [properties] Properties to set + */ + function TransitPreferences(properties) { + this.allowedTravelModes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransitPreferences allowedTravelModes. + * @member {Array.} allowedTravelModes + * @memberof google.maps.routing.v2.TransitPreferences + * @instance + */ + TransitPreferences.prototype.allowedTravelModes = $util.emptyArray; + + /** + * TransitPreferences routingPreference. + * @member {google.maps.routing.v2.TransitPreferences.TransitRoutingPreference} routingPreference + * @memberof google.maps.routing.v2.TransitPreferences + * @instance + */ + TransitPreferences.prototype.routingPreference = 0; + + /** + * Creates a new TransitPreferences instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {google.maps.routing.v2.ITransitPreferences=} [properties] Properties to set + * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences instance + */ + TransitPreferences.create = function create(properties) { + return new TransitPreferences(properties); + }; + + /** + * Encodes the specified TransitPreferences message. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {google.maps.routing.v2.ITransitPreferences} message TransitPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedTravelModes != null && message.allowedTravelModes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.allowedTravelModes.length; ++i) + writer.int32(message.allowedTravelModes[i]); + writer.ldelim(); + } + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.routingPreference); + return writer; + }; + + /** + * Encodes the specified TransitPreferences message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {google.maps.routing.v2.ITransitPreferences} message TransitPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitPreferences.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedTravelModes && message.allowedTravelModes.length)) + message.allowedTravelModes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedTravelModes.push(reader.int32()); + } else + message.allowedTravelModes.push(reader.int32()); + break; + } + case 2: { + message.routingPreference = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitPreferences message. + * @function verify + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedTravelModes != null && message.hasOwnProperty("allowedTravelModes")) { + if (!Array.isArray(message.allowedTravelModes)) + return "allowedTravelModes: array expected"; + for (var i = 0; i < message.allowedTravelModes.length; ++i) + switch (message.allowedTravelModes[i]) { + default: + return "allowedTravelModes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransitPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences + */ + TransitPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TransitPreferences) + return object; + var message = new $root.google.maps.routing.v2.TransitPreferences(); + if (object.allowedTravelModes) { + if (!Array.isArray(object.allowedTravelModes)) + throw TypeError(".google.maps.routing.v2.TransitPreferences.allowedTravelModes: array expected"); + message.allowedTravelModes = []; + for (var i = 0; i < object.allowedTravelModes.length; ++i) + switch (object.allowedTravelModes[i]) { + default: + if (typeof object.allowedTravelModes[i] === "number") { + message.allowedTravelModes[i] = object.allowedTravelModes[i]; + break; + } + case "TRANSIT_TRAVEL_MODE_UNSPECIFIED": + case 0: + message.allowedTravelModes[i] = 0; + break; + case "BUS": + case 1: + message.allowedTravelModes[i] = 1; + break; + case "SUBWAY": + case 2: + message.allowedTravelModes[i] = 2; + break; + case "TRAIN": + case 3: + message.allowedTravelModes[i] = 3; + break; + case "LIGHT_RAIL": + case 4: + message.allowedTravelModes[i] = 4; + break; + case "RAIL": + case 5: + message.allowedTravelModes[i] = 5; + break; + } + } + switch (object.routingPreference) { + default: + if (typeof object.routingPreference === "number") { + message.routingPreference = object.routingPreference; + break; + } + break; + case "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "LESS_WALKING": + case 1: + message.routingPreference = 1; + break; + case "FEWER_TRANSFERS": + case 2: + message.routingPreference = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransitPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {google.maps.routing.v2.TransitPreferences} message TransitPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedTravelModes = []; + if (options.defaults) + object.routingPreference = options.enums === String ? "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED" : 0; + if (message.allowedTravelModes && message.allowedTravelModes.length) { + object.allowedTravelModes = []; + for (var j = 0; j < message.allowedTravelModes.length; ++j) + object.allowedTravelModes[j] = options.enums === String ? $root.google.maps.routing.v2.TransitPreferences.TransitTravelMode[message.allowedTravelModes[j]] === undefined ? message.allowedTravelModes[j] : $root.google.maps.routing.v2.TransitPreferences.TransitTravelMode[message.allowedTravelModes[j]] : message.allowedTravelModes[j]; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.TransitPreferences.TransitRoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.TransitPreferences.TransitRoutingPreference[message.routingPreference] : message.routingPreference; + return object; + }; + + /** + * Converts this TransitPreferences to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TransitPreferences + * @instance + * @returns {Object.} JSON object + */ + TransitPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitPreferences + * @function getTypeUrl + * @memberof google.maps.routing.v2.TransitPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TransitPreferences"; + }; + + /** + * TransitTravelMode enum. + * @name google.maps.routing.v2.TransitPreferences.TransitTravelMode + * @enum {number} + * @property {number} TRANSIT_TRAVEL_MODE_UNSPECIFIED=0 TRANSIT_TRAVEL_MODE_UNSPECIFIED value + * @property {number} BUS=1 BUS value + * @property {number} SUBWAY=2 SUBWAY value + * @property {number} TRAIN=3 TRAIN value + * @property {number} LIGHT_RAIL=4 LIGHT_RAIL value + * @property {number} RAIL=5 RAIL value + */ + TransitPreferences.TransitTravelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSIT_TRAVEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BUS"] = 1; + values[valuesById[2] = "SUBWAY"] = 2; + values[valuesById[3] = "TRAIN"] = 3; + values[valuesById[4] = "LIGHT_RAIL"] = 4; + values[valuesById[5] = "RAIL"] = 5; + return values; + })(); + + /** + * TransitRoutingPreference enum. + * @name google.maps.routing.v2.TransitPreferences.TransitRoutingPreference + * @enum {number} + * @property {number} TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED=0 TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED value + * @property {number} LESS_WALKING=1 LESS_WALKING value + * @property {number} FEWER_TRANSFERS=2 FEWER_TRANSFERS value + */ + TransitPreferences.TransitRoutingPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LESS_WALKING"] = 1; + values[valuesById[2] = "FEWER_TRANSFERS"] = 2; + return values; + })(); + + return TransitPreferences; + })(); + + /** + * Units enum. + * @name google.maps.routing.v2.Units + * @enum {number} + * @property {number} UNITS_UNSPECIFIED=0 UNITS_UNSPECIFIED value + * @property {number} METRIC=1 METRIC value + * @property {number} IMPERIAL=2 IMPERIAL value + */ + v2.Units = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNITS_UNSPECIFIED"] = 0; + values[valuesById[1] = "METRIC"] = 1; + values[valuesById[2] = "IMPERIAL"] = 2; + return values; + })(); + + v2.Waypoint = (function() { + + /** + * Properties of a Waypoint. + * @memberof google.maps.routing.v2 + * @interface IWaypoint + * @property {google.maps.routing.v2.ILocation|null} [location] Waypoint location + * @property {string|null} [placeId] Waypoint placeId + * @property {string|null} [address] Waypoint address + * @property {string|null} [navigationPointToken] Waypoint navigationPointToken + * @property {boolean|null} [via] Waypoint via + * @property {boolean|null} [vehicleStopover] Waypoint vehicleStopover + * @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad + */ + + /** + * Constructs a new Waypoint. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Waypoint. + * @implements IWaypoint + * @constructor + * @param {google.maps.routing.v2.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.routing.v2.ILocation|null|undefined} location + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.location = null; + + /** + * Waypoint placeId. + * @member {string|null|undefined} placeId + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.placeId = null; + + /** + * Waypoint address. + * @member {string|null|undefined} address + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.address = null; + + /** + * Waypoint navigationPointToken. + * @member {string|null|undefined} navigationPointToken + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.navigationPointToken = null; + + /** + * Waypoint via. + * @member {boolean} via + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.via = false; + + /** + * Waypoint vehicleStopover. + * @member {boolean} vehicleStopover + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.vehicleStopover = false; + + /** + * Waypoint sideOfRoad. + * @member {boolean} sideOfRoad + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.sideOfRoad = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Waypoint locationType. + * @member {"location"|"placeId"|"address"|"navigationPointToken"|undefined} locationType + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Object.defineProperty(Waypoint.prototype, "locationType", { + get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address", "navigationPointToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Waypoint instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.IWaypoint=} [properties] Properties to set + * @returns {google.maps.routing.v2.Waypoint} Waypoint instance + */ + Waypoint.create = function create(properties) { + return new Waypoint(properties); + }; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.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.routing.v2.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.via != null && Object.hasOwnProperty.call(message, "via")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.via); + if (message.vehicleStopover != null && Object.hasOwnProperty.call(message, "vehicleStopover")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.vehicleStopover); + if (message.sideOfRoad != null && Object.hasOwnProperty.call(message, "sideOfRoad")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sideOfRoad); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.address); + if (message.navigationPointToken != null && Object.hasOwnProperty.call(message, "navigationPointToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.navigationPointToken); + return writer; + }; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.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.routing.v2.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Waypoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.placeId = reader.string(); + break; + } + case 7: { + message.address = reader.string(); + break; + } + case 8: { + message.navigationPointToken = reader.string(); + break; + } + case 3: { + message.via = reader.bool(); + break; + } + case 4: { + message.vehicleStopover = reader.bool(); + break; + } + case 5: { + 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.routing.v2.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.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.routing.v2.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.routing.v2.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.address != null && message.hasOwnProperty("address")) { + if (properties.locationType === 1) + return "locationType: multiple values"; + properties.locationType = 1; + if (!$util.isString(message.address)) + return "address: string expected"; + } + if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { + if (properties.locationType === 1) + return "locationType: multiple values"; + properties.locationType = 1; + if (!$util.isString(message.navigationPointToken)) + return "navigationPointToken: string expected"; + } + if (message.via != null && message.hasOwnProperty("via")) + if (typeof message.via !== "boolean") + return "via: boolean expected"; + if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) + if (typeof message.vehicleStopover !== "boolean") + return "vehicleStopover: boolean 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.routing.v2.Waypoint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Waypoint} Waypoint + */ + Waypoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Waypoint) + return object; + var message = new $root.google.maps.routing.v2.Waypoint(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.maps.routing.v2.Waypoint.location: object expected"); + message.location = $root.google.maps.routing.v2.Location.fromObject(object.location); + } + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.address != null) + message.address = String(object.address); + if (object.navigationPointToken != null) + message.navigationPointToken = String(object.navigationPointToken); + if (object.via != null) + message.via = Boolean(object.via); + if (object.vehicleStopover != null) + message.vehicleStopover = Boolean(object.vehicleStopover); + 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.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.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.via = false; + object.vehicleStopover = false; + object.sideOfRoad = false; + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = $root.google.maps.routing.v2.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.via != null && message.hasOwnProperty("via")) + object.via = message.via; + if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) + object.vehicleStopover = message.vehicleStopover; + if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) + object.sideOfRoad = message.sideOfRoad; + if (message.address != null && message.hasOwnProperty("address")) { + object.address = message.address; + if (options.oneofs) + object.locationType = "address"; + } + if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { + object.navigationPointToken = message.navigationPointToken; + if (options.oneofs) + object.locationType = "navigationPointToken"; + } + return object; + }; + + /** + * Converts this Waypoint to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.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.routing.v2.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.routing.v2.Waypoint"; + }; + + return Waypoint; + })(); + + return v2; + })(); + + return routing; + })(); + + return maps; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-maps-routing/protos/protos.json b/owl-bot-staging/google-maps-routing/protos/protos.json new file mode 100644 index 00000000000..6a7aa6dc9b6 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/protos/protos.json @@ -0,0 +1,3546 @@ +{ + "nested": { + "google": { + "nested": { + "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": { + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "geo": { + "nested": { + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/geo/type/viewport;viewport", + "java_multiple_files": true, + "java_outer_classname": "ViewportProto", + "java_package": "com.google.geo.type", + "objc_class_prefix": "GGTP" + }, + "nested": { + "Viewport": { + "fields": { + "low": { + "type": "google.type.LatLng", + "id": 1 + }, + "high": { + "type": "google.type.LatLng", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/money;money", + "java_multiple_files": true, + "java_outer_classname": "MoneyProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + }, + "LocalizedText": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "maps": { + "nested": { + "routing": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Maps.Routing.V2", + "go_package": "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb", + "java_multiple_files": true, + "java_outer_classname": "WaypointProto", + "java_package": "com.google.maps.routing.v2", + "objc_class_prefix": "GMRV2", + "php_namespace": "Google\\Maps\\Routing\\V2", + "ruby_package": "Google::Maps::Routing::V2" + }, + "nested": { + "FallbackInfo": { + "fields": { + "routingMode": { + "type": "FallbackRoutingMode", + "id": 1 + }, + "reason": { + "type": "FallbackReason", + "id": 2 + } + } + }, + "FallbackReason": { + "values": { + "FALLBACK_REASON_UNSPECIFIED": 0, + "SERVER_ERROR": 1, + "LATENCY_EXCEEDED": 2 + } + }, + "FallbackRoutingMode": { + "values": { + "FALLBACK_ROUTING_MODE_UNSPECIFIED": 0, + "FALLBACK_TRAFFIC_UNAWARE": 1, + "FALLBACK_TRAFFIC_AWARE": 2 + } + }, + "GeocodingResults": { + "fields": { + "origin": { + "type": "GeocodedWaypoint", + "id": 1 + }, + "destination": { + "type": "GeocodedWaypoint", + "id": 2 + }, + "intermediates": { + "rule": "repeated", + "type": "GeocodedWaypoint", + "id": 3 + } + } + }, + "GeocodedWaypoint": { + "oneofs": { + "_intermediateWaypointRequestIndex": { + "oneof": [ + "intermediateWaypointRequestIndex" + ] + } + }, + "fields": { + "geocoderStatus": { + "type": "google.rpc.Status", + "id": 1 + }, + "intermediateWaypointRequestIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "type": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "partialMatch": { + "type": "bool", + "id": 4 + }, + "placeId": { + "type": "string", + "id": 5 + } + } + }, + "LocalizedTime": { + "fields": { + "time": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "timeZone": { + "type": "string", + "id": 2 + } + } + }, + "Location": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "heading": { + "type": "google.protobuf.Int32Value", + "id": 2 + } + } + }, + "Maneuver": { + "values": { + "MANEUVER_UNSPECIFIED": 0, + "TURN_SLIGHT_LEFT": 1, + "TURN_SHARP_LEFT": 2, + "UTURN_LEFT": 3, + "TURN_LEFT": 4, + "TURN_SLIGHT_RIGHT": 5, + "TURN_SHARP_RIGHT": 6, + "UTURN_RIGHT": 7, + "TURN_RIGHT": 8, + "STRAIGHT": 9, + "RAMP_LEFT": 10, + "RAMP_RIGHT": 11, + "MERGE": 12, + "FORK_LEFT": 13, + "FORK_RIGHT": 14, + "FERRY": 15, + "FERRY_TRAIN": 16, + "ROUNDABOUT_LEFT": 17, + "ROUNDABOUT_RIGHT": 18, + "DEPART": 19, + "NAME_CHANGE": 20 + } + }, + "NavigationInstruction": { + "fields": { + "maneuver": { + "type": "Maneuver", + "id": 1 + }, + "instructions": { + "type": "string", + "id": 2 + } + } + }, + "Polyline": { + "oneofs": { + "polylineType": { + "oneof": [ + "encodedPolyline", + "geoJsonLinestring" + ] + } + }, + "fields": { + "encodedPolyline": { + "type": "string", + "id": 1 + }, + "geoJsonLinestring": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, + "PolylineQuality": { + "values": { + "POLYLINE_QUALITY_UNSPECIFIED": 0, + "HIGH_QUALITY": 1, + "OVERVIEW": 2 + } + }, + "PolylineEncoding": { + "values": { + "POLYLINE_ENCODING_UNSPECIFIED": 0, + "ENCODED_POLYLINE": 1, + "GEO_JSON_LINESTRING": 2 + } + }, + "PolylineDetails": { + "fields": { + "flyoverInfo": { + "rule": "repeated", + "type": "FlyoverInfo", + "id": 12 + }, + "narrowRoadInfo": { + "rule": "repeated", + "type": "NarrowRoadInfo", + "id": 13 + } + }, + "nested": { + "PolylinePointIndex": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "_endIndex": { + "oneof": [ + "endIndex" + ] + } + }, + "fields": { + "startIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "RoadFeatureState": { + "values": { + "ROAD_FEATURE_STATE_UNSPECIFIED": 0, + "EXISTS": 1, + "DOES_NOT_EXIST": 2 + } + }, + "FlyoverInfo": { + "fields": { + "flyoverPresence": { + "type": "RoadFeatureState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "polylinePointIndex": { + "type": "PolylinePointIndex", + "id": 2 + } + } + }, + "NarrowRoadInfo": { + "fields": { + "narrowRoadPresence": { + "type": "RoadFeatureState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "polylinePointIndex": { + "type": "PolylinePointIndex", + "id": 2 + } + } + } + } + }, + "Route": { + "fields": { + "routeLabels": { + "rule": "repeated", + "type": "RouteLabel", + "id": 13 + }, + "legs": { + "rule": "repeated", + "type": "RouteLeg", + "id": 1 + }, + "distanceMeters": { + "type": "int32", + "id": 2 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "polyline": { + "type": "Polyline", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "viewport": { + "type": "google.geo.type.Viewport", + "id": 8 + }, + "travelAdvisory": { + "type": "RouteTravelAdvisory", + "id": 9 + }, + "optimizedIntermediateWaypointIndex": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "localizedValues": { + "type": "RouteLocalizedValues", + "id": 11 + }, + "routeToken": { + "type": "string", + "id": 12 + }, + "polylineDetails": { + "type": "PolylineDetails", + "id": 14 + } + }, + "nested": { + "RouteLocalizedValues": { + "fields": { + "distance": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "duration": { + "type": "google.type.LocalizedText", + "id": 2 + }, + "staticDuration": { + "type": "google.type.LocalizedText", + "id": 3 + }, + "transitFare": { + "type": "google.type.LocalizedText", + "id": 4 + } + } + } + } + }, + "RouteTravelAdvisory": { + "fields": { + "tollInfo": { + "type": "TollInfo", + "id": 2 + }, + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 3 + }, + "fuelConsumptionMicroliters": { + "type": "int64", + "id": 5 + }, + "routeRestrictionsPartiallyIgnored": { + "type": "bool", + "id": 6 + }, + "transitFare": { + "type": "google.type.Money", + "id": 7 + } + } + }, + "RouteLegTravelAdvisory": { + "fields": { + "tollInfo": { + "type": "TollInfo", + "id": 1 + }, + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 2 + } + } + }, + "RouteLegStepTravelAdvisory": { + "fields": { + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 1 + } + } + }, + "RouteLeg": { + "fields": { + "distanceMeters": { + "type": "int32", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "polyline": { + "type": "Polyline", + "id": 4 + }, + "startLocation": { + "type": "Location", + "id": 5 + }, + "endLocation": { + "type": "Location", + "id": 6 + }, + "steps": { + "rule": "repeated", + "type": "RouteLegStep", + "id": 7 + }, + "travelAdvisory": { + "type": "RouteLegTravelAdvisory", + "id": 8 + }, + "localizedValues": { + "type": "RouteLegLocalizedValues", + "id": 9 + }, + "stepsOverview": { + "type": "StepsOverview", + "id": 10 + } + }, + "nested": { + "RouteLegLocalizedValues": { + "fields": { + "distance": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "duration": { + "type": "google.type.LocalizedText", + "id": 2 + }, + "staticDuration": { + "type": "google.type.LocalizedText", + "id": 3 + } + } + }, + "StepsOverview": { + "fields": { + "multiModalSegments": { + "rule": "repeated", + "type": "MultiModalSegment", + "id": 1 + } + }, + "nested": { + "MultiModalSegment": { + "oneofs": { + "_stepStartIndex": { + "oneof": [ + "stepStartIndex" + ] + }, + "_stepEndIndex": { + "oneof": [ + "stepEndIndex" + ] + } + }, + "fields": { + "stepStartIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "stepEndIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "navigationInstruction": { + "type": "NavigationInstruction", + "id": 3 + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 4 + } + } + } + } + } + } + }, + "RouteLegStep": { + "fields": { + "distanceMeters": { + "type": "int32", + "id": 1 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "polyline": { + "type": "Polyline", + "id": 3 + }, + "startLocation": { + "type": "Location", + "id": 4 + }, + "endLocation": { + "type": "Location", + "id": 5 + }, + "navigationInstruction": { + "type": "NavigationInstruction", + "id": 6 + }, + "travelAdvisory": { + "type": "RouteLegStepTravelAdvisory", + "id": 7 + }, + "localizedValues": { + "type": "RouteLegStepLocalizedValues", + "id": 8 + }, + "transitDetails": { + "type": "RouteLegStepTransitDetails", + "id": 9 + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 10 + } + }, + "nested": { + "RouteLegStepLocalizedValues": { + "fields": { + "distance": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "staticDuration": { + "type": "google.type.LocalizedText", + "id": 3 + } + } + } + } + }, + "RouteLegStepTransitDetails": { + "fields": { + "stopDetails": { + "type": "TransitStopDetails", + "id": 1 + }, + "localizedValues": { + "type": "TransitDetailsLocalizedValues", + "id": 2 + }, + "headsign": { + "type": "string", + "id": 3 + }, + "headway": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "transitLine": { + "type": "TransitLine", + "id": 5 + }, + "stopCount": { + "type": "int32", + "id": 6 + }, + "tripShortText": { + "type": "string", + "id": 7 + } + }, + "nested": { + "TransitStopDetails": { + "fields": { + "arrivalStop": { + "type": "TransitStop", + "id": 1 + }, + "arrivalTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "departureStop": { + "type": "TransitStop", + "id": 3 + }, + "departureTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "TransitDetailsLocalizedValues": { + "fields": { + "arrivalTime": { + "type": "LocalizedTime", + "id": 1 + }, + "departureTime": { + "type": "LocalizedTime", + "id": 2 + } + } + } + } + }, + "RouteLabel": { + "values": { + "ROUTE_LABEL_UNSPECIFIED": 0, + "DEFAULT_ROUTE": 1, + "DEFAULT_ROUTE_ALTERNATE": 2, + "FUEL_EFFICIENT": 3, + "SHORTER_DISTANCE": 4 + } + }, + "RouteTravelMode": { + "values": { + "TRAVEL_MODE_UNSPECIFIED": 0, + "DRIVE": 1, + "BICYCLE": 2, + "WALK": 3, + "TWO_WHEELER": 4, + "TRANSIT": 7 + } + }, + "SpeedReadingInterval": { + "oneofs": { + "_startPolylinePointIndex": { + "oneof": [ + "startPolylinePointIndex" + ] + }, + "_endPolylinePointIndex": { + "oneof": [ + "endPolylinePointIndex" + ] + }, + "speedType": { + "oneof": [ + "speed" + ] + } + }, + "fields": { + "startPolylinePointIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endPolylinePointIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "speed": { + "type": "Speed", + "id": 3 + } + }, + "nested": { + "Speed": { + "values": { + "SPEED_UNSPECIFIED": 0, + "NORMAL": 1, + "SLOW": 2, + "TRAFFIC_JAM": 3 + } + } + } + }, + "TollInfo": { + "fields": { + "estimatedPrice": { + "rule": "repeated", + "type": "google.type.Money", + "id": 1 + } + } + }, + "TransitAgency": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "phoneNumber": { + "type": "string", + "id": 2 + }, + "uri": { + "type": "string", + "id": 3 + } + } + }, + "TransitLine": { + "fields": { + "agencies": { + "rule": "repeated", + "type": "TransitAgency", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "uri": { + "type": "string", + "id": 3 + }, + "color": { + "type": "string", + "id": 4 + }, + "iconUri": { + "type": "string", + "id": 5 + }, + "nameShort": { + "type": "string", + "id": 6 + }, + "textColor": { + "type": "string", + "id": 7 + }, + "vehicle": { + "type": "TransitVehicle", + "id": 8 + } + } + }, + "TransitStop": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "location": { + "type": "Location", + "id": 2 + } + } + }, + "TransitVehicle": { + "fields": { + "name": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "type": { + "type": "TransitVehicleType", + "id": 2 + }, + "iconUri": { + "type": "string", + "id": 3 + }, + "localIconUri": { + "type": "string", + "id": 4 + } + }, + "nested": { + "TransitVehicleType": { + "values": { + "TRANSIT_VEHICLE_TYPE_UNSPECIFIED": 0, + "BUS": 1, + "CABLE_CAR": 2, + "COMMUTER_TRAIN": 3, + "FERRY": 4, + "FUNICULAR": 5, + "GONDOLA_LIFT": 6, + "HEAVY_RAIL": 7, + "HIGH_SPEED_TRAIN": 8, + "INTERCITY_BUS": 9, + "LONG_DISTANCE_TRAIN": 10, + "METRO_RAIL": 11, + "MONORAIL": 12, + "OTHER": 13, + "RAIL": 14, + "SHARE_TAXI": 15, + "SUBWAY": 16, + "TRAM": 17, + "TROLLEYBUS": 18 + } + } + } + }, + "RouteModifiers": { + "fields": { + "avoidTolls": { + "type": "bool", + "id": 1 + }, + "avoidHighways": { + "type": "bool", + "id": 2 + }, + "avoidFerries": { + "type": "bool", + "id": 3 + }, + "avoidIndoor": { + "type": "bool", + "id": 4 + }, + "vehicleInfo": { + "type": "VehicleInfo", + "id": 5 + }, + "tollPasses": { + "rule": "repeated", + "type": "TollPass", + "id": 6 + } + } + }, + "TollPass": { + "valuesOptions": { + "US_MI_IQ_PROX_CARD": { + "deprecated": true + } + }, + "values": { + "TOLL_PASS_UNSPECIFIED": 0, + "AU_ETOLL_TAG": 82, + "AU_EWAY_TAG": 83, + "AU_LINKT": 2, + "AR_TELEPASE": 3, + "BR_AUTO_EXPRESO": 81, + "BR_CONECTCAR": 7, + "BR_MOVE_MAIS": 8, + "BR_PASSA_RAPIDO": 88, + "BR_SEM_PARAR": 9, + "BR_TAGGY": 10, + "BR_VELOE": 11, + "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": 84, + "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": 85, + "CA_US_BLUE_WATER_EDGE_PASS": 18, + "CA_US_CONNEXION": 19, + "CA_US_NEXUS_CARD": 20, + "ID_E_TOLL": 16, + "IN_FASTAG": 78, + "IN_LOCAL_HP_PLATE_EXEMPT": 79, + "JP_ETC": 98, + "JP_ETC2": 99, + "MX_IAVE": 90, + "MX_PASE": 91, + "MX_QUICKPASS": 93, + "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": 89, + "MX_TAG_IAVE": 12, + "MX_TAG_TELEVIA": 13, + "MX_TELEVIA": 92, + "MX_VIAPASS": 14, + "US_AL_FREEDOM_PASS": 21, + "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": 22, + "US_CA_FASTRAK": 4, + "US_CA_FASTRAK_CAV_STICKER": 86, + "US_CO_EXPRESSTOLL": 23, + "US_CO_GO_PASS": 24, + "US_DE_EZPASSDE": 25, + "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": 65, + "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": 66, + "US_FL_EPASS": 67, + "US_FL_GIBA_TOLL_PASS": 68, + "US_FL_LEEWAY": 69, + "US_FL_SUNPASS": 70, + "US_FL_SUNPASS_PRO": 71, + "US_IL_EZPASSIL": 73, + "US_IL_IPASS": 72, + "US_IN_EZPASSIN": 26, + "US_KS_BESTPASS_HORIZON": 27, + "US_KS_KTAG": 28, + "US_KS_NATIONALPASS": 29, + "US_KS_PREPASS_ELITEPASS": 30, + "US_KY_RIVERLINK": 31, + "US_LA_GEAUXPASS": 32, + "US_LA_TOLL_TAG": 33, + "US_MA_EZPASSMA": 6, + "US_MD_EZPASSMD": 34, + "US_ME_EZPASSME": 35, + "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": 36, + "US_MI_BCPASS": 94, + "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": 37, + "US_MI_IQ_PROX_CARD": 38, + "US_MI_IQ_TAG": 95, + "US_MI_MACKINAC_BRIDGE_MAC_PASS": 39, + "US_MI_NEXPRESS_TOLL": 40, + "US_MN_EZPASSMN": 41, + "US_NC_EZPASSNC": 42, + "US_NC_PEACH_PASS": 87, + "US_NC_QUICK_PASS": 43, + "US_NH_EZPASSNH": 80, + "US_NJ_DOWNBEACH_EXPRESS_PASS": 75, + "US_NJ_EZPASSNJ": 74, + "US_NY_EXPRESSPASS": 76, + "US_NY_EZPASSNY": 77, + "US_OH_EZPASSOH": 44, + "US_PA_EZPASSPA": 45, + "US_RI_EZPASSRI": 46, + "US_SC_PALPASS": 47, + "US_TX_AVI_TAG": 97, + "US_TX_BANCPASS": 48, + "US_TX_DEL_RIO_PASS": 49, + "US_TX_EFAST_PASS": 50, + "US_TX_EAGLE_PASS_EXPRESS_CARD": 51, + "US_TX_EPTOLL": 52, + "US_TX_EZ_CROSS": 53, + "US_TX_EZTAG": 54, + "US_TX_FUEGO_TAG": 96, + "US_TX_LAREDO_TRADE_TAG": 55, + "US_TX_PLUSPASS": 56, + "US_TX_TOLLTAG": 57, + "US_TX_TXTAG": 58, + "US_TX_XPRESS_CARD": 59, + "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": 60, + "US_VA_EZPASSVA": 61, + "US_WA_BREEZEBY": 17, + "US_WA_GOOD_TO_GO": 1, + "US_WV_EZPASSWV": 62, + "US_WV_MEMORIAL_BRIDGE_TICKETS": 63, + "US_WV_MOV_PASS": 100, + "US_WV_NEWELL_TOLL_BRIDGE_TICKET": 64 + } + }, + "VehicleInfo": { + "fields": { + "emissionType": { + "type": "VehicleEmissionType", + "id": 2 + } + } + }, + "VehicleEmissionType": { + "values": { + "VEHICLE_EMISSION_TYPE_UNSPECIFIED": 0, + "GASOLINE": 1, + "ELECTRIC": 2, + "HYBRID": 3, + "DIESEL": 4 + } + }, + "Routes": { + "options": { + "(google.api.default_host)": "routes.googleapis.com" + }, + "methods": { + "ComputeRoutes": { + "requestType": "ComputeRoutesRequest", + "responseType": "ComputeRoutesResponse", + "options": { + "(google.api.http).post": "/directions/v2:computeRoutes", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/directions/v2:computeRoutes", + "body": "*" + } + } + ] + }, + "ComputeRouteMatrix": { + "requestType": "ComputeRouteMatrixRequest", + "responseType": "RouteMatrixElement", + "responseStream": true, + "options": { + "(google.api.http).post": "/distanceMatrix/v2:computeRouteMatrix", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/distanceMatrix/v2:computeRouteMatrix", + "body": "*" + } + } + ] + } + } + }, + "ComputeRoutesRequest": { + "fields": { + "origin": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destination": { + "type": "Waypoint", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "intermediates": { + "rule": "repeated", + "type": "Waypoint", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingPreference": { + "type": "RoutingPreference", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "polylineQuality": { + "type": "PolylineQuality", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "polylineEncoding": { + "type": "PolylineEncoding", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "departureTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "arrivalTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeAlternativeRoutes": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routeModifiers": { + "type": "RouteModifiers", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "regionCode": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "units": { + "type": "Units", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "optimizeWaypointOrder": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestedReferenceRoutes": { + "rule": "repeated", + "type": "ReferenceRoute", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "extraComputations": { + "rule": "repeated", + "type": "ExtraComputation", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trafficModel": { + "type": "TrafficModel", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transitPreferences": { + "type": "TransitPreferences", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ReferenceRoute": { + "values": { + "REFERENCE_ROUTE_UNSPECIFIED": 0, + "FUEL_EFFICIENT": 1, + "SHORTER_DISTANCE": 2 + } + }, + "ExtraComputation": { + "values": { + "EXTRA_COMPUTATION_UNSPECIFIED": 0, + "TOLLS": 1, + "FUEL_CONSUMPTION": 2, + "TRAFFIC_ON_POLYLINE": 3, + "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": 4, + "FLYOVER_INFO_ON_POLYLINE": 7, + "NARROW_ROAD_INFO_ON_POLYLINE": 8 + } + } + } + }, + "ComputeRoutesResponse": { + "fields": { + "routes": { + "rule": "repeated", + "type": "Route", + "id": 1 + }, + "fallbackInfo": { + "type": "FallbackInfo", + "id": 2 + }, + "geocodingResults": { + "type": "GeocodingResults", + "id": 3 + } + } + }, + "ComputeRouteMatrixRequest": { + "fields": { + "origins": { + "rule": "repeated", + "type": "RouteMatrixOrigin", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destinations": { + "rule": "repeated", + "type": "RouteMatrixDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingPreference": { + "type": "RoutingPreference", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "departureTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "arrivalTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "regionCode": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "units": { + "type": "Units", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "extraComputations": { + "rule": "repeated", + "type": "ExtraComputation", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trafficModel": { + "type": "TrafficModel", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transitPreferences": { + "type": "TransitPreferences", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExtraComputation": { + "values": { + "EXTRA_COMPUTATION_UNSPECIFIED": 0, + "TOLLS": 1 + } + } + } + }, + "RouteMatrixOrigin": { + "fields": { + "waypoint": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routeModifiers": { + "type": "RouteModifiers", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteMatrixDestination": { + "fields": { + "waypoint": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteMatrixElement": { + "oneofs": { + "_originIndex": { + "oneof": [ + "originIndex" + ] + }, + "_destinationIndex": { + "oneof": [ + "destinationIndex" + ] + } + }, + "fields": { + "originIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "destinationIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "google.rpc.Status", + "id": 3 + }, + "condition": { + "type": "RouteMatrixElementCondition", + "id": 9 + }, + "distanceMeters": { + "type": "int32", + "id": 4 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "travelAdvisory": { + "type": "RouteTravelAdvisory", + "id": 7 + }, + "fallbackInfo": { + "type": "FallbackInfo", + "id": 8 + }, + "localizedValues": { + "type": "LocalizedValues", + "id": 10 + } + }, + "nested": { + "LocalizedValues": { + "fields": { + "distance": { + "type": "google.type.LocalizedText", + "id": 1 + }, + "duration": { + "type": "google.type.LocalizedText", + "id": 2 + }, + "staticDuration": { + "type": "google.type.LocalizedText", + "id": 3 + }, + "transitFare": { + "type": "google.type.LocalizedText", + "id": 4 + } + } + } + } + }, + "RouteMatrixElementCondition": { + "values": { + "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": 0, + "ROUTE_EXISTS": 1, + "ROUTE_NOT_FOUND": 2 + } + }, + "RoutingPreference": { + "values": { + "ROUTING_PREFERENCE_UNSPECIFIED": 0, + "TRAFFIC_UNAWARE": 1, + "TRAFFIC_AWARE": 2, + "TRAFFIC_AWARE_OPTIMAL": 3 + } + }, + "TrafficModel": { + "values": { + "TRAFFIC_MODEL_UNSPECIFIED": 0, + "BEST_GUESS": 1, + "PESSIMISTIC": 2, + "OPTIMISTIC": 3 + } + }, + "TransitPreferences": { + "fields": { + "allowedTravelModes": { + "rule": "repeated", + "type": "TransitTravelMode", + "id": 1 + }, + "routingPreference": { + "type": "TransitRoutingPreference", + "id": 2 + } + }, + "nested": { + "TransitTravelMode": { + "values": { + "TRANSIT_TRAVEL_MODE_UNSPECIFIED": 0, + "BUS": 1, + "SUBWAY": 2, + "TRAIN": 3, + "LIGHT_RAIL": 4, + "RAIL": 5 + } + }, + "TransitRoutingPreference": { + "values": { + "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED": 0, + "LESS_WALKING": 1, + "FEWER_TRANSFERS": 2 + } + } + } + }, + "Units": { + "values": { + "UNITS_UNSPECIFIED": 0, + "METRIC": 1, + "IMPERIAL": 2 + } + }, + "Waypoint": { + "oneofs": { + "locationType": { + "oneof": [ + "location", + "placeId", + "address", + "navigationPointToken" + ] + } + }, + "fields": { + "location": { + "type": "Location", + "id": 1 + }, + "placeId": { + "type": "string", + "id": 2 + }, + "address": { + "type": "string", + "id": 7 + }, + "navigationPointToken": { + "type": "string", + "id": 8 + }, + "via": { + "type": "bool", + "id": 3 + }, + "vehicleStopover": { + "type": "bool", + "id": 4 + }, + "sideOfRoad": { + "type": "bool", + "id": 5 + } + } + } + } + } + } + } + } + }, + "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 + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js new file mode 100644 index 00000000000..487027070e2 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js @@ -0,0 +1,154 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(origins, destinations) { + // [START routes_v2_generated_Routes_ComputeRouteMatrix_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. Array of origins, which determines the rows of the response + * matrix. Several size restrictions apply to the cardinality of origins and + * destinations: + * * The sum of the number of origins + the number of destinations specified + * as either `place_id` or `address` must be no greater than 50. + * * The product of number of origins × number of destinations must be no + * greater than 625 in any case. + * * The product of the number of origins × number of destinations must be no + * greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + * * The product of the number of origins × number of destinations must be no + * greater than 100 if travel_mode is set to `TRANSIT`. + */ + // const origins = [1,2,3,4] + /** + * Required. Array of destinations, which determines the columns of the + * response matrix. + */ + // const destinations = [1,2,3,4] + /** + * Optional. Specifies the mode of transportation. + */ + // const travelMode = {} + /** + * Optional. Specifies how to compute the route. The server attempts to use + * the selected routing preference to compute the route. If the routing + * preference results in an error or an extra long latency, an error is + * returned. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + */ + // const routingPreference = {} + /** + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. + * NOTE: You can only specify a `departure_time` in the past when + * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to + * `TRANSIT`. + */ + // const departureTime = {} + /** + * Optional. The arrival time. + * NOTE: Can only be set when + * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to + * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + * not both. + */ + // const arrivalTime = {} + /** + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see Unicode Locale + * Identifier (http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + * See Language + * Support (https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the first origin. + */ + // const languageCode = 'abc123' + /** + * Optional. The region code, specified as a ccTLD ("top-level domain") + * two-character value. For more information see Country code top-level + * domains (https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + */ + // const regionCode = 'abc123' + /** + * Optional. Specifies the units of measure for the display fields. + */ + // const units = {} + /** + * Optional. A list of extra computations which may be used to complete the + * request. Note: These extra computations may return extra fields on the + * response. These extra fields must also be specified in the field mask to be + * returned in the response. + */ + // const extraComputations = [1,2,3,4] + /** + * Optional. Specifies the assumptions to use when calculating time in + * traffic. This setting affects the value returned in the duration field in + * the RouteMatrixElement google.maps.routing.v2.RouteMatrixElement which + * contains the predicted time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set + * RoutingPreference google.maps.routing.v2.RoutingPreference to + * `TRAFFIC_AWARE_OPTIMAL` and + * RouteTravelMode google.maps.routing.v2.RouteTravelMode to `DRIVE`. + * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + * specified. + */ + // const trafficModel = {} + /** + * Optional. Specifies preferences that influence the route returned for + * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + * RouteTravelMode google.maps.routing.v2.RouteTravelMode is set to + * `TRANSIT`. + */ + // const transitPreferences = {} + + // Imports the Routing library + const {RoutesClient} = require('@googlemaps/routing').v2; + + // Instantiates a client + const routingClient = new RoutesClient(); + + async function callComputeRouteMatrix() { + // Construct request + const request = { + origins, + destinations, + }; + + // Run request + const stream = await routingClient.computeRouteMatrix(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callComputeRouteMatrix(); + // [END routes_v2_generated_Routes_ComputeRouteMatrix_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js new file mode 100644 index 00000000000..32acd7be8f8 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js @@ -0,0 +1,199 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(origin, destination) { + // [START routes_v2_generated_Routes_ComputeRoutes_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. Origin waypoint. + */ + // const origin = {} + /** + * Required. Destination waypoint. + */ + // const destination = {} + /** + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + */ + // const intermediates = [1,2,3,4] + /** + * Optional. Specifies the mode of transportation. + */ + // const travelMode = {} + /** + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. You can specify this option only when the + * `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + */ + // const routingPreference = {} + /** + * Optional. Specifies your preference for the quality of the polyline. + */ + // const polylineQuality = {} + /** + * Optional. Specifies the preferred encoding for the polyline. + */ + // const polylineEncoding = {} + /** + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. + * NOTE: You can only specify a `departure_time` in the past when + * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to + * `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 + * days in the future. + */ + // const departureTime = {} + /** + * Optional. The arrival time. + * NOTE: This field is ignored when requests specify a + * RouteTravelMode google.maps.routing.v2.RouteTravelMode other than + * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + * not both. Transit trips are available for up to 7 days in the past or 100 + * days in the future. + */ + // const arrivalTime = {} + /** + * Optional. Specifies whether to calculate alternate routes in addition to + * the route. No alternative routes are returned for requests that have + * intermediate waypoints. + */ + // const computeAlternativeRoutes = true + /** + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + */ + // const routeModifiers = {} + /** + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see Unicode Locale + * Identifier (http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + * See Language + * Support (https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + */ + // const languageCode = 'abc123' + /** + * Optional. The region code, specified as a ccTLD ("top-level domain") + * two-character value. For more information see Country code top-level + * domains (https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + */ + // const regionCode = 'abc123' + /** + * Optional. Specifies the units of measure for the display fields. These + * fields include the `instruction` field in + * `NavigationInstruction` google.maps.routing.v2.NavigationInstruction. + * The units of measure used for the route, leg, step distance, and duration + * are not affected by this value. If you don't provide this value, then the + * display units are inferred from the location of the first origin. + */ + // const units = {} + /** + * Optional. If set to true, the service attempts to minimize the overall cost + * of the route by re-ordering the specified intermediate waypoints. The + * request fails if any of the intermediate waypoints is a `via` waypoint. Use + * `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to + * find the new ordering. + * If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is + * not requested in the `X-Goog-FieldMask` header, the request fails. + * If `optimize_waypoint_order` is set to false, + * `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be + * empty. + */ + // const optimizeWaypointOrder = true + /** + * Optional. Specifies what reference routes to calculate as part of the + * request in addition to the default route. A reference route is a route with + * a different route calculation objective than the default route. For example + * a `FUEL_EFFICIENT` reference route calculation takes into account various + * parameters that would generate an optimal fuel efficient route. When using + * this feature, look for + * `route_labels` google.maps.routing.v2.Route.route_labels on the + * resulting routes. + */ + // const requestedReferenceRoutes = [1,2,3,4] + /** + * Optional. A list of extra computations which may be used to complete the + * request. Note: These extra computations may return extra fields on the + * response. These extra fields must also be specified in the field mask to be + * returned in the response. + */ + // const extraComputations = [1,2,3,4] + /** + * Optional. Specifies the assumptions to use when calculating time in + * traffic. This setting affects the value returned in the duration field in + * the + * `Route` google.maps.routing.v2.Route and + * `RouteLeg` google.maps.routing.v2.RouteLeg which contains the predicted + * time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set + * `RoutingPreference` google.maps.routing.v2.RoutingPreference to + * `TRAFFIC_AWARE_OPTIMAL` and + * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode to `DRIVE`. + * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + * specified. + */ + // const trafficModel = {} + /** + * Optional. Specifies preferences that influence the route returned for + * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to + * `TRANSIT`. + */ + // const transitPreferences = {} + + // Imports the Routing library + const {RoutesClient} = require('@googlemaps/routing').v2; + + // Instantiates a client + const routingClient = new RoutesClient(); + + async function callComputeRoutes() { + // Construct request + const request = { + origin, + destination, + }; + + // Run request + const response = await routingClient.computeRoutes(request); + console.log(response); + } + + callComputeRoutes(); + // [END routes_v2_generated_Routes_ComputeRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json b/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json new file mode 100644 index 00000000000..fe1c5b047d2 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json @@ -0,0 +1,211 @@ +{ + "clientLibrary": { + "name": "nodejs-routing", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.maps.routing.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "routes_v2_generated_Routes_ComputeRoutes_async", + "title": "Routes computeRoutes Sample", + "origin": "API_DEFINITION", + "description": " Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using URL parameter `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters)). The value is a comma separated list of field paths. See detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of Route-level duration, distance, and polyline (an example production setup): `X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` Google discourage the use of the wildcard (`*`) response field mask, or specifying the field mask at the top level (`routes`), because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", + "canonical": true, + "file": "routes.compute_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 191, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeRoutes", + "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", + "async": true, + "parameters": [ + { + "name": "origin", + "type": ".google.maps.routing.v2.Waypoint" + }, + { + "name": "destination", + "type": ".google.maps.routing.v2.Waypoint" + }, + { + "name": "intermediates", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "travel_mode", + "type": ".google.maps.routing.v2.RouteTravelMode" + }, + { + "name": "routing_preference", + "type": ".google.maps.routing.v2.RoutingPreference" + }, + { + "name": "polyline_quality", + "type": ".google.maps.routing.v2.PolylineQuality" + }, + { + "name": "polyline_encoding", + "type": ".google.maps.routing.v2.PolylineEncoding" + }, + { + "name": "departure_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "arrival_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compute_alternative_routes", + "type": "TYPE_BOOL" + }, + { + "name": "route_modifiers", + "type": ".google.maps.routing.v2.RouteModifiers" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "region_code", + "type": "TYPE_STRING" + }, + { + "name": "units", + "type": ".google.maps.routing.v2.Units" + }, + { + "name": "optimize_waypoint_order", + "type": "TYPE_BOOL" + }, + { + "name": "requested_reference_routes", + "type": "TYPE_ENUM[]" + }, + { + "name": "extra_computations", + "type": "TYPE_ENUM[]" + }, + { + "name": "traffic_model", + "type": ".google.maps.routing.v2.TrafficModel" + }, + { + "name": "transit_preferences", + "type": ".google.maps.routing.v2.TransitPreferences" + } + ], + "resultType": ".google.maps.routing.v2.ComputeRoutesResponse", + "client": { + "shortName": "RoutesClient", + "fullName": "google.maps.routing.v2.RoutesClient" + }, + "method": { + "shortName": "ComputeRoutes", + "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", + "service": { + "shortName": "Routes", + "fullName": "google.maps.routing.v2.Routes" + } + } + } + }, + { + "regionTag": "routes_v2_generated_Routes_ComputeRouteMatrix_async", + "title": "Routes computeRouteMatrix Sample", + "origin": "API_DEFINITION", + "description": " Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using the URL parameter `$fields` or `fields`, or by using the HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters)). The value is a comma separated list of field paths. See this detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of route durations, distances, element status, condition, and element indices (an example production setup): `X-Goog-FieldMask: originIndex,destinationIndex,status,condition,distanceMeters,duration` It is critical that you include `status` in your field mask as otherwise all messages will appear to be OK. Google discourages the use of the wildcard (`*`) response field mask, because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", + "canonical": true, + "file": "routes.compute_route_matrix.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 146, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeRouteMatrix", + "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", + "async": true, + "parameters": [ + { + "name": "origins", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "destinations", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "travel_mode", + "type": ".google.maps.routing.v2.RouteTravelMode" + }, + { + "name": "routing_preference", + "type": ".google.maps.routing.v2.RoutingPreference" + }, + { + "name": "departure_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "arrival_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "region_code", + "type": "TYPE_STRING" + }, + { + "name": "units", + "type": ".google.maps.routing.v2.Units" + }, + { + "name": "extra_computations", + "type": "TYPE_ENUM[]" + }, + { + "name": "traffic_model", + "type": ".google.maps.routing.v2.TrafficModel" + }, + { + "name": "transit_preferences", + "type": ".google.maps.routing.v2.TransitPreferences" + } + ], + "resultType": ".google.maps.routing.v2.RouteMatrixElement", + "client": { + "shortName": "RoutesClient", + "fullName": "google.maps.routing.v2.RoutesClient" + }, + "method": { + "shortName": "ComputeRouteMatrix", + "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", + "service": { + "shortName": "Routes", + "fullName": "google.maps.routing.v2.Routes" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-maps-routing/src/index.ts b/owl-bot-staging/google-maps-routing/src/index.ts new file mode 100644 index 00000000000..fd8c3e11639 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const RoutesClient = v2.RoutesClient; +type RoutesClient = v2.RoutesClient; + +export {v2, RoutesClient}; +export default {v2, RoutesClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json b/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..46b4f4a8b5a --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.maps.routing.v2", + "libraryPackage": "@googlemaps/routing", + "services": { + "Routes": { + "clients": { + "grpc": { + "libraryClient": "RoutesClient", + "rpcs": { + "ComputeRoutes": { + "methods": [ + "computeRoutes" + ] + }, + "ComputeRouteMatrix": { + "methods": [ + "computeRouteMatrix" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RoutesClient", + "rpcs": { + "ComputeRoutes": { + "methods": [ + "computeRoutes" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-maps-routing/src/v2/index.ts b/owl-bot-staging/google-maps-routing/src/v2/index.ts new file mode 100644 index 00000000000..58450e37846 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {RoutesClient} from './routes_client'; diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts b/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts new file mode 100644 index 00000000000..e966e0737d0 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts @@ -0,0 +1,706 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/routes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './routes_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Routes API. + * @class + * @memberof v2 + */ +export class RoutesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('routing'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + routesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RoutesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RoutesClient({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 RoutesClient; + 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 = 'routes.' + 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); + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + computeRouteMatrix: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.maps.routing.v2.Routes', 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.routesStub) { + return this.routesStub; + } + + // Put together the "service stub" for + // google.maps.routing.v2.Routes. + this.routesStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.maps.routing.v2.Routes') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.maps.routing.v2.Routes, + 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 routesStubMethods = + ['computeRoutes', 'computeRouteMatrix']; + for (const methodName of routesStubMethods) { + const callPromise = this.routesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + 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.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.routesStub; + } + + /** + * 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 'routes.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 'routes.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 []; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Returns the primary route along with optional alternate routes, given a set + * of terminal and intermediate waypoints. + * + * **NOTE:** This method requires that you specify a response field mask in + * the input. You can provide the response field mask by using URL parameter + * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` + * (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters)). The value + * is a comma separated list of field paths. See detailed documentation about + * [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + * For example, in this method: + * + * * Field mask of all available fields (for manual inspection): + * `X-Goog-FieldMask: *` + * * Field mask of Route-level duration, distance, and polyline (an example + * production setup): + * `X-Goog-FieldMask: + * routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` + * + * Google discourage the use of the wildcard (`*`) response field mask, or + * specifying the field mask at the top level (`routes`), because: + * + * * Selecting only the fields that you need helps our server save computation + * cycles, allowing us to return the result to you with a lower latency. + * * Selecting only the fields that you need + * in your production job ensures stable latency performance. We might add + * more response fields in the future, and those new fields might require + * extra computation time. If you select all fields, or if you select all + * fields at the top level, then you might experience performance degradation + * because any new field we add will be automatically included in the + * response. + * * Selecting only the fields that you need results in a smaller response + * size, and thus higher network throughput. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.maps.routing.v2.Waypoint} request.origin + * Required. Origin waypoint. + * @param {google.maps.routing.v2.Waypoint} request.destination + * Required. Destination waypoint. + * @param {number[]} [request.intermediates] + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] + * Optional. Specifies the mode of transportation. + * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. You can specify this option only when the + * `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + * @param {google.maps.routing.v2.PolylineQuality} [request.polylineQuality] + * Optional. Specifies your preference for the quality of the polyline. + * @param {google.maps.routing.v2.PolylineEncoding} [request.polylineEncoding] + * Optional. Specifies the preferred encoding for the polyline. + * @param {google.protobuf.Timestamp} [request.departureTime] + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. + * NOTE: You can only specify a `departure_time` in the past when + * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to + * `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 + * days in the future. + * @param {google.protobuf.Timestamp} [request.arrivalTime] + * Optional. The arrival time. + * NOTE: This field is ignored when requests specify a + * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} other than + * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + * not both. Transit trips are available for up to 7 days in the past or 100 + * days in the future. + * @param {boolean} [request.computeAlternativeRoutes] + * Optional. Specifies whether to calculate alternate routes in addition to + * the route. No alternative routes are returned for requests that have + * intermediate waypoints. + * @param {google.maps.routing.v2.RouteModifiers} [request.routeModifiers] + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see [Unicode Locale + * Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + * See [Language + * Support](https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + * @param {string} [request.regionCode] + * Optional. The region code, specified as a ccTLD ("top-level domain") + * two-character value. For more information see [Country code top-level + * domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + * @param {google.maps.routing.v2.Units} [request.units] + * Optional. Specifies the units of measure for the display fields. These + * fields include the `instruction` field in + * {@link protos.google.maps.routing.v2.NavigationInstruction|`NavigationInstruction`}. + * The units of measure used for the route, leg, step distance, and duration + * are not affected by this value. If you don't provide this value, then the + * display units are inferred from the location of the first origin. + * @param {boolean} [request.optimizeWaypointOrder] + * Optional. If set to true, the service attempts to minimize the overall cost + * of the route by re-ordering the specified intermediate waypoints. The + * request fails if any of the intermediate waypoints is a `via` waypoint. Use + * `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to + * find the new ordering. + * If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is + * not requested in the `X-Goog-FieldMask` header, the request fails. + * If `optimize_waypoint_order` is set to false, + * `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be + * empty. + * @param {number[]} [request.requestedReferenceRoutes] + * Optional. Specifies what reference routes to calculate as part of the + * request in addition to the default route. A reference route is a route with + * a different route calculation objective than the default route. For example + * a `FUEL_EFFICIENT` reference route calculation takes into account various + * parameters that would generate an optimal fuel efficient route. When using + * this feature, look for + * {@link protos.google.maps.routing.v2.Route.route_labels|`route_labels`} on the + * resulting routes. + * @param {number[]} [request.extraComputations] + * Optional. A list of extra computations which may be used to complete the + * request. Note: These extra computations may return extra fields on the + * response. These extra fields must also be specified in the field mask to be + * returned in the response. + * @param {google.maps.routing.v2.TrafficModel} [request.trafficModel] + * Optional. Specifies the assumptions to use when calculating time in + * traffic. This setting affects the value returned in the duration field in + * the + * {@link protos.google.maps.routing.v2.Route|`Route`} and + * {@link protos.google.maps.routing.v2.RouteLeg|`RouteLeg`} which contains the predicted + * time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set + * {@link protos.google.maps.routing.v2.RoutingPreference|`RoutingPreference`} to + * `TRAFFIC_AWARE_OPTIMAL` and + * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} to `DRIVE`. + * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + * specified. + * @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences] + * Optional. Specifies preferences that influence the route returned for + * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to + * `TRANSIT`. + * @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.routing.v2.ComputeRoutesResponse|ComputeRoutesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routes.compute_routes.js + * region_tag:routes_v2_generated_Routes_ComputeRoutes_async + */ + computeRoutes( + request?: protos.google.maps.routing.v2.IComputeRoutesRequest, + options?: CallOptions): + Promise<[ + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, {}|undefined + ]>; + computeRoutes( + request: protos.google.maps.routing.v2.IComputeRoutesRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, + {}|null|undefined>): void; + computeRoutes( + request: protos.google.maps.routing.v2.IComputeRoutesRequest, + callback: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, + {}|null|undefined>): void; + computeRoutes( + request?: protos.google.maps.routing.v2.IComputeRoutesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('computeRoutes request %j', request); + const wrappedCallback: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('computeRoutes response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.computeRoutes(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, + {}|undefined + ]) => { + this._log.info('computeRoutes response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Takes in a list of origins and destinations and returns a stream containing + * route information for each combination of origin and destination. + * + * **NOTE:** This method requires that you specify a response field mask in + * the input. You can provide the response field mask by using the URL + * parameter `$fields` or `fields`, or by using the HTTP/gRPC header + * `X-Goog-FieldMask` (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters)). + * The value is a comma separated list of field paths. See this detailed + * documentation about [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + * For example, in this method: + * + * * Field mask of all available fields (for manual inspection): + * `X-Goog-FieldMask: *` + * * Field mask of route durations, distances, element status, condition, and + * element indices (an example production setup): + * `X-Goog-FieldMask: + * originIndex,destinationIndex,status,condition,distanceMeters,duration` + * + * It is critical that you include `status` in your field mask as otherwise + * all messages will appear to be OK. Google discourages the use of the + * wildcard (`*`) response field mask, because: + * + * * Selecting only the fields that you need helps our server save computation + * cycles, allowing us to return the result to you with a lower latency. + * * Selecting only the fields that you need in your production job ensures + * stable latency performance. We might add more response fields in the + * future, and those new fields might require extra computation time. If you + * select all fields, or if you select all fields at the top level, then you + * might experience performance degradation because any new field we add will + * be automatically included in the response. + * * Selecting only the fields that you need results in a smaller response + * size, and thus higher network throughput. + * + * @param {Object} request + * The request object that will be sent. + * @param {number[]} request.origins + * Required. Array of origins, which determines the rows of the response + * matrix. Several size restrictions apply to the cardinality of origins and + * destinations: + * + * * The sum of the number of origins + the number of destinations specified + * as either `place_id` or `address` must be no greater than 50. + * * The product of number of origins × number of destinations must be no + * greater than 625 in any case. + * * The product of the number of origins × number of destinations must be no + * greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + * * The product of the number of origins × number of destinations must be no + * greater than 100 if travel_mode is set to `TRANSIT`. + * @param {number[]} request.destinations + * Required. Array of destinations, which determines the columns of the + * response matrix. + * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] + * Optional. Specifies the mode of transportation. + * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] + * Optional. Specifies how to compute the route. The server attempts to use + * the selected routing preference to compute the route. If the routing + * preference results in an error or an extra long latency, an error is + * returned. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + * @param {google.protobuf.Timestamp} [request.departureTime] + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. + * NOTE: You can only specify a `departure_time` in the past when + * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to + * `TRANSIT`. + * @param {google.protobuf.Timestamp} [request.arrivalTime] + * Optional. The arrival time. + * NOTE: Can only be set when + * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to + * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but + * not both. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see [Unicode Locale + * Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). + * See [Language + * Support](https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the first origin. + * @param {string} [request.regionCode] + * Optional. The region code, specified as a ccTLD ("top-level domain") + * two-character value. For more information see [Country code top-level + * domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). + * @param {google.maps.routing.v2.Units} [request.units] + * Optional. Specifies the units of measure for the display fields. + * @param {number[]} [request.extraComputations] + * Optional. A list of extra computations which may be used to complete the + * request. Note: These extra computations may return extra fields on the + * response. These extra fields must also be specified in the field mask to be + * returned in the response. + * @param {google.maps.routing.v2.TrafficModel} [request.trafficModel] + * Optional. Specifies the assumptions to use when calculating time in + * traffic. This setting affects the value returned in the duration field in + * the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which + * contains the predicted time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set + * {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to + * `TRAFFIC_AWARE_OPTIMAL` and + * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`. + * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not + * specified. + * @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences] + * Optional. Specifies preferences that influence the route returned for + * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when + * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to + * `TRANSIT`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routes.compute_route_matrix.js + * region_tag:routes_v2_generated_Routes_ComputeRouteMatrix_async + */ + computeRouteMatrix( + request?: protos.google.maps.routing.v2.IComputeRouteMatrixRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + this._log.info('computeRouteMatrix stream %j', options); + return this.innerApiCalls.computeRouteMatrix(request, options); + } + + + /** + * 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.routesStub && !this._terminated) { + return this.routesStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json b/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json new file mode 100644 index 00000000000..c69ed299a73 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.maps.routing.v2.Routes": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ComputeRoutes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ComputeRouteMatrix": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json b/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json new file mode 100644 index 00000000000..2d096dec5da --- /dev/null +++ b/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json @@ -0,0 +1,27 @@ +[ + "../../protos/google/geo/type/viewport.proto", + "../../protos/google/maps/routing/v2/fallback_info.proto", + "../../protos/google/maps/routing/v2/geocoding_results.proto", + "../../protos/google/maps/routing/v2/localized_time.proto", + "../../protos/google/maps/routing/v2/location.proto", + "../../protos/google/maps/routing/v2/maneuver.proto", + "../../protos/google/maps/routing/v2/navigation_instruction.proto", + "../../protos/google/maps/routing/v2/polyline.proto", + "../../protos/google/maps/routing/v2/polyline_details.proto", + "../../protos/google/maps/routing/v2/route.proto", + "../../protos/google/maps/routing/v2/route_label.proto", + "../../protos/google/maps/routing/v2/route_modifiers.proto", + "../../protos/google/maps/routing/v2/route_travel_mode.proto", + "../../protos/google/maps/routing/v2/routes_service.proto", + "../../protos/google/maps/routing/v2/routing_preference.proto", + "../../protos/google/maps/routing/v2/speed_reading_interval.proto", + "../../protos/google/maps/routing/v2/toll_info.proto", + "../../protos/google/maps/routing/v2/toll_passes.proto", + "../../protos/google/maps/routing/v2/traffic_model.proto", + "../../protos/google/maps/routing/v2/transit.proto", + "../../protos/google/maps/routing/v2/transit_preferences.proto", + "../../protos/google/maps/routing/v2/units.proto", + "../../protos/google/maps/routing/v2/vehicle_emission_type.proto", + "../../protos/google/maps/routing/v2/vehicle_info.proto", + "../../protos/google/maps/routing/v2/waypoint.proto" +] diff --git a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..9073b2c4213 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const routing = require('@googlemaps/routing'); + +function main() { + const routesClient = new routing.RoutesClient(); +} + +main(); diff --git a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..cf74121e36d --- /dev/null +++ b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {RoutesClient} from '@googlemaps/routing'; + +// check that the client class type name can be used +function doStuffWithRoutesClient(client: RoutesClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const routesClient = new RoutesClient(); + doStuffWithRoutesClient(routesClient); +} + +main(); diff --git a/owl-bot-staging/google-maps-routing/system-test/install.ts b/owl-bot-staging/google-maps-routing/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts b/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts new file mode 100644 index 00000000000..1c3a80333b1 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts @@ -0,0 +1,410 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as routesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +describe('v2.RoutesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new routesModule.v2.RoutesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'routes.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new routesModule.v2.RoutesClient(); + 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 = routesModule.v2.RoutesClient.servicePath; + assert.strictEqual(servicePath, 'routes.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = routesModule.v2.RoutesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'routes.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new routesModule.v2.RoutesClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routes.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new routesModule.v2.RoutesClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = routesModule.v2.RoutesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routesModule.v2.RoutesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routesModule.v2.RoutesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routesStub, undefined); + await client.initialize(); + assert(client.routesStub); + }); + + it('has close method for the initialized client', done => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.routesStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routesStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routesModule.v2.RoutesClient({ + 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 routesModule.v2.RoutesClient({ + 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('computeRoutes', () => { + it('invokes computeRoutes without error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesResponse() + ); + client.innerApiCalls.computeRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.computeRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRoutes without error using callback', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesResponse() + ); + client.innerApiCalls.computeRoutes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.computeRoutes( + request, + (err?: Error|null, result?: protos.google.maps.routing.v2.IComputeRoutesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRoutes with error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.computeRoutes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.computeRoutes(request), expectedError); + }); + + it('invokes computeRoutes with closed client', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.computeRoutes(request), expectedError); + }); + }); + + describe('computeRouteMatrix', () => { + it('invokes computeRouteMatrix without error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.RouteMatrixElement() + ); + client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(expectedResponse); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRouteMatrix without error and gaxServerStreamingRetries enabled', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + gaxServerStreamingRetries: true + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.RouteMatrixElement() + ); + client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(expectedResponse); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRouteMatrix with error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(undefined, expectedError); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + + it('invokes computeRouteMatrix with closed client', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + const stream = client.computeRouteMatrix(request, {retryRequestOptions: {noResponseRetries: 0}}); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new routesModule.v2.RoutesClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); +}); diff --git a/owl-bot-staging/google-maps-routing/tsconfig.json b/owl-bot-staging/google-maps-routing/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-maps-routing/webpack.config.js b/owl-bot-staging/google-maps-routing/webpack.config.js new file mode 100644 index 00000000000..311cb75c287 --- /dev/null +++ b/owl-bot-staging/google-maps-routing/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: 'Routes', + filename: './routes.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 4fae8b0d675cf3a4f23e33c5d4ab9c854a47a5a3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Mar 2026 21:21:18 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-maps-routing/.eslintignore | 7 - .../google-maps-routing/.eslintrc.json | 3 - .../google-maps-routing/.gitattributes | 4 - .../google-maps-routing/.gitignore | 14 - owl-bot-staging/google-maps-routing/.jsdoc.js | 55 - .../google-maps-routing/.mocharc.js | 33 - owl-bot-staging/google-maps-routing/.nycrc | 24 - .../google-maps-routing/.prettierignore | 6 - .../google-maps-routing/.prettierrc.js | 22 - .../google-maps-routing/CODE_OF_CONDUCT.md | 94 - .../google-maps-routing/CONTRIBUTING.md | 76 - owl-bot-staging/google-maps-routing/LICENSE | 202 - owl-bot-staging/google-maps-routing/README.md | 115 - .../protos/google/geo/type/viewport.proto | 69 - .../maps/routing/v2/fallback_info.proto | 73 - .../maps/routing/v2/geocoding_results.proto | 71 - .../maps/routing/v2/localized_time.proto | 39 - .../google/maps/routing/v2/location.proto | 43 - .../google/maps/routing/v2/maneuver.proto | 93 - .../routing/v2/navigation_instruction.proto | 40 - .../google/maps/routing/v2/polyline.proto | 73 - .../maps/routing/v2/polyline_details.proto | 84 - .../protos/google/maps/routing/v2/route.proto | 416 - .../google/maps/routing/v2/route_label.proto | 49 - .../maps/routing/v2/route_modifiers.proto | 64 - .../maps/routing/v2/route_travel_mode.proto | 52 - .../maps/routing/v2/routes_service.proto | 540 - .../maps/routing/v2/routing_preference.proto | 57 - .../routing/v2/speed_reading_interval.proto | 59 - .../google/maps/routing/v2/toll_info.proto | 41 - .../google/maps/routing/v2/toll_passes.proto | 348 - .../maps/routing/v2/traffic_model.proto | 55 - .../google/maps/routing/v2/transit.proto | 160 - .../maps/routing/v2/transit_preferences.proto | 74 - .../protos/google/maps/routing/v2/units.proto | 39 - .../routing/v2/vehicle_emission_type.proto | 46 - .../google/maps/routing/v2/vehicle_info.proto | 36 - .../google/maps/routing/v2/waypoint.proto | 80 - .../google-maps-routing/protos/protos.d.ts | 13379 ------ .../google-maps-routing/protos/protos.js | 37043 ---------------- .../google-maps-routing/protos/protos.json | 3546 -- .../v2/routes.compute_route_matrix.js | 154 - .../generated/v2/routes.compute_routes.js | 199 - ...ippet_metadata_google.maps.routing.v2.json | 211 - .../google-maps-routing/src/index.ts | 27 - .../src/v2/gapic_metadata.json | 38 - .../google-maps-routing/src/v2/index.ts | 19 - .../src/v2/routes_client.ts | 706 - .../src/v2/routes_client_config.json | 34 - .../src/v2/routes_proto_list.json | 27 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../system-test/install.ts | 49 - .../test/gapic_routes_v2.ts | 410 - .../google-maps-routing/tsconfig.json | 22 - .../google-maps-routing/webpack.config.js | 64 - .../maps/routing/v2/fallback_info.proto | 2 +- .../maps/routing/v2/geocoding_results.proto | 2 +- .../maps/routing/v2/localized_time.proto | 2 +- .../google/maps/routing/v2/location.proto | 2 +- .../google/maps/routing/v2/maneuver.proto | 2 +- .../routing/v2/navigation_instruction.proto | 2 +- .../google/maps/routing/v2/polyline.proto | 2 +- .../maps/routing/v2/polyline_details.proto | 2 +- .../protos/google/maps/routing/v2/route.proto | 46 +- .../google/maps/routing/v2/route_label.proto | 2 +- .../maps/routing/v2/route_modifiers.proto | 2 +- .../maps/routing/v2/route_travel_mode.proto | 2 +- .../maps/routing/v2/routes_service.proto | 7 +- .../maps/routing/v2/routing_preference.proto | 2 +- .../routing/v2/speed_reading_interval.proto | 9 +- .../google/maps/routing/v2/toll_info.proto | 3 +- .../google/maps/routing/v2/toll_passes.proto | 2 +- .../maps/routing/v2/traffic_model.proto | 14 +- .../google/maps/routing/v2/transit.proto | 2 +- .../maps/routing/v2/transit_preferences.proto | 2 +- .../protos/google/maps/routing/v2/units.proto | 2 +- .../routing/v2/vehicle_emission_type.proto | 2 +- .../google/maps/routing/v2/vehicle_info.proto | 3 +- .../google/maps/routing/v2/waypoint.proto | 7 +- .../google-maps-routing/protos/protos.d.ts | 8 +- packages/google-maps-routing/protos/protos.js | 33 +- .../google-maps-routing/protos/protos.json | 10 +- .../v2/routes.compute_route_matrix.js | 1 + .../generated/v2/routes.compute_routes.js | 4 +- ...ippet_metadata_google.maps.routing.v2.json | 2 +- .../src/v2/routes_client.ts | 5 +- 87 files changed, 125 insertions(+), 59404 deletions(-) delete mode 100644 owl-bot-staging/google-maps-routing/.eslintignore delete mode 100644 owl-bot-staging/google-maps-routing/.eslintrc.json delete mode 100644 owl-bot-staging/google-maps-routing/.gitattributes delete mode 100644 owl-bot-staging/google-maps-routing/.gitignore delete mode 100644 owl-bot-staging/google-maps-routing/.jsdoc.js delete mode 100644 owl-bot-staging/google-maps-routing/.mocharc.js delete mode 100644 owl-bot-staging/google-maps-routing/.nycrc delete mode 100644 owl-bot-staging/google-maps-routing/.prettierignore delete mode 100644 owl-bot-staging/google-maps-routing/.prettierrc.js delete mode 100644 owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-maps-routing/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-maps-routing/LICENSE delete mode 100644 owl-bot-staging/google-maps-routing/README.md delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto delete mode 100644 owl-bot-staging/google-maps-routing/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-maps-routing/protos/protos.js delete mode 100644 owl-bot-staging/google-maps-routing/protos/protos.json delete mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js delete mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js delete mode 100644 owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json delete mode 100644 owl-bot-staging/google-maps-routing/src/index.ts delete mode 100644 owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-maps-routing/src/v2/index.ts delete mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_client.ts delete mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json delete mode 100644 owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json delete mode 100644 owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-maps-routing/system-test/install.ts delete mode 100644 owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts delete mode 100644 owl-bot-staging/google-maps-routing/tsconfig.json delete mode 100644 owl-bot-staging/google-maps-routing/webpack.config.js diff --git a/owl-bot-staging/google-maps-routing/.eslintignore b/owl-bot-staging/google-maps-routing/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-maps-routing/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-maps-routing/.eslintrc.json b/owl-bot-staging/google-maps-routing/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-maps-routing/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-maps-routing/.gitattributes b/owl-bot-staging/google-maps-routing/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-maps-routing/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-maps-routing/.gitignore b/owl-bot-staging/google-maps-routing/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-maps-routing/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-maps-routing/.jsdoc.js b/owl-bot-staging/google-maps-routing/.jsdoc.js deleted file mode 100644 index 1f1b0bb81da..00000000000 --- a/owl-bot-staging/google-maps-routing/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -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 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@googlemaps/routing', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-maps-routing/.mocharc.js b/owl-bot-staging/google-maps-routing/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-maps-routing/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-maps-routing/.nycrc b/owl-bot-staging/google-maps-routing/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-maps-routing/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/.prettierignore b/owl-bot-staging/google-maps-routing/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-maps-routing/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-maps-routing/.prettierrc.js b/owl-bot-staging/google-maps-routing/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-maps-routing/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md b/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-maps-routing/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/CONTRIBUTING.md b/owl-bot-staging/google-maps-routing/CONTRIBUTING.md deleted file mode 100644 index bbced25792a..00000000000 --- a/owl-bot-staging/google-maps-routing/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Routing 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=routes.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/LICENSE b/owl-bot-staging/google-maps-routing/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-maps-routing/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-maps-routing/README.md b/owl-bot-staging/google-maps-routing/README.md deleted file mode 100644 index 22177e6eebd..00000000000 --- a/owl-bot-staging/google-maps-routing/README.md +++ /dev/null @@ -1,115 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Routes API: Nodejs Client][homepage] - -This library is considered to be in **preview**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. - -[![npm version](https://img.shields.io/npm/v/@googlemaps/routing.svg)](https://www.npmjs.org/package/@googlemaps/routing) - -Routes API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Routes API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/routing/latest) - - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Routes API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @googlemaps/routing -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| compute route matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | -| compute routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | -| maps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json) | - - -## 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/routing@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routes.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing diff --git a/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto b/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto deleted file mode 100644 index 08c0cce8cfc..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/geo/type/viewport.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.geo.type; - -import "google/type/latlng.proto"; - -option go_package = "google.golang.org/genproto/googleapis/geo/type/viewport;viewport"; -option java_multiple_files = true; -option java_outer_classname = "ViewportProto"; -option java_package = "com.google.geo.type"; -option objc_class_prefix = "GGTP"; - -// A latitude-longitude viewport, represented as two diagonally opposite `low` -// and `high` points. A viewport is considered a closed region, i.e. it includes -// its boundary. The latitude bounds must range between -90 to 90 degrees -// inclusive, and the longitude bounds must range between -180 to 180 degrees -// inclusive. Various cases include: -// -// - If `low` = `high`, the viewport consists of that single point. -// -// - If `low.longitude` > `high.longitude`, the longitude range is inverted -// (the viewport crosses the 180 degree longitude line). -// -// - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, -// the viewport includes all longitudes. -// -// - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, -// the longitude range is empty. -// -// - If `low.latitude` > `high.latitude`, the latitude range is empty. -// -// Both `low` and `high` must be populated, and the represented box cannot be -// empty (as specified by the definitions above). An empty viewport will result -// in an error. -// -// For example, this viewport fully encloses New York City: -// -// { -// "low": { -// "latitude": 40.477398, -// "longitude": -74.259087 -// }, -// "high": { -// "latitude": 40.91618, -// "longitude": -73.70018 -// } -// } -message Viewport { - // Required. The low point of the viewport. - google.type.LatLng low = 1; - - // Required. The high point of the viewport. - google.type.LatLng high = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto deleted file mode 100644 index a0ef20364bb..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "FallbackInfoProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Information related to how and why a fallback result was used. If this field -// is set, then it means the server used a different routing mode from your -// preferred mode as fallback. -message FallbackInfo { - // Routing mode used for the response. If fallback was triggered, the mode - // may be different from routing preference set in the original client - // request. - FallbackRoutingMode routing_mode = 1; - - // The reason why fallback response was used instead of the original response. - // This field is only populated when the fallback mode is triggered and the - // fallback response is returned. - FallbackReason reason = 2; -} - -// Reasons for using fallback response. -enum FallbackReason { - // No fallback reason specified. - FALLBACK_REASON_UNSPECIFIED = 0; - - // A server error happened while calculating routes with your preferred - // routing mode, but we were able to return a result calculated by an - // alternative mode. - SERVER_ERROR = 1; - - // We were not able to finish the calculation with your preferred routing mode - // on time, but we were able to return a result calculated by an alternative - // mode. - LATENCY_EXCEEDED = 2; -} - -// Actual routing mode used for returned fallback response. -enum FallbackRoutingMode { - // Not used. - FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; - - // Indicates the `TRAFFIC_UNAWARE` - // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to - // compute the response. - FALLBACK_TRAFFIC_UNAWARE = 1; - - // Indicates the `TRAFFIC_AWARE` - // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] was used to - // compute the response. - FALLBACK_TRAFFIC_AWARE = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto deleted file mode 100644 index 70ba902ab3a..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "GeocodingResultsProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Contains [`GeocodedWaypoints`][google.maps.routing.v2.GeocodedWaypoint] for -// origin, destination and intermediate waypoints. Only populated for address -// waypoints. -message GeocodingResults { - // Origin geocoded waypoint. - GeocodedWaypoint origin = 1; - - // Destination geocoded waypoint. - GeocodedWaypoint destination = 2; - - // A list of intermediate geocoded waypoints each containing an index field - // that corresponds to the zero-based position of the waypoint in the order - // they were specified in the request. - repeated GeocodedWaypoint intermediates = 3; -} - -// Details about the locations used as waypoints. Only populated for address -// waypoints. Includes details about the geocoding results for the purposes of -// determining what the address was geocoded to. -message GeocodedWaypoint { - // Indicates the status code resulting from the geocoding operation. - google.rpc.Status geocoder_status = 1; - - // The index of the corresponding intermediate waypoint in the request. - // Only populated if the corresponding waypoint is an intermediate - // waypoint. - optional int32 intermediate_waypoint_request_index = 2; - - // The type(s) of the result, in the form of zero or more type tags. - // Supported types: [Address types and address component - // types](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types). - repeated string type = 3; - - // Indicates that the geocoder did not return an exact match for the original - // request, though it was able to match part of the requested address. You may - // wish to examine the original request for misspellings and/or an incomplete - // address. - bool partial_match = 4; - - // The place ID for this result. - string place_id = 5; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto deleted file mode 100644 index 7ec111af21b..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/type/localized_text.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "LocalizedTimeProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Localized description of time. -message LocalizedTime { - // The time specified as a string in a given time zone. - google.type.LocalizedText time = 1; - - // Contains the time zone. The value is the name of the time zone as defined - // in the [IANA Time Zone Database](http://www.iana.org/time-zones), e.g. - // "America/New_York". - string time_zone = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto deleted file mode 100644 index 88ca2a6f1f2..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/location.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/protobuf/wrappers.proto"; -import "google/type/latlng.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "LocationProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// 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 specifies the side of the road 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, and so on. You can use this field only for - // `DRIVE` and `TWO_WHEELER` - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - google.protobuf.Int32Value heading = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto deleted file mode 100644 index 13bb3e0b0b1..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "ManeuverProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A set of values that specify the navigation action to take for the current -// step (for example, turn left, merge, or straight). -enum Maneuver { - // Not used. - MANEUVER_UNSPECIFIED = 0; - - // Turn slightly to the left. - TURN_SLIGHT_LEFT = 1; - - // Turn sharply to the left. - TURN_SHARP_LEFT = 2; - - // Make a left u-turn. - UTURN_LEFT = 3; - - // Turn left. - TURN_LEFT = 4; - - // Turn slightly to the right. - TURN_SLIGHT_RIGHT = 5; - - // Turn sharply to the right. - TURN_SHARP_RIGHT = 6; - - // Make a right u-turn. - UTURN_RIGHT = 7; - - // Turn right. - TURN_RIGHT = 8; - - // Go straight. - STRAIGHT = 9; - - // Take the left ramp. - RAMP_LEFT = 10; - - // Take the right ramp. - RAMP_RIGHT = 11; - - // Merge into traffic. - MERGE = 12; - - // Take the left fork. - FORK_LEFT = 13; - - // Take the right fork. - FORK_RIGHT = 14; - - // Take the ferry. - FERRY = 15; - - // Take the train leading onto the ferry. - FERRY_TRAIN = 16; - - // Turn left at the roundabout. - ROUNDABOUT_LEFT = 17; - - // Turn right at the roundabout. - ROUNDABOUT_RIGHT = 18; - - // Initial maneuver. - DEPART = 19; - - // Used to indicate a street name change. - NAME_CHANGE = 20; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto deleted file mode 100644 index e944e88f111..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/maps/routing/v2/maneuver.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "NavigationInstructionProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Encapsulates navigation instructions for a -// [`RouteLegStep`][google.maps.routing.v2.RouteLegStep]. -message NavigationInstruction { - // Encapsulates the navigation instructions for the current step (for example, - // turn left, merge, or straight). This field determines which icon to - // display. - Maneuver maneuver = 1; - - // Instructions for navigating this step. - string instructions = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto deleted file mode 100644 index 523f78a1f27..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "PolylineProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Encapsulates an encoded polyline. -message Polyline { - // Encapsulates the type of polyline. Defaults to encoded_polyline. - oneof polyline_type { - // The string encoding of the polyline using the [polyline encoding - // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) - string encoded_polyline = 1; - - // Specifies a polyline using the [GeoJSON LineString - // format](https://tools.ietf.org/html/rfc7946#section-3.1.4). - google.protobuf.Struct geo_json_linestring = 2; - } -} - -// A set of values that specify the quality of the polyline. -enum PolylineQuality { - // No polyline quality preference specified. Defaults to `OVERVIEW`. - POLYLINE_QUALITY_UNSPECIFIED = 0; - - // Specifies a high-quality polyline - which is composed using more points - // than `OVERVIEW`, at the cost of increased response size. Use this value - // when you need more precision. - HIGH_QUALITY = 1; - - // Specifies an overview polyline - which is composed using a small number of - // points. Use this value when displaying an overview of the route. Using this - // option has a lower request latency compared to using the - // `HIGH_QUALITY` option. - OVERVIEW = 2; -} - -// Specifies the preferred type of polyline to be returned. -enum PolylineEncoding { - // No polyline type preference specified. Defaults to `ENCODED_POLYLINE`. - POLYLINE_ENCODING_UNSPECIFIED = 0; - - // Specifies a polyline encoded using the [polyline encoding - // algorithm](/maps/documentation/utilities/polylinealgorithm). - ENCODED_POLYLINE = 1; - - // Specifies a polyline using the [GeoJSON LineString - // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) - GEO_JSON_LINESTRING = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto deleted file mode 100644 index a56da6c86aa..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "PolylineDetailsProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Details corresponding to a given index or contiguous segment of a polyline. -// Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the -// `PolylineDetails` defines an interval and associated metadata. -message PolylineDetails { - // Encapsulates the start and end indexes for a polyline detail. - // For instances where the data corresponds to a single point, `start_index` - // and `end_index` will be equal. - message PolylinePointIndex { - // The start index of this detail in the polyline. - optional int32 start_index = 1; - - // The end index of this detail in the polyline. - optional int32 end_index = 2; - } - - // Encapsulates the states of road features along a stretch of polyline. - enum RoadFeatureState { - // The road feature's state was not computed (default value). - ROAD_FEATURE_STATE_UNSPECIFIED = 0; - - // The road feature exists. - EXISTS = 1; - - // The road feature does not exist. - DOES_NOT_EXIST = 2; - } - - // Encapsulates information about flyovers along the polyline. - message FlyoverInfo { - // Output only. Denotes whether a flyover exists for a given stretch of the - // polyline. - RoadFeatureState flyover_presence = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The location of flyover related information along the polyline. - PolylinePointIndex polyline_point_index = 2; - } - - // Encapsulates information about narrow roads along the polyline. - message NarrowRoadInfo { - // Output only. Denotes whether a narrow road exists for a given stretch of - // the polyline. - RoadFeatureState narrow_road_presence = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The location of narrow road related information along the polyline. - PolylinePointIndex polyline_point_index = 2; - } - - // Flyover details along the polyline. - repeated FlyoverInfo flyover_info = 12; - - // Narrow road details along the polyline. - repeated NarrowRoadInfo narrow_road_info = 13; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto deleted file mode 100644 index 42d73042fac..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route.proto +++ /dev/null @@ -1,416 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/geo/type/viewport.proto"; -import "google/maps/routing/v2/localized_time.proto"; -import "google/maps/routing/v2/location.proto"; -import "google/maps/routing/v2/navigation_instruction.proto"; -import "google/maps/routing/v2/polyline.proto"; -import "google/maps/routing/v2/polyline_details.proto"; -import "google/maps/routing/v2/route_label.proto"; -import "google/maps/routing/v2/route_travel_mode.proto"; -import "google/maps/routing/v2/speed_reading_interval.proto"; -import "google/maps/routing/v2/toll_info.proto"; -import "google/maps/routing/v2/transit.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/localized_text.proto"; -import "google/type/money.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RouteProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Contains a route, which consists of a series of connected road segments -// that join beginning, ending, and intermediate waypoints. -message Route { - // Text representations of certain properties. - message RouteLocalizedValues { - // Travel distance represented in text form. - google.type.LocalizedText distance = 1; - - // Duration, represented in text form and localized to the region of the - // query. Takes traffic conditions into consideration. Note: If you did not - // request traffic information, this value is the same value as - // `static_duration`. - google.type.LocalizedText duration = 2; - - // Duration without taking traffic conditions into consideration, - // represented in text form. - google.type.LocalizedText static_duration = 3; - - // Transit fare represented in text form. - google.type.LocalizedText transit_fare = 4; - } - - // Labels for the `Route` that are useful to identify specific properties - // of the route to compare against others. - repeated RouteLabel route_labels = 13; - - // A collection of legs (path segments between waypoints) that make up the - // route. Each leg corresponds to the trip between two non-`via` - // [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with - // no intermediate waypoints has only one leg. A route that includes one - // non-`via` intermediate waypoint has two legs. A route that includes one - // `via` intermediate waypoint has one leg. The order of the legs matches the - // order of waypoints from `origin` to `intermediates` to `destination`. - repeated RouteLeg legs = 1; - - // The travel distance of the route, in meters. - int32 distance_meters = 2; - - // The length of time needed to navigate the route. If you set the - // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as - // `static_duration`. If you set the `routing_preference` to either - // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated - // taking traffic conditions into account. - google.protobuf.Duration duration = 3; - - // The duration of travel through the route without taking traffic - // conditions into consideration. - google.protobuf.Duration static_duration = 4; - - // The overall route polyline. This polyline is the combined polyline of - // all `legs`. - Polyline polyline = 5; - - // A description of the route. - string description = 6; - - // An array of warnings to show when displaying the route. - repeated string warnings = 7; - - // The viewport bounding box of the polyline. - google.geo.type.Viewport viewport = 8; - - // Additional information about the route. - RouteTravelAdvisory travel_advisory = 9; - - // If you set - // [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] - // to true, this field contains the optimized ordering of intermediate - // waypoints. Otherwise, this field is empty. - // For example, if you give an input of Origin: LA; Intermediate waypoints: - // Dallas, Bangor, Phoenix; Destination: New York; and the optimized - // intermediate waypoint order is Phoenix, Dallas, Bangor, then this field - // contains the values [2, 0, 1]. The index starts with 0 for the first - // intermediate waypoint provided in the input. - repeated int32 optimized_intermediate_waypoint_index = 10; - - // Text representations of properties of the `Route`. - RouteLocalizedValues localized_values = 11; - - // An opaque token that can be passed to [Navigation - // SDK](https://developers.google.com/maps/documentation/mobility/driver-sdk/navigation) - // to reconstruct the route during navigation, and, in the event of rerouting, - // honor the original intention when the route was created. Treat this token - // as an opaque blob. Don't compare its value across requests as its value - // may change even if the service returns the exact same route. - // - // NOTE: `Route.route_token` is only available for requests that have set - // `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or - // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests - // that have Via waypoints. - string route_token = 12; - - // Contains information about details along the polyline. - PolylineDetails polyline_details = 14; -} - -// Contains the additional information that the user should be informed -// about, such as possible traffic zone restrictions. -message RouteTravelAdvisory { - // Contains information about tolls on the route. This field is only populated - // if tolls are expected on the route and `TOLLS` is included in the request's - // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. - // If this field is set, but the `estimatedPrice` subfield is not populated, - // then the route contains tolls, but the estimated price is unknown. If - // `toll_info` is not set, then there are no tolls expected on the route. - TollInfo toll_info = 2; - - // Speed reading intervals indicating traffic density. This field is only - // populated for requests when the request has a `TRAFFIC_AWARE` or - // `TRAFFIC_AWARE_OPTIMAL` - // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] - // value, and `TRAFFIC_ON_POLYLINE` is included in the - // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. - // The intervals cover the entire polyline of the route without overlap. The - // start point of a specified interval is the same as the end point of the - // preceding interval. - // - // Example: - // - // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G - // speed_reading_intervals: [A,C), [C,D), [D,G). - repeated SpeedReadingInterval speed_reading_intervals = 3; - - // The predicted fuel consumption in microliters. - // This field is only populated when `FUEL_CONSUMPTION` is included in the - // request's - // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. - int64 fuel_consumption_microliters = 5; - - // Returned route may have restrictions that are not suitable for requested - // travel mode or route modifiers. - bool route_restrictions_partially_ignored = 6; - - // If present, contains the total fare or ticket costs on this route - // This property is only returned for `TRANSIT` requests and only - // for routes where fare information is available for all transit steps. - google.type.Money transit_fare = 7; -} - -// Contains the additional information that the user should be informed -// about on a leg step, such as possible traffic zone restrictions. -message RouteLegTravelAdvisory { - // Contains information about tolls on the specific `RouteLeg`. - // This field is only populated if we expect there are tolls on the - // `RouteLeg` and `TOLLS` is included in the request's - // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. - // If this field is set but the estimated_price subfield is not - // populated, we expect that road contains tolls but we do not know an - // estimated price. If `toll_info` does not exist, then there is no toll on - // the `RouteLeg`. - TollInfo toll_info = 1; - - // Speed reading intervals indicating traffic density. This field is only - // populated for requests when the request has a `TRAFFIC_AWARE` or - // `TRAFFIC_AWARE_OPTIMAL` - // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] - // value, and `TRAFFIC_ON_POLYLINE` is included in the - // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. - // The intervals cover the entire polyline of the `RouteLeg` without overlap. - // The start point of a specified interval is the same as the end point of the - // preceding interval. - // - // Example: - // - // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G - // speed_reading_intervals: [A,C), [C,D), [D,G). - repeated SpeedReadingInterval speed_reading_intervals = 2; -} - -// Contains the additional information that the user should be informed -// about, such as possible traffic zone restrictions on a leg step. -message RouteLegStepTravelAdvisory { - // NOTE: This field is not currently populated. - repeated SpeedReadingInterval speed_reading_intervals = 1; -} - -// Contains a segment between non-`via` waypoints. -message RouteLeg { - // Text representations of certain properties. - message RouteLegLocalizedValues { - // Travel distance represented in text form. - google.type.LocalizedText distance = 1; - - // Duration, represented in text form and localized to the region of the - // query. Takes traffic conditions into consideration. Note: If you did not - // request traffic information, this value is the same value as - // static_duration. - google.type.LocalizedText duration = 2; - - // Duration without taking traffic conditions into - // consideration, represented in text form. - google.type.LocalizedText static_duration = 3; - } - - // Provides overview information about a list of `RouteLegStep`s. - message StepsOverview { - // Provides summarized information about different multi-modal segments of - // the `RouteLeg.steps`. A multi-modal segment is defined as one or more - // contiguous `RouteLegStep` that have the same `RouteTravelMode`. - // This field is not populated if the `RouteLeg` does not contain any - // multi-modal segments in the steps. - message MultiModalSegment { - // The corresponding `RouteLegStep` index that is the start of a - // multi-modal segment. - optional int32 step_start_index = 1; - - // The corresponding `RouteLegStep` index that is the end of a - // multi-modal segment. - optional int32 step_end_index = 2; - - // NavigationInstruction for the multi-modal segment. - NavigationInstruction navigation_instruction = 3; - - // The travel mode of the multi-modal segment. - RouteTravelMode travel_mode = 4; - } - - // Summarized information about different multi-modal segments of - // the `RouteLeg.steps`. This field is not populated if the `RouteLeg` does - // not contain any multi-modal segments in the steps. - repeated MultiModalSegment multi_modal_segments = 1; - } - - // The travel distance of the route leg, in meters. - int32 distance_meters = 1; - - // The length of time needed to navigate the leg. If the `route_preference` - // is set to `TRAFFIC_UNAWARE`, then this value is the same as - // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or - // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic - // conditions into account. - google.protobuf.Duration duration = 2; - - // The duration of travel through the leg, calculated without taking - // traffic conditions into consideration. - google.protobuf.Duration static_duration = 3; - - // The overall polyline for this leg that includes each `step`'s - // polyline. - Polyline polyline = 4; - - // The start location of this leg. This location might be different from the - // provided `origin`. For example, when the provided `origin` is not near a - // road, this is a point on the road. - Location start_location = 5; - - // The end location of this leg. This location might be different from the - // provided `destination`. For example, when the provided `destination` is not - // near a road, this is a point on the road. - Location end_location = 6; - - // An array of steps denoting segments within this leg. Each step represents - // one navigation instruction. - repeated RouteLegStep steps = 7; - - // Contains the additional information that the user should be informed - // about, such as possible traffic zone restrictions, on a route leg. - RouteLegTravelAdvisory travel_advisory = 8; - - // Text representations of properties of the `RouteLeg`. - RouteLegLocalizedValues localized_values = 9; - - // Overview information about the steps in this `RouteLeg`. This field is only - // populated for TRANSIT routes. - StepsOverview steps_overview = 10; -} - -// Contains a segment of a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. A -// step corresponds to a single navigation instruction. Route legs are made up -// of steps. -message RouteLegStep { - // Text representations of certain properties. - message RouteLegStepLocalizedValues { - // Travel distance represented in text form. - google.type.LocalizedText distance = 1; - - // Duration without taking traffic conditions into - // consideration, represented in text form. - google.type.LocalizedText static_duration = 3; - } - - // The travel distance of this step, in meters. In some circumstances, this - // field might not have a value. - int32 distance_meters = 1; - - // The duration of travel through this step without taking traffic conditions - // into consideration. In some circumstances, this field might not have a - // value. - google.protobuf.Duration static_duration = 2; - - // The polyline associated with this step. - Polyline polyline = 3; - - // The start location of this step. - Location start_location = 4; - - // The end location of this step. - Location end_location = 5; - - // Navigation instructions. - NavigationInstruction navigation_instruction = 6; - - // Contains the additional information that the user should be informed - // about, such as possible traffic zone restrictions, on a leg step. - RouteLegStepTravelAdvisory travel_advisory = 7; - - // Text representations of properties of the `RouteLegStep`. - RouteLegStepLocalizedValues localized_values = 8; - - // Details pertaining to this step if the travel mode is `TRANSIT`. - RouteLegStepTransitDetails transit_details = 9; - - // The travel mode used for this step. - RouteTravelMode travel_mode = 10; -} - -// Additional information for the `RouteLegStep` related to `TRANSIT` routes. -message RouteLegStepTransitDetails { - // Details about the transit stops for the `RouteLegStep`. - message TransitStopDetails { - // Information about the arrival stop for the step. - TransitStop arrival_stop = 1; - - // The estimated time of arrival for the step. - google.protobuf.Timestamp arrival_time = 2; - - // Information about the departure stop for the step. - TransitStop departure_stop = 3; - - // The estimated time of departure for the step. - google.protobuf.Timestamp departure_time = 4; - } - - // Localized descriptions of values for `RouteTransitDetails`. - message TransitDetailsLocalizedValues { - // Time in its formatted text representation with a corresponding time zone. - LocalizedTime arrival_time = 1; - - // Time in its formatted text representation with a corresponding time zone. - LocalizedTime departure_time = 2; - } - - // Information about the arrival and departure stops for the step. - TransitStopDetails stop_details = 1; - - // Text representations of properties of the `RouteLegStepTransitDetails`. - TransitDetailsLocalizedValues localized_values = 2; - - // Specifies the direction in which to travel on this line as marked on - // the vehicle or at the departure stop. The direction is often the terminus - // station. - string headsign = 3; - - // Specifies the expected time as a duration between departures from the same - // stop at this time. For example, with a headway seconds value of 600, you - // would expect a ten minute wait if you should miss your bus. - google.protobuf.Duration headway = 4; - - // Information about the transit line used in this step. - TransitLine transit_line = 5; - - // The number of stops from the departure to the arrival stop. This count - // includes the arrival stop, but excludes the departure stop. For example, if - // your route leaves from Stop A, passes through stops B and C, and arrives at - // stop D, stop_count returns 3. - int32 stop_count = 6; - - // The text that appears in schedules and sign boards to identify a transit - // trip to passengers. The text should uniquely identify a trip within a - // service day. For example, "538" is the `trip_short_text` of the Amtrak - // train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. - string trip_short_text = 7; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto deleted file mode 100644 index c88c941b6b1..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_label.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RouteLabelProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Labels for the [`Route`][google.maps.routing.v2.Route] that are useful to -// identify specific properties of the route to compare against others. -enum RouteLabel { - // Default - not used. - ROUTE_LABEL_UNSPECIFIED = 0; - - // The default "best" route returned for the route computation. - DEFAULT_ROUTE = 1; - - // An alternative to the default "best" route. Routes like this will be - // returned when - // [`compute_alternative_routes`][google.maps.routing.v2.ComputeRoutesRequest.compute_alternative_routes] - // is specified. - DEFAULT_ROUTE_ALTERNATE = 2; - - // Fuel efficient route. Routes labeled with this value are determined to be - // optimized for Eco parameters such as fuel consumption. - FUEL_EFFICIENT = 3; - - // Shorter travel distance route. This is an experimental feature. - SHORTER_DISTANCE = 4; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto deleted file mode 100644 index 512bdd0d766..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/maps/routing/v2/toll_passes.proto"; -import "google/maps/routing/v2/vehicle_info.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RouteModifiersProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Encapsulates a set of optional conditions to satisfy when calculating the -// routes. -message RouteModifiers { - // When set to true, avoids toll roads where reasonable, giving preference to - // routes not containing toll roads. Applies only to the `DRIVE` and - // `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - bool avoid_tolls = 1; - - // When set to true, avoids highways where reasonable, giving preference to - // routes not containing highways. Applies only to the `DRIVE` and - // `TWO_WHEELER` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - bool avoid_highways = 2; - - // When set to true, avoids ferries where reasonable, giving preference to - // routes not containing ferries. Applies only to the `DRIVE` and`TWO_WHEELER` - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - bool avoid_ferries = 3; - - // When set to true, avoids navigating indoors where reasonable, giving - // preference to routes not containing indoor navigation. Applies only to the - // `WALK` [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - bool avoid_indoor = 4; - - // Specifies the vehicle information. - VehicleInfo vehicle_info = 5; - - // Encapsulates information about toll passes. - // If toll passes are provided, the API tries to return the pass price. If - // toll passes are not provided, the API treats the toll pass as unknown and - // tries to return the cash price. - // Applies only to the `DRIVE` and `TWO_WHEELER` - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - repeated TollPass toll_passes = 6; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto deleted file mode 100644 index f43b50adbc8..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RouteTravelModeProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A set of values used to specify the mode of travel. -// NOTE: `WALK`, `BICYCLE`, and `TWO_WHEELER` routes are in beta and might -// sometimes be missing clear sidewalks, pedestrian paths, or bicycling paths. -// You must display this warning to the user for all walking, bicycling, and -// two-wheel routes that you display in your app. -enum RouteTravelMode { - // No travel mode specified. Defaults to `DRIVE`. - TRAVEL_MODE_UNSPECIFIED = 0; - - // Travel by passenger car. - DRIVE = 1; - - // Travel by bicycle. - BICYCLE = 2; - - // Travel by walking. - WALK = 3; - - // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this - // differs from the `BICYCLE` travel mode which covers human-powered mode. - TWO_WHEELER = 4; - - // Travel by public transit routes, where available. - TRANSIT = 7; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto deleted file mode 100644 index ae7a21e616f..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/maps/routing/v2/fallback_info.proto"; -import "google/maps/routing/v2/geocoding_results.proto"; -import "google/maps/routing/v2/polyline.proto"; -import "google/maps/routing/v2/route.proto"; -import "google/maps/routing/v2/route_modifiers.proto"; -import "google/maps/routing/v2/route_travel_mode.proto"; -import "google/maps/routing/v2/routing_preference.proto"; -import "google/maps/routing/v2/traffic_model.proto"; -import "google/maps/routing/v2/transit_preferences.proto"; -import "google/maps/routing/v2/units.proto"; -import "google/maps/routing/v2/waypoint.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/localized_text.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RoutesServiceProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// The Routes API. -service Routes { - option (google.api.default_host) = "routes.googleapis.com"; - - // Returns the primary route along with optional alternate routes, given a set - // of terminal and intermediate waypoints. - // - // **NOTE:** This method requires that you specify a response field mask in - // the input. You can provide the response field mask by using URL parameter - // `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` - // (see the [available URL parameters and - // headers](https://cloud.google.com/apis/docs/system-parameters)). The value - // is a comma separated list of field paths. See detailed documentation about - // [how to construct the field - // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). - // - // For example, in this method: - // - // * Field mask of all available fields (for manual inspection): - // `X-Goog-FieldMask: *` - // * Field mask of Route-level duration, distance, and polyline (an example - // production setup): - // `X-Goog-FieldMask: - // routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` - // - // Google discourage the use of the wildcard (`*`) response field mask, or - // specifying the field mask at the top level (`routes`), because: - // - // * Selecting only the fields that you need helps our server save computation - // cycles, allowing us to return the result to you with a lower latency. - // * Selecting only the fields that you need - // in your production job ensures stable latency performance. We might add - // more response fields in the future, and those new fields might require - // extra computation time. If you select all fields, or if you select all - // fields at the top level, then you might experience performance degradation - // because any new field we add will be automatically included in the - // response. - // * Selecting only the fields that you need results in a smaller response - // size, and thus higher network throughput. - rpc ComputeRoutes(ComputeRoutesRequest) returns (ComputeRoutesResponse) { - option (google.api.http) = { - post: "/directions/v2:computeRoutes" - body: "*" - }; - } - - // Takes in a list of origins and destinations and returns a stream containing - // route information for each combination of origin and destination. - // - // **NOTE:** This method requires that you specify a response field mask in - // the input. You can provide the response field mask by using the URL - // parameter `$fields` or `fields`, or by using the HTTP/gRPC header - // `X-Goog-FieldMask` (see the [available URL parameters and - // headers](https://cloud.google.com/apis/docs/system-parameters)). - // The value is a comma separated list of field paths. See this detailed - // documentation about [how to construct the field - // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). - // - // For example, in this method: - // - // * Field mask of all available fields (for manual inspection): - // `X-Goog-FieldMask: *` - // * Field mask of route durations, distances, element status, condition, and - // element indices (an example production setup): - // `X-Goog-FieldMask: - // originIndex,destinationIndex,status,condition,distanceMeters,duration` - // - // It is critical that you include `status` in your field mask as otherwise - // all messages will appear to be OK. Google discourages the use of the - // wildcard (`*`) response field mask, because: - // - // * Selecting only the fields that you need helps our server save computation - // cycles, allowing us to return the result to you with a lower latency. - // * Selecting only the fields that you need in your production job ensures - // stable latency performance. We might add more response fields in the - // future, and those new fields might require extra computation time. If you - // select all fields, or if you select all fields at the top level, then you - // might experience performance degradation because any new field we add will - // be automatically included in the response. - // * Selecting only the fields that you need results in a smaller response - // size, and thus higher network throughput. - rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) - returns (stream RouteMatrixElement) { - option (google.api.http) = { - post: "/distanceMatrix/v2:computeRouteMatrix" - body: "*" - }; - } -} - -// ComputeRoutes request message. -message ComputeRoutesRequest { - // A supported reference route on the ComputeRoutesRequest. - enum ReferenceRoute { - // Not used. Requests containing this value fail. - REFERENCE_ROUTE_UNSPECIFIED = 0; - - // Fuel efficient route. - FUEL_EFFICIENT = 1; - - // Route with shorter travel distance. This is an experimental feature. - // - // For `DRIVE` requests, this feature prioritizes shorter distance over - // driving comfort. For example, it may prefer local roads instead of - // highways, take dirt roads, cut through parking lots, etc. This feature - // does not return any maneuvers that Google Maps knows to be illegal. - // - // For `BICYCLE` and `TWO_WHEELER` requests, this feature returns routes - // similar to those returned when you don't specify - // `requested_reference_routes`. - // - // This feature is not compatible with any other travel modes, via - // intermediate waypoints, or `optimize_waypoint_order`; such requests will - // fail. However, you can use it with any `routing_preference`. - SHORTER_DISTANCE = 2; - } - - // Extra computations to perform while completing the request. - enum ExtraComputation { - // Not used. Requests containing this value will fail. - EXTRA_COMPUTATION_UNSPECIFIED = 0; - - // Toll information for the route(s). - TOLLS = 1; - - // Estimated fuel consumption for the route(s). - FUEL_CONSUMPTION = 2; - - // Traffic aware polylines for the route(s). - TRAFFIC_ON_POLYLINE = 3; - - // [`NavigationInstructions`](google.maps.routing.v2.NavigationInstructions.instructions) - // presented as a formatted HTML text string. This content - // is meant to be read as-is. This content is for display only. - // Do not programmatically parse it. - HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4; - - // Flyover information for the route(s). The - // `routes.polyline_details.flyover_info` fieldmask must be specified to - // return this information. This data will only currently be populated for - // certain metros in India. This feature is experimental, and the - // SKU/charge is subject to change. - FLYOVER_INFO_ON_POLYLINE = 7; - - // Narrow road information for the route(s). The - // `routes.polyline_details.narrow_road_info` fieldmask must be specified - // to return this information. This data will only currently be populated - // for certain metros in India. This feature is experimental, and the - // SKU/charge is subject to change. - NARROW_ROAD_INFO_ON_POLYLINE = 8; - } - - // Required. Origin waypoint. - Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Destination waypoint. - Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A set of waypoints along the route (excluding terminal points), - // for either stopping at or passing by. Up to 25 intermediate waypoints are - // supported. - repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the mode of transportation. - RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies how to compute the route. The server - // attempts to use the selected routing preference to compute the route. If - // the routing preference results in an error or an extra long latency, then - // an error is returned. You can specify this option only when the - // `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - RoutingPreference routing_preference = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies your preference for the quality of the polyline. - PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the preferred encoding for the polyline. - PolylineEncoding polyline_encoding = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The departure time. If you don't set this value, then this value - // defaults to the time that you made the request. - // NOTE: You can only specify a `departure_time` in the past when - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to - // `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 - // days in the future. - google.protobuf.Timestamp departure_time = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The arrival time. - // NOTE: This field is ignored when requests specify a - // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] other than - // `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - // not both. Transit trips are available for up to 7 days in the past or 100 - // days in the future. - google.protobuf.Timestamp arrival_time = 19 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether to calculate alternate routes in addition to - // the route. No alternative routes are returned for requests that have - // intermediate waypoints. - bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of conditions to satisfy that affect the way routes are - // calculated. - RouteModifiers route_modifiers = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see [Unicode Locale - // Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - // See [Language - // Support](https://developers.google.com/maps/faq#languagesupport) - // for the list of supported languages. When you don't provide this value, the - // display language is inferred from the location of the route request. - string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The region code, specified as a ccTLD ("top-level domain") - // two-character value. For more information see [Country code top-level - // domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - string region_code = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the units of measure for the display fields. These - // fields include the `instruction` field in - // [`NavigationInstruction`][google.maps.routing.v2.NavigationInstruction]. - // The units of measure used for the route, leg, step distance, and duration - // are not affected by this value. If you don't provide this value, then the - // display units are inferred from the location of the first origin. - Units units = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, the service attempts to minimize the overall cost - // of the route by re-ordering the specified intermediate waypoints. The - // request fails if any of the intermediate waypoints is a `via` waypoint. Use - // `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to - // find the new ordering. - // If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is - // not requested in the `X-Goog-FieldMask` header, the request fails. - // If `optimize_waypoint_order` is set to false, - // `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be - // empty. - bool optimize_waypoint_order = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies what reference routes to calculate as part of the - // request in addition to the default route. A reference route is a route with - // a different route calculation objective than the default route. For example - // a `FUEL_EFFICIENT` reference route calculation takes into account various - // parameters that would generate an optimal fuel efficient route. When using - // this feature, look for - // [`route_labels`][google.maps.routing.v2.Route.route_labels] on the - // resulting routes. - repeated ReferenceRoute requested_reference_routes = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of extra computations which may be used to complete the - // request. Note: These extra computations may return extra fields on the - // response. These extra fields must also be specified in the field mask to be - // returned in the response. - repeated ExtraComputation extra_computations = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the assumptions to use when calculating time in - // traffic. This setting affects the value returned in the duration field in - // the - // [`Route`][google.maps.routing.v2.Route] and - // [`RouteLeg`][google.maps.routing.v2.RouteLeg] which contains the predicted - // time in traffic based on historical averages. - // `TrafficModel` is only available for requests that have set - // [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to - // `TRAFFIC_AWARE_OPTIMAL` and - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. - // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - // specified. - TrafficModel traffic_model = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies preferences that influence the route returned for - // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to - // `TRANSIT`. - TransitPreferences transit_preferences = 20 - [(google.api.field_behavior) = OPTIONAL]; -} - -// ComputeRoutes the response message. -message ComputeRoutesResponse { - // Contains an array of computed routes (up to three) when you specify - // `compute_alternatives_routes`, and contains just one route when you don't. - // When this array contains multiple entries, the first one is the most - // recommended route. If the array is empty, then it means no route could be - // found. - repeated Route routes = 1; - - // In some cases when the server is not able to compute the route results with - // all of the input preferences, it may fallback to using a different way of - // computation. When fallback mode is used, this field contains detailed info - // about the fallback response. Otherwise this field is unset. - FallbackInfo fallback_info = 2; - - // Contains geocoding response info for waypoints specified as addresses. - GeocodingResults geocoding_results = 3; -} - -// ComputeRouteMatrix request message -message ComputeRouteMatrixRequest { - // Extra computations to perform while completing the request. - enum ExtraComputation { - // Not used. Requests containing this value will fail. - EXTRA_COMPUTATION_UNSPECIFIED = 0; - - // Toll information for the matrix element(s). - TOLLS = 1; - } - - // Required. Array of origins, which determines the rows of the response - // matrix. Several size restrictions apply to the cardinality of origins and - // destinations: - // - // * The sum of the number of origins + the number of destinations specified - // as either `place_id` or `address` must be no greater than 50. - // * The product of number of origins × number of destinations must be no - // greater than 625 in any case. - // * The product of the number of origins × number of destinations must be no - // greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. - // * The product of the number of origins × number of destinations must be no - // greater than 100 if travel_mode is set to `TRANSIT`. - repeated RouteMatrixOrigin origins = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Array of destinations, which determines the columns of the - // response matrix. - repeated RouteMatrixDestination destinations = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies the mode of transportation. - RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies how to compute the route. The server attempts to use - // the selected routing preference to compute the route. If the routing - // preference results in an error or an extra long latency, an error is - // returned. You can specify this option only when the `travel_mode` is - // `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - RoutingPreference routing_preference = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The departure time. If you don't set this value, then this value - // defaults to the time that you made the request. - // NOTE: You can only specify a `departure_time` in the past when - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to - // `TRANSIT`. - google.protobuf.Timestamp departure_time = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The arrival time. - // NOTE: Can only be set when - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] is set to - // `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - // not both. - google.protobuf.Timestamp arrival_time = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see [Unicode Locale - // Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - // See [Language - // Support](https://developers.google.com/maps/faq#languagesupport) - // for the list of supported languages. When you don't provide this value, the - // display language is inferred from the location of the first origin. - string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The region code, specified as a ccTLD ("top-level domain") - // two-character value. For more information see [Country code top-level - // domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - string region_code = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the units of measure for the display fields. - Units units = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of extra computations which may be used to complete the - // request. Note: These extra computations may return extra fields on the - // response. These extra fields must also be specified in the field mask to be - // returned in the response. - repeated ExtraComputation extra_computations = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the assumptions to use when calculating time in - // traffic. This setting affects the value returned in the duration field in - // the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which - // contains the predicted time in traffic based on historical averages. - // `TrafficModel` is only available for requests that have set - // [RoutingPreference][google.maps.routing.v2.RoutingPreference] to - // `TRAFFIC_AWARE_OPTIMAL` and - // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. - // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - // specified. - TrafficModel traffic_model = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies preferences that influence the route returned for - // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to - // `TRANSIT`. - TransitPreferences transit_preferences = 12 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A single origin for ComputeRouteMatrixRequest -message RouteMatrixOrigin { - // Required. Origin waypoint - Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Modifiers for every route that takes this as the origin - RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A single destination for ComputeRouteMatrixRequest -message RouteMatrixDestination { - // Required. Destination waypoint - Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains route information computed for an origin/destination pair in the -// ComputeRouteMatrix API. This proto can be streamed to the client. -message RouteMatrixElement { - // Text representations of certain properties. - message LocalizedValues { - // Travel distance represented in text form. - google.type.LocalizedText distance = 1; - - // Duration represented in text form taking traffic conditions into - // consideration. Note: If traffic information was not requested, this value - // is the same value as static_duration. - google.type.LocalizedText duration = 2; - - // Duration represented in text form without taking traffic conditions into - // consideration. - google.type.LocalizedText static_duration = 3; - - // Transit fare represented in text form. - google.type.LocalizedText transit_fare = 4; - } - - // Zero-based index of the origin in the request. - optional int32 origin_index = 1; - - // Zero-based index of the destination in the request. - optional int32 destination_index = 2; - - // Error status code for this element. - google.rpc.Status status = 3; - - // Indicates whether the route was found or not. Independent of status. - RouteMatrixElementCondition condition = 9; - - // The travel distance of the route, in meters. - int32 distance_meters = 4; - - // The length of time needed to navigate the route. If you set the - // [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference] - // to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If - // you set the `routing_preference` to either `TRAFFIC_AWARE` or - // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic - // conditions into account. - google.protobuf.Duration duration = 5; - - // The duration of traveling through the route without taking traffic - // conditions into consideration. - google.protobuf.Duration static_duration = 6; - - // Additional information about the route. For example: restriction - // information and toll information - RouteTravelAdvisory travel_advisory = 7; - - // In some cases when the server is not able to compute the route with the - // given preferences for this particular origin/destination pair, it may - // fall back to using a different mode of computation. When fallback mode is - // used, this field contains detailed information about the fallback response. - // Otherwise this field is unset. - FallbackInfo fallback_info = 8; - - // Text representations of properties of the `RouteMatrixElement`. - LocalizedValues localized_values = 10; -} - -// The condition of the route being returned. -enum RouteMatrixElementCondition { - // Only used when the `status` of the element is not OK. - ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; - - // A route was found, and the corresponding information was filled out for the - // element. - ROUTE_EXISTS = 1; - - // No route could be found. Fields containing route information, such as - // `distance_meters` or `duration`, will not be filled out in the element. - ROUTE_NOT_FOUND = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto deleted file mode 100644 index e64b59c17be..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "RoutingPreferenceProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A set of values that specify factors to take into consideration when -// calculating the route. -enum RoutingPreference { - // No routing preference specified. Default to `TRAFFIC_UNAWARE`. - ROUTING_PREFERENCE_UNSPECIFIED = 0; - - // Computes routes without taking live traffic conditions into consideration. - // Suitable when traffic conditions don't matter or are not applicable. - // Using this value produces the lowest latency. - // Note: For [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] - // `DRIVE` and `TWO_WHEELER`, the route and duration chosen are based on road - // network and average time-independent traffic conditions, not current road - // conditions. Consequently, routes may include roads that are temporarily - // closed. Results for a given - // request may vary over time due to changes in the road network, updated - // average traffic conditions, and the distributed nature of the service. - // Results may also vary between nearly-equivalent routes at any time or - // frequency. - TRAFFIC_UNAWARE = 1; - - // Calculates routes taking live traffic conditions into consideration. - // In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to - // significantly reduce latency. - TRAFFIC_AWARE = 2; - - // Calculates the routes taking live traffic conditions into consideration, - // without applying most performance optimizations. Using this value produces - // the highest latency. - TRAFFIC_AWARE_OPTIMAL = 3; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto deleted file mode 100644 index e95803ffec0..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "SpeedReadingIntervalProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Traffic density indicator on a contiguous segment of a polyline or path. -// Given a path with points P_0, P_1, ... , P_N (zero-based index), the -// `SpeedReadingInterval` defines an interval and describes its traffic using -// the following categories. -message SpeedReadingInterval { - // The classification of polyline speed based on traffic data. - enum Speed { - // Default value. This value is unused. - SPEED_UNSPECIFIED = 0; - - // Normal speed, no traffic delays. - NORMAL = 1; - - // Slowdown detected, medium amount of traffic. - SLOW = 2; - - // Traffic delays. - TRAFFIC_JAM = 3; - } - - // The starting index of this interval in the polyline. - optional int32 start_polyline_point_index = 1; - - // The ending index of this interval in the polyline. - optional int32 end_polyline_point_index = 2; - - // The type of speed in this interval. - oneof speed_type { - // Traffic speed in this interval. - Speed speed = 3; - } -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto deleted file mode 100644 index b2296adeb3b..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/type/money.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "TollInfoProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Encapsulates toll information on a [`Route`][google.maps.routing.v2.Route] or -// on a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. -message TollInfo { - // The monetary amount of tolls for the corresponding - // [`Route`][google.maps.routing.v2.Route] or - // [`RouteLeg`][google.maps.routing.v2.RouteLeg]. This list contains a money - // amount for each currency that is expected to be charged by the toll - // stations. Typically this list will contain only one item for routes with - // tolls in one currency. For international trips, this list may contain - // multiple items to reflect tolls in different currencies. - repeated google.type.Money estimated_price = 1; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto deleted file mode 100644 index ee2b94091a9..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "TollPassesProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// List of toll passes around the world that we support. -enum TollPass { - // Not used. If this value is used, then the request fails. - TOLL_PASS_UNSPECIFIED = 0; - - // Sydney toll pass. See additional details at - // https://www.myetoll.com.au. - AU_ETOLL_TAG = 82; - - // Sydney toll pass. See additional details at https://www.tollpay.com.au. - AU_EWAY_TAG = 83; - - // Australia-wide toll pass. - // See additional details at https://www.linkt.com.au/. - AU_LINKT = 2; - - // Argentina toll pass. See additional details at https://telepase.com.ar - AR_TELEPASE = 3; - - // Brazil toll pass. See additional details at https://www.autoexpreso.com - BR_AUTO_EXPRESO = 81; - - // Brazil toll pass. See additional details at https://conectcar.com. - BR_CONECTCAR = 7; - - // Brazil toll pass. See additional details at https://movemais.com. - BR_MOVE_MAIS = 8; - - // Brazil toll pass. See additional details at https://pasorapido.gob.do/ - BR_PASSA_RAPIDO = 88; - - // Brazil toll pass. See additional details at https://www.semparar.com.br. - BR_SEM_PARAR = 9; - - // Brazil toll pass. See additional details at https://taggy.com.br. - BR_TAGGY = 10; - - // Brazil toll pass. See additional details at - // https://veloe.com.br/site/onde-usar. - BR_VELOE = 11; - - // Canada to United States border crossing. - CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; - - // Canada to United States border crossing. - CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; - - // Ontario, Canada to Michigan, United States border crossing. - CA_US_BLUE_WATER_EDGE_PASS = 18; - - // Ontario, Canada to Michigan, United States border crossing. - CA_US_CONNEXION = 19; - - // Canada to United States border crossing. - CA_US_NEXUS_CARD = 20; - - // Indonesia. - // E-card provided by multiple banks used to pay for tolls. All e-cards - // via banks are charged the same so only one enum value is needed. E.g. - // - Bank Mandiri https://www.bankmandiri.co.id/e-money - // - BCA https://www.bca.co.id/flazz - // - BNI https://www.bni.co.id/id-id/ebanking/tapcash - ID_E_TOLL = 16; - - // India. - IN_FASTAG = 78; - - // India, HP state plate exemption. - IN_LOCAL_HP_PLATE_EXEMPT = 79; - - // Japan - // ETC. Electronic wireless system to collect tolls. - // https://www.go-etc.jp/ - JP_ETC = 98; - - // Japan - // ETC2.0. New version of ETC with further discount and bidirectional - // communication between devices on vehicles and antennas on the road. - // https://www.go-etc.jp/etc2/index.html - JP_ETC2 = 99; - - // Mexico toll pass. - // https://iave.capufe.gob.mx/#/ - MX_IAVE = 90; - - // Mexico - // https://www.pase.com.mx - MX_PASE = 91; - - // Mexico - // https://operadoravial.com/quick-pass/ - MX_QUICKPASS = 93; - - // http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf - MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; - - // Mexico - MX_TAG_IAVE = 12; - - // Mexico toll pass company. One of many operating in Mexico City. See - // additional details at https://www.televia.com.mx. - MX_TAG_TELEVIA = 13; - - // Mexico toll pass company. One of many operating in Mexico City. - // https://www.televia.com.mx - MX_TELEVIA = 92; - - // Mexico toll pass. See additional details at - // https://www.viapass.com.mx/viapass/web_home.aspx. - MX_VIAPASS = 14; - - // AL, USA. - US_AL_FREEDOM_PASS = 21; - - // AK, USA. - US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; - - // CA, USA. - US_CA_FASTRAK = 4; - - // Indicates driver has any FasTrak pass in addition to the DMV issued Clean - // Air Vehicle (CAV) sticker. - // https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml - US_CA_FASTRAK_CAV_STICKER = 86; - - // CO, USA. - US_CO_EXPRESSTOLL = 23; - - // CO, USA. - US_CO_GO_PASS = 24; - - // DE, USA. - US_DE_EZPASSDE = 25; - - // FL, USA. - US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; - - // FL, USA. - US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; - - // FL, USA. - US_FL_EPASS = 67; - - // FL, USA. - US_FL_GIBA_TOLL_PASS = 68; - - // FL, USA. - US_FL_LEEWAY = 69; - - // FL, USA. - US_FL_SUNPASS = 70; - - // FL, USA. - US_FL_SUNPASS_PRO = 71; - - // IL, USA. - US_IL_EZPASSIL = 73; - - // IL, USA. - US_IL_IPASS = 72; - - // IN, USA. - US_IN_EZPASSIN = 26; - - // KS, USA. - US_KS_BESTPASS_HORIZON = 27; - - // KS, USA. - US_KS_KTAG = 28; - - // KS, USA. - US_KS_NATIONALPASS = 29; - - // KS, USA. - US_KS_PREPASS_ELITEPASS = 30; - - // KY, USA. - US_KY_RIVERLINK = 31; - - // LA, USA. - US_LA_GEAUXPASS = 32; - - // LA, USA. - US_LA_TOLL_TAG = 33; - - // MA, USA. - US_MA_EZPASSMA = 6; - - // MD, USA. - US_MD_EZPASSMD = 34; - - // ME, USA. - US_ME_EZPASSME = 35; - - // MI, USA. - US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; - - // MI, USA. - US_MI_BCPASS = 94; - - // MI, USA. - US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; - - // MI, USA. - // Deprecated as this pass type no longer exists. - US_MI_IQ_PROX_CARD = 38 [deprecated = true]; - - // MI, USA. - US_MI_IQ_TAG = 95; - - // MI, USA. - US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; - - // MI, USA. - US_MI_NEXPRESS_TOLL = 40; - - // MN, USA. - US_MN_EZPASSMN = 41; - - // NC, USA. - US_NC_EZPASSNC = 42; - - // NC, USA. - US_NC_PEACH_PASS = 87; - - // NC, USA. - US_NC_QUICK_PASS = 43; - - // NH, USA. - US_NH_EZPASSNH = 80; - - // NJ, USA. - US_NJ_DOWNBEACH_EXPRESS_PASS = 75; - - // NJ, USA. - US_NJ_EZPASSNJ = 74; - - // NY, USA. - US_NY_EXPRESSPASS = 76; - - // NY, USA. - US_NY_EZPASSNY = 77; - - // OH, USA. - US_OH_EZPASSOH = 44; - - // PA, USA. - US_PA_EZPASSPA = 45; - - // RI, USA. - US_RI_EZPASSRI = 46; - - // SC, USA. - US_SC_PALPASS = 47; - - // TX, USA. - US_TX_AVI_TAG = 97; - - // TX, USA. - US_TX_BANCPASS = 48; - - // TX, USA. - US_TX_DEL_RIO_PASS = 49; - - // TX, USA. - US_TX_EFAST_PASS = 50; - - // TX, USA. - US_TX_EAGLE_PASS_EXPRESS_CARD = 51; - - // TX, USA. - US_TX_EPTOLL = 52; - - // TX, USA. - US_TX_EZ_CROSS = 53; - - // TX, USA. - US_TX_EZTAG = 54; - - // TX, USA. - US_TX_FUEGO_TAG = 96; - - // TX, USA. - US_TX_LAREDO_TRADE_TAG = 55; - - // TX, USA. - US_TX_PLUSPASS = 56; - - // TX, USA. - US_TX_TOLLTAG = 57; - - // TX, USA. - US_TX_TXTAG = 58; - - // TX, USA. - US_TX_XPRESS_CARD = 59; - - // UT, USA. - US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; - - // VA, USA. - US_VA_EZPASSVA = 61; - - // WA, USA. - US_WA_BREEZEBY = 17; - - // WA, USA. - US_WA_GOOD_TO_GO = 1; - - // WV, USA. - US_WV_EZPASSWV = 62; - - // WV, USA. - US_WV_MEMORIAL_BRIDGE_TICKETS = 63; - - // WV, USA - US_WV_MOV_PASS = 100; - - // WV, USA. - US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto deleted file mode 100644 index d680e1c46c1..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "TrafficModelProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// This field specifies one of the following assumptions to use when calculating -// travel time in traffic conditions, shown in the enums below. Depending on the -// enum chosen, the `duration` field of the TrafficModel response will vary. The -// value contains the predicted time to destination in traffic, based on -// historical averages. `TrafficModel` is only available for requests that have -// set [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to -// `TRAFFIC_AWARE_OPTIMAL` and -// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. -enum TrafficModel { - // Unused. If specified, will default to `BEST_GUESS`. - TRAFFIC_MODEL_UNSPECIFIED = 0; - - // Indicates that the returned `duration` should be the best - // estimate of travel time given what is known about both historical traffic - // conditions and live traffic. Live traffic becomes more important the closer - // the `departure_time` is to now. - BEST_GUESS = 1; - - // Indicates that the returned duration should be longer than the - // actual travel time on most days, though occasional days with particularly - // bad traffic conditions may exceed this value. - PESSIMISTIC = 2; - - // Indicates that the returned duration should be shorter than the actual - // travel time on most days, though occasional days with particularly good - // traffic conditions may be faster than this value. - OPTIMISTIC = 3; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto deleted file mode 100644 index 295a3203f73..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit.proto +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/maps/routing/v2/location.proto"; -import "google/type/localized_text.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "TransitProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A transit agency that operates a transit line. -message TransitAgency { - // The name of this transit agency. - string name = 1; - - // The transit agency's locale-specific formatted phone number. - string phone_number = 2; - - // The transit agency's URI. - string uri = 3; -} - -// Contains information about the transit line used in this step. -message TransitLine { - // The transit agency (or agencies) that operates this transit line. - repeated TransitAgency agencies = 1; - - // The full name of this transit line, For example, "8 Avenue Local". - string name = 2; - - // the URI for this transit line as provided by the transit agency. - string uri = 3; - - // The color commonly used in signage for this line. Represented in - // hexadecimal. - string color = 4; - - // The URI for the icon associated with this line. - string icon_uri = 5; - - // The short name of this transit line. This name will normally be a line - // number, such as "M7" or "355". - string name_short = 6; - - // The color commonly used in text on signage for this line. Represented in - // hexadecimal. - string text_color = 7; - - // The type of vehicle that operates on this transit line. - TransitVehicle vehicle = 8; -} - -// Information about a transit stop. -message TransitStop { - // The name of the transit stop. - string name = 1; - - // The location of the stop expressed in latitude/longitude coordinates. - Location location = 2; -} - -// Information about a vehicle used in transit routes. -message TransitVehicle { - // The type of vehicles for transit routes. - enum TransitVehicleType { - // Unused. - TRANSIT_VEHICLE_TYPE_UNSPECIFIED = 0; - - // Bus. - BUS = 1; - - // A vehicle that operates on a cable, usually on the ground. Aerial cable - // cars may be of the type `GONDOLA_LIFT`. - CABLE_CAR = 2; - - // Commuter rail. - COMMUTER_TRAIN = 3; - - // Ferry. - FERRY = 4; - - // A vehicle that is pulled up a steep incline by a cable. A Funicular - // typically consists of two cars, with each car acting as a counterweight - // for the other. - FUNICULAR = 5; - - // An aerial cable car. - GONDOLA_LIFT = 6; - - // Heavy rail. - HEAVY_RAIL = 7; - - // High speed train. - HIGH_SPEED_TRAIN = 8; - - // Intercity bus. - INTERCITY_BUS = 9; - - // Long distance train. - LONG_DISTANCE_TRAIN = 10; - - // Light rail transit. - METRO_RAIL = 11; - - // Monorail. - MONORAIL = 12; - - // All other vehicles. - OTHER = 13; - - // Rail. - RAIL = 14; - - // Share taxi is a kind of bus with the ability to drop off and pick up - // passengers anywhere on its route. - SHARE_TAXI = 15; - - // Underground light rail. - SUBWAY = 16; - - // Above ground light rail. - TRAM = 17; - - // Trolleybus. - TROLLEYBUS = 18; - } - - // The name of this vehicle, capitalized. - google.type.LocalizedText name = 1; - - // The type of vehicle used. - TransitVehicleType type = 2; - - // The URI for an icon associated with this vehicle type. - string icon_uri = 3; - - // The URI for the icon associated with this vehicle type, based on the local - // transport signage. - string local_icon_uri = 4; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto deleted file mode 100644 index 0f977cdd1b4..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "TransitPreferencesProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Preferences for `TRANSIT` based routes that influence the route that is -// returned. -message TransitPreferences { - // A set of values used to specify the mode of transit. - enum TransitTravelMode { - // No transit travel mode specified. - TRANSIT_TRAVEL_MODE_UNSPECIFIED = 0; - - // Travel by bus. - BUS = 1; - - // Travel by subway. - SUBWAY = 2; - - // Travel by train. - TRAIN = 3; - - // Travel by light rail or tram. - LIGHT_RAIL = 4; - - // Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`, - // and `LIGHT_RAIL`. - RAIL = 5; - } - - // Specifies routing preferences for transit routes. - enum TransitRoutingPreference { - // No preference specified. - TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED = 0; - - // Indicates that the calculated route should prefer limited amounts of - // walking. - LESS_WALKING = 1; - - // Indicates that the calculated route should prefer a limited number of - // transfers. - FEWER_TRANSFERS = 2; - } - - // A set of travel modes to use when getting a `TRANSIT` route. Defaults to - // all supported modes of travel. - repeated TransitTravelMode allowed_travel_modes = 1; - - // A routing preference that, when specified, influences the `TRANSIT` route - // returned. - TransitRoutingPreference routing_preference = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto deleted file mode 100644 index e073a136bb6..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/units.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "UnitsProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A set of values that specify the unit of measure used in the display. -enum Units { - // Units of measure not specified. Defaults to the unit of measure inferred - // from the request. - UNITS_UNSPECIFIED = 0; - - // Metric units of measure. - METRIC = 1; - - // Imperial (English) units of measure. - IMPERIAL = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto deleted file mode 100644 index 285fe8c3bc5..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "VehicleEmissionTypeProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// A set of values describing the vehicle's emission type. -// Applies only to the `DRIVE` -// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. -enum VehicleEmissionType { - // No emission type specified. Default to `GASOLINE`. - VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; - - // Gasoline/petrol fueled vehicle. - GASOLINE = 1; - - // Electricity powered vehicle. - ELECTRIC = 2; - - // Hybrid fuel (such as gasoline + electric) vehicle. - HYBRID = 3; - - // Diesel fueled vehicle. - DIESEL = 4; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto deleted file mode 100644 index 6e40a2adb70..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/maps/routing/v2/vehicle_emission_type.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "VehicleInfoProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Contains the vehicle information, such as the vehicle emission type. -message VehicleInfo { - // Describes the vehicle's emission type. - // Applies only to the `DRIVE` - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - VehicleEmissionType emission_type = 2; -} diff --git a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto b/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto deleted file mode 100644 index 05c7bd1fdf2..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.maps.routing.v2; - -import "google/maps/routing/v2/location.proto"; - -option csharp_namespace = "Google.Maps.Routing.V2"; -option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; -option java_multiple_files = true; -option java_outer_classname = "WaypointProto"; -option java_package = "com.google.maps.routing.v2"; -option objc_class_prefix = "GMRV2"; -option php_namespace = "Google\\Maps\\Routing\\V2"; -option ruby_package = "Google::Maps::Routing::V2"; - -// Encapsulates a waypoint. Waypoints mark both the beginning and end of a -// route, and include intermediate stops along the route. -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; - - // Human readable address or a plus code. - // See https://plus.codes for details. - string address = 7; - - // A token that identifies a - // [`NavigationPoint`](https://developers.google.com/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations/searchDestinations#navigationpoint), - // obtained from the `SearchDestinations` method of the Geocoding API. - string navigation_point_token = 8; - } - - // Marks this waypoint as a milestone rather a stopping point. For - // each non-via waypoint in the request, the response appends an entry to the - // [`legs`][google.maps.routing.v2.Route.legs] - // array to provide the details for stopovers on that leg of the trip. Set - // this value to true when you want the route to pass through this waypoint - // without stopping over. Via waypoints don't cause an entry to be added to - // the `legs` array, but they do route the journey through the waypoint. You - // can only set this value on waypoints that are intermediates. The request - // fails if you set this field on terminal waypoints. If - // `ComputeRoutesRequest.optimize_waypoint_order` is set to true then this - // field cannot be set to true; otherwise, the request fails. - bool via = 3; - - // Indicates that the waypoint is meant for vehicles to stop at, where the - // intention is to either pickup or drop-off. When you set this value, the - // calculated route won't include non-`via` waypoints on roads that are - // unsuitable for pickup and drop-off. This option works only for `DRIVE` and - // `TWO_WHEELER` travel modes, and when the `location_type` is - // [`Location`][google.maps.routing.v2.Location]. - bool vehicle_stopover = 4; - - // 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 works only for `DRIVE` and `TWO_WHEELER` - // [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode]. - bool side_of_road = 5; -} diff --git a/owl-bot-staging/google-maps-routing/protos/protos.d.ts b/owl-bot-staging/google-maps-routing/protos/protos.d.ts deleted file mode 100644 index e210ac2e81c..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/protos.d.ts +++ /dev/null @@ -1,13379 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not 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.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload 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.DoubleValue; - - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not 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.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload 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.FloatValue; - - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not 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.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload 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.Int64Value; - - /** - * Verifies an Int64Value message. - * @param message Plain 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 Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not 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.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload 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.UInt64Value; - - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not 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.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload 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.Int32Value; - - /** - * Verifies an Int32Value message. - * @param message Plain 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 Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not 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.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload 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.UInt32Value; - - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not 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.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload 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.BoolValue; - - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not 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.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload 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.StringValue; - - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not 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.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload 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.BytesValue; - - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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 geo. */ - namespace geo { - - /** Namespace type. */ - namespace type { - - /** Properties of a Viewport. */ - interface IViewport { - - /** Viewport low */ - low?: (google.type.ILatLng|null); - - /** Viewport high */ - high?: (google.type.ILatLng|null); - } - - /** Represents a Viewport. */ - class Viewport implements IViewport { - - /** - * Constructs a new Viewport. - * @param [properties] Properties to set - */ - constructor(properties?: google.geo.type.IViewport); - - /** Viewport low. */ - public low?: (google.type.ILatLng|null); - - /** Viewport high. */ - public high?: (google.type.ILatLng|null); - - /** - * Creates a new Viewport instance using the specified properties. - * @param [properties] Properties to set - * @returns Viewport instance - */ - public static create(properties?: google.geo.type.IViewport): google.geo.type.Viewport; - - /** - * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. - * @param message Viewport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. - * @param message Viewport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Viewport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Viewport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.geo.type.Viewport; - - /** - * Decodes a Viewport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Viewport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.geo.type.Viewport; - - /** - * Verifies a Viewport message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Viewport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Viewport - */ - public static fromObject(object: { [k: string]: any }): google.geo.type.Viewport; - - /** - * Creates a plain object from a Viewport message. Also converts values to other types if specified. - * @param message Viewport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.geo.type.Viewport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Viewport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Viewport - * @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; - } - - /** Properties of a LocalizedText. */ - interface ILocalizedText { - - /** LocalizedText text */ - text?: (string|null); - - /** LocalizedText languageCode */ - languageCode?: (string|null); - } - - /** Represents a LocalizedText. */ - class LocalizedText implements ILocalizedText { - - /** - * Constructs a new LocalizedText. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILocalizedText); - - /** LocalizedText text. */ - public text: string; - - /** LocalizedText languageCode. */ - public languageCode: string; - - /** - * Creates a new LocalizedText instance using the specified properties. - * @param [properties] Properties to set - * @returns LocalizedText instance - */ - public static create(properties?: google.type.ILocalizedText): google.type.LocalizedText; - - /** - * Encodes the specified LocalizedText message. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. - * @param message LocalizedText message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.ILocalizedText, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocalizedText message, length delimited. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. - * @param message LocalizedText message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.ILocalizedText, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocalizedText message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocalizedText - * @throws {Error} If the payload is not 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.LocalizedText; - - /** - * Decodes a LocalizedText message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocalizedText - * @throws {Error} If the payload 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.LocalizedText; - - /** - * Verifies a LocalizedText message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocalizedText message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocalizedText - */ - public static fromObject(object: { [k: string]: any }): google.type.LocalizedText; - - /** - * Creates a plain object from a LocalizedText message. Also converts values to other types if specified. - * @param message LocalizedText - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LocalizedText, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocalizedText to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocalizedText - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Money. */ - interface IMoney { - - /** Money currencyCode */ - currencyCode?: (string|null); - - /** Money units */ - units?: (number|Long|string|null); - - /** Money nanos */ - nanos?: (number|null); - } - - /** Represents a Money. */ - class Money implements IMoney { - - /** - * Constructs a new Money. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IMoney); - - /** Money currencyCode. */ - public currencyCode: string; - - /** Money units. */ - public units: (number|Long|string); - - /** Money nanos. */ - public nanos: number; - - /** - * Creates a new Money instance using the specified properties. - * @param [properties] Properties to set - * @returns Money instance - */ - public static create(properties?: google.type.IMoney): google.type.Money; - - /** - * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @param message Money message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @param message Money message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Money message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Money - * @throws {Error} If the payload is not 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.Money; - - /** - * Decodes a Money message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Money - * @throws {Error} If the payload 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.Money; - - /** - * Verifies a Money message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Money message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Money - */ - public static fromObject(object: { [k: string]: any }): google.type.Money; - - /** - * Creates a plain object from a Money message. Also converts values to other types if specified. - * @param message Money - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Money to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Money - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace maps. */ - namespace maps { - - /** Namespace routing. */ - namespace routing { - - /** Namespace v2. */ - namespace v2 { - - /** Properties of a FallbackInfo. */ - interface IFallbackInfo { - - /** FallbackInfo routingMode */ - routingMode?: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode|null); - - /** FallbackInfo reason */ - reason?: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason|null); - } - - /** Represents a FallbackInfo. */ - class FallbackInfo implements IFallbackInfo { - - /** - * Constructs a new FallbackInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IFallbackInfo); - - /** FallbackInfo routingMode. */ - public routingMode: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode); - - /** FallbackInfo reason. */ - public reason: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason); - - /** - * Creates a new FallbackInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FallbackInfo instance - */ - public static create(properties?: google.maps.routing.v2.IFallbackInfo): google.maps.routing.v2.FallbackInfo; - - /** - * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. - * @param message FallbackInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. - * @param message FallbackInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FallbackInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FallbackInfo - * @throws {Error} If the payload is not 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.routing.v2.FallbackInfo; - - /** - * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FallbackInfo - * @throws {Error} If the payload 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.routing.v2.FallbackInfo; - - /** - * Verifies a FallbackInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FallbackInfo - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.FallbackInfo; - - /** - * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. - * @param message FallbackInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.FallbackInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FallbackInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FallbackInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** FallbackReason enum. */ - enum FallbackReason { - FALLBACK_REASON_UNSPECIFIED = 0, - SERVER_ERROR = 1, - LATENCY_EXCEEDED = 2 - } - - /** FallbackRoutingMode enum. */ - enum FallbackRoutingMode { - FALLBACK_ROUTING_MODE_UNSPECIFIED = 0, - FALLBACK_TRAFFIC_UNAWARE = 1, - FALLBACK_TRAFFIC_AWARE = 2 - } - - /** Properties of a GeocodingResults. */ - interface IGeocodingResults { - - /** GeocodingResults origin */ - origin?: (google.maps.routing.v2.IGeocodedWaypoint|null); - - /** GeocodingResults destination */ - destination?: (google.maps.routing.v2.IGeocodedWaypoint|null); - - /** GeocodingResults intermediates */ - intermediates?: (google.maps.routing.v2.IGeocodedWaypoint[]|null); - } - - /** Represents a GeocodingResults. */ - class GeocodingResults implements IGeocodingResults { - - /** - * Constructs a new GeocodingResults. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IGeocodingResults); - - /** GeocodingResults origin. */ - public origin?: (google.maps.routing.v2.IGeocodedWaypoint|null); - - /** GeocodingResults destination. */ - public destination?: (google.maps.routing.v2.IGeocodedWaypoint|null); - - /** GeocodingResults intermediates. */ - public intermediates: google.maps.routing.v2.IGeocodedWaypoint[]; - - /** - * Creates a new GeocodingResults instance using the specified properties. - * @param [properties] Properties to set - * @returns GeocodingResults instance - */ - public static create(properties?: google.maps.routing.v2.IGeocodingResults): google.maps.routing.v2.GeocodingResults; - - /** - * Encodes the specified GeocodingResults message. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. - * @param message GeocodingResults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IGeocodingResults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeocodingResults message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. - * @param message GeocodingResults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IGeocodingResults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeocodingResults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeocodingResults - * @throws {Error} If the payload is not 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.routing.v2.GeocodingResults; - - /** - * Decodes a GeocodingResults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeocodingResults - * @throws {Error} If the payload 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.routing.v2.GeocodingResults; - - /** - * Verifies a GeocodingResults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeocodingResults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeocodingResults - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.GeocodingResults; - - /** - * Creates a plain object from a GeocodingResults message. Also converts values to other types if specified. - * @param message GeocodingResults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.GeocodingResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeocodingResults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeocodingResults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GeocodedWaypoint. */ - interface IGeocodedWaypoint { - - /** GeocodedWaypoint geocoderStatus */ - geocoderStatus?: (google.rpc.IStatus|null); - - /** GeocodedWaypoint intermediateWaypointRequestIndex */ - intermediateWaypointRequestIndex?: (number|null); - - /** GeocodedWaypoint type */ - type?: (string[]|null); - - /** GeocodedWaypoint partialMatch */ - partialMatch?: (boolean|null); - - /** GeocodedWaypoint placeId */ - placeId?: (string|null); - } - - /** Represents a GeocodedWaypoint. */ - class GeocodedWaypoint implements IGeocodedWaypoint { - - /** - * Constructs a new GeocodedWaypoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IGeocodedWaypoint); - - /** GeocodedWaypoint geocoderStatus. */ - public geocoderStatus?: (google.rpc.IStatus|null); - - /** GeocodedWaypoint intermediateWaypointRequestIndex. */ - public intermediateWaypointRequestIndex?: (number|null); - - /** GeocodedWaypoint type. */ - public type: string[]; - - /** GeocodedWaypoint partialMatch. */ - public partialMatch: boolean; - - /** GeocodedWaypoint placeId. */ - public placeId: string; - - /** - * Creates a new GeocodedWaypoint instance using the specified properties. - * @param [properties] Properties to set - * @returns GeocodedWaypoint instance - */ - public static create(properties?: google.maps.routing.v2.IGeocodedWaypoint): google.maps.routing.v2.GeocodedWaypoint; - - /** - * Encodes the specified GeocodedWaypoint message. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. - * @param message GeocodedWaypoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IGeocodedWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeocodedWaypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. - * @param message GeocodedWaypoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IGeocodedWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeocodedWaypoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeocodedWaypoint - * @throws {Error} If the payload is not 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.routing.v2.GeocodedWaypoint; - - /** - * Decodes a GeocodedWaypoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeocodedWaypoint - * @throws {Error} If the payload 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.routing.v2.GeocodedWaypoint; - - /** - * Verifies a GeocodedWaypoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeocodedWaypoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeocodedWaypoint - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.GeocodedWaypoint; - - /** - * Creates a plain object from a GeocodedWaypoint message. Also converts values to other types if specified. - * @param message GeocodedWaypoint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.GeocodedWaypoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeocodedWaypoint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeocodedWaypoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LocalizedTime. */ - interface ILocalizedTime { - - /** LocalizedTime time */ - time?: (google.type.ILocalizedText|null); - - /** LocalizedTime timeZone */ - timeZone?: (string|null); - } - - /** Represents a LocalizedTime. */ - class LocalizedTime implements ILocalizedTime { - - /** - * Constructs a new LocalizedTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ILocalizedTime); - - /** LocalizedTime time. */ - public time?: (google.type.ILocalizedText|null); - - /** LocalizedTime timeZone. */ - public timeZone: string; - - /** - * Creates a new LocalizedTime instance using the specified properties. - * @param [properties] Properties to set - * @returns LocalizedTime instance - */ - public static create(properties?: google.maps.routing.v2.ILocalizedTime): google.maps.routing.v2.LocalizedTime; - - /** - * Encodes the specified LocalizedTime message. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. - * @param message LocalizedTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ILocalizedTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocalizedTime message, length delimited. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. - * @param message LocalizedTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ILocalizedTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocalizedTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocalizedTime - * @throws {Error} If the payload is not 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.routing.v2.LocalizedTime; - - /** - * Decodes a LocalizedTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocalizedTime - * @throws {Error} If the payload 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.routing.v2.LocalizedTime; - - /** - * Verifies a LocalizedTime message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocalizedTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocalizedTime - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.LocalizedTime; - - /** - * Creates a plain object from a LocalizedTime message. Also converts values to other types if specified. - * @param message LocalizedTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.LocalizedTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocalizedTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocalizedTime - * @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?: (google.protobuf.IInt32Value|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ILocation); - - /** Location latLng. */ - public latLng?: (google.type.ILatLng|null); - - /** Location heading. */ - public heading?: (google.protobuf.IInt32Value|null); - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.maps.routing.v2.ILocation): google.maps.routing.v2.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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; - } - - /** Maneuver enum. */ - enum Maneuver { - MANEUVER_UNSPECIFIED = 0, - TURN_SLIGHT_LEFT = 1, - TURN_SHARP_LEFT = 2, - UTURN_LEFT = 3, - TURN_LEFT = 4, - TURN_SLIGHT_RIGHT = 5, - TURN_SHARP_RIGHT = 6, - UTURN_RIGHT = 7, - TURN_RIGHT = 8, - STRAIGHT = 9, - RAMP_LEFT = 10, - RAMP_RIGHT = 11, - MERGE = 12, - FORK_LEFT = 13, - FORK_RIGHT = 14, - FERRY = 15, - FERRY_TRAIN = 16, - ROUNDABOUT_LEFT = 17, - ROUNDABOUT_RIGHT = 18, - DEPART = 19, - NAME_CHANGE = 20 - } - - /** Properties of a NavigationInstruction. */ - interface INavigationInstruction { - - /** NavigationInstruction maneuver */ - maneuver?: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver|null); - - /** NavigationInstruction instructions */ - instructions?: (string|null); - } - - /** Represents a NavigationInstruction. */ - class NavigationInstruction implements INavigationInstruction { - - /** - * Constructs a new NavigationInstruction. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.INavigationInstruction); - - /** NavigationInstruction maneuver. */ - public maneuver: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver); - - /** NavigationInstruction instructions. */ - public instructions: string; - - /** - * Creates a new NavigationInstruction instance using the specified properties. - * @param [properties] Properties to set - * @returns NavigationInstruction instance - */ - public static create(properties?: google.maps.routing.v2.INavigationInstruction): google.maps.routing.v2.NavigationInstruction; - - /** - * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. - * @param message NavigationInstruction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. - * @param message NavigationInstruction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NavigationInstruction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NavigationInstruction - * @throws {Error} If the payload is not 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.routing.v2.NavigationInstruction; - - /** - * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NavigationInstruction - * @throws {Error} If the payload 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.routing.v2.NavigationInstruction; - - /** - * Verifies a NavigationInstruction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NavigationInstruction - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.NavigationInstruction; - - /** - * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. - * @param message NavigationInstruction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.NavigationInstruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NavigationInstruction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NavigationInstruction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Polyline. */ - interface IPolyline { - - /** Polyline encodedPolyline */ - encodedPolyline?: (string|null); - - /** Polyline geoJsonLinestring */ - geoJsonLinestring?: (google.protobuf.IStruct|null); - } - - /** Represents a Polyline. */ - class Polyline implements IPolyline { - - /** - * Constructs a new Polyline. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IPolyline); - - /** Polyline encodedPolyline. */ - public encodedPolyline?: (string|null); - - /** Polyline geoJsonLinestring. */ - public geoJsonLinestring?: (google.protobuf.IStruct|null); - - /** Polyline polylineType. */ - public polylineType?: ("encodedPolyline"|"geoJsonLinestring"); - - /** - * Creates a new Polyline instance using the specified properties. - * @param [properties] Properties to set - * @returns Polyline instance - */ - public static create(properties?: google.maps.routing.v2.IPolyline): google.maps.routing.v2.Polyline; - - /** - * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. - * @param message Polyline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. - * @param message Polyline message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Polyline message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Polyline - * @throws {Error} If the payload is not 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.routing.v2.Polyline; - - /** - * Decodes a Polyline message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Polyline - * @throws {Error} If the payload 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.routing.v2.Polyline; - - /** - * Verifies a Polyline message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Polyline message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Polyline - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Polyline; - - /** - * Creates a plain object from a Polyline message. Also converts values to other types if specified. - * @param message Polyline - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.Polyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Polyline to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Polyline - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** PolylineQuality enum. */ - enum PolylineQuality { - POLYLINE_QUALITY_UNSPECIFIED = 0, - HIGH_QUALITY = 1, - OVERVIEW = 2 - } - - /** PolylineEncoding enum. */ - enum PolylineEncoding { - POLYLINE_ENCODING_UNSPECIFIED = 0, - ENCODED_POLYLINE = 1, - GEO_JSON_LINESTRING = 2 - } - - /** Properties of a PolylineDetails. */ - interface IPolylineDetails { - - /** PolylineDetails flyoverInfo */ - flyoverInfo?: (google.maps.routing.v2.PolylineDetails.IFlyoverInfo[]|null); - - /** PolylineDetails narrowRoadInfo */ - narrowRoadInfo?: (google.maps.routing.v2.PolylineDetails.INarrowRoadInfo[]|null); - } - - /** Represents a PolylineDetails. */ - class PolylineDetails implements IPolylineDetails { - - /** - * Constructs a new PolylineDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IPolylineDetails); - - /** PolylineDetails flyoverInfo. */ - public flyoverInfo: google.maps.routing.v2.PolylineDetails.IFlyoverInfo[]; - - /** PolylineDetails narrowRoadInfo. */ - public narrowRoadInfo: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo[]; - - /** - * Creates a new PolylineDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns PolylineDetails instance - */ - public static create(properties?: google.maps.routing.v2.IPolylineDetails): google.maps.routing.v2.PolylineDetails; - - /** - * Encodes the specified PolylineDetails message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. - * @param message PolylineDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IPolylineDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolylineDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. - * @param message PolylineDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IPolylineDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolylineDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolylineDetails - * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails; - - /** - * Decodes a PolylineDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolylineDetails - * @throws {Error} If the payload 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.routing.v2.PolylineDetails; - - /** - * Verifies a PolylineDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolylineDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolylineDetails - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails; - - /** - * Creates a plain object from a PolylineDetails message. Also converts values to other types if specified. - * @param message PolylineDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.PolylineDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolylineDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolylineDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PolylineDetails { - - /** Properties of a PolylinePointIndex. */ - interface IPolylinePointIndex { - - /** PolylinePointIndex startIndex */ - startIndex?: (number|null); - - /** PolylinePointIndex endIndex */ - endIndex?: (number|null); - } - - /** Represents a PolylinePointIndex. */ - class PolylinePointIndex implements IPolylinePointIndex { - - /** - * Constructs a new PolylinePointIndex. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex); - - /** PolylinePointIndex startIndex. */ - public startIndex?: (number|null); - - /** PolylinePointIndex endIndex. */ - public endIndex?: (number|null); - - /** - * Creates a new PolylinePointIndex instance using the specified properties. - * @param [properties] Properties to set - * @returns PolylinePointIndex instance - */ - public static create(properties?: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex): google.maps.routing.v2.PolylineDetails.PolylinePointIndex; - - /** - * Encodes the specified PolylinePointIndex message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. - * @param message PolylinePointIndex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolylinePointIndex message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. - * @param message PolylinePointIndex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.IPolylinePointIndex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolylinePointIndex message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolylinePointIndex - * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.PolylinePointIndex; - - /** - * Decodes a PolylinePointIndex message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolylinePointIndex - * @throws {Error} If the payload 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.routing.v2.PolylineDetails.PolylinePointIndex; - - /** - * Verifies a PolylinePointIndex message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolylinePointIndex message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolylinePointIndex - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.PolylinePointIndex; - - /** - * Creates a plain object from a PolylinePointIndex message. Also converts values to other types if specified. - * @param message PolylinePointIndex - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.PolylineDetails.PolylinePointIndex, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolylinePointIndex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolylinePointIndex - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** RoadFeatureState enum. */ - enum RoadFeatureState { - ROAD_FEATURE_STATE_UNSPECIFIED = 0, - EXISTS = 1, - DOES_NOT_EXIST = 2 - } - - /** Properties of a FlyoverInfo. */ - interface IFlyoverInfo { - - /** FlyoverInfo flyoverPresence */ - flyoverPresence?: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState|null); - - /** FlyoverInfo polylinePointIndex */ - polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); - } - - /** Represents a FlyoverInfo. */ - class FlyoverInfo implements IFlyoverInfo { - - /** - * Constructs a new FlyoverInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.PolylineDetails.IFlyoverInfo); - - /** FlyoverInfo flyoverPresence. */ - public flyoverPresence: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState); - - /** FlyoverInfo polylinePointIndex. */ - public polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); - - /** - * Creates a new FlyoverInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FlyoverInfo instance - */ - public static create(properties?: google.maps.routing.v2.PolylineDetails.IFlyoverInfo): google.maps.routing.v2.PolylineDetails.FlyoverInfo; - - /** - * Encodes the specified FlyoverInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. - * @param message FlyoverInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.PolylineDetails.IFlyoverInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FlyoverInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. - * @param message FlyoverInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.IFlyoverInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FlyoverInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FlyoverInfo - * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.FlyoverInfo; - - /** - * Decodes a FlyoverInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FlyoverInfo - * @throws {Error} If the payload 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.routing.v2.PolylineDetails.FlyoverInfo; - - /** - * Verifies a FlyoverInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FlyoverInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FlyoverInfo - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.FlyoverInfo; - - /** - * Creates a plain object from a FlyoverInfo message. Also converts values to other types if specified. - * @param message FlyoverInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.PolylineDetails.FlyoverInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FlyoverInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FlyoverInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NarrowRoadInfo. */ - interface INarrowRoadInfo { - - /** NarrowRoadInfo narrowRoadPresence */ - narrowRoadPresence?: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState|null); - - /** NarrowRoadInfo polylinePointIndex */ - polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); - } - - /** Represents a NarrowRoadInfo. */ - class NarrowRoadInfo implements INarrowRoadInfo { - - /** - * Constructs a new NarrowRoadInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo); - - /** NarrowRoadInfo narrowRoadPresence. */ - public narrowRoadPresence: (google.maps.routing.v2.PolylineDetails.RoadFeatureState|keyof typeof google.maps.routing.v2.PolylineDetails.RoadFeatureState); - - /** NarrowRoadInfo polylinePointIndex. */ - public polylinePointIndex?: (google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null); - - /** - * Creates a new NarrowRoadInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns NarrowRoadInfo instance - */ - public static create(properties?: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo): google.maps.routing.v2.PolylineDetails.NarrowRoadInfo; - - /** - * Encodes the specified NarrowRoadInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. - * @param message NarrowRoadInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NarrowRoadInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. - * @param message NarrowRoadInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.PolylineDetails.INarrowRoadInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NarrowRoadInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NarrowRoadInfo - * @throws {Error} If the payload is not 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.routing.v2.PolylineDetails.NarrowRoadInfo; - - /** - * Decodes a NarrowRoadInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NarrowRoadInfo - * @throws {Error} If the payload 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.routing.v2.PolylineDetails.NarrowRoadInfo; - - /** - * Verifies a NarrowRoadInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NarrowRoadInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NarrowRoadInfo - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.PolylineDetails.NarrowRoadInfo; - - /** - * Creates a plain object from a NarrowRoadInfo message. Also converts values to other types if specified. - * @param message NarrowRoadInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.PolylineDetails.NarrowRoadInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NarrowRoadInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NarrowRoadInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Route. */ - interface IRoute { - - /** Route routeLabels */ - routeLabels?: (google.maps.routing.v2.RouteLabel[]|null); - - /** Route legs */ - legs?: (google.maps.routing.v2.IRouteLeg[]|null); - - /** Route distanceMeters */ - distanceMeters?: (number|null); - - /** Route duration */ - duration?: (google.protobuf.IDuration|null); - - /** Route staticDuration */ - staticDuration?: (google.protobuf.IDuration|null); - - /** Route polyline */ - polyline?: (google.maps.routing.v2.IPolyline|null); - - /** Route description */ - description?: (string|null); - - /** Route warnings */ - warnings?: (string[]|null); - - /** Route viewport */ - viewport?: (google.geo.type.IViewport|null); - - /** Route travelAdvisory */ - travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); - - /** Route optimizedIntermediateWaypointIndex */ - optimizedIntermediateWaypointIndex?: (number[]|null); - - /** Route localizedValues */ - localizedValues?: (google.maps.routing.v2.Route.IRouteLocalizedValues|null); - - /** Route routeToken */ - routeToken?: (string|null); - - /** Route polylineDetails */ - polylineDetails?: (google.maps.routing.v2.IPolylineDetails|null); - } - - /** Represents a Route. */ - class Route implements IRoute { - - /** - * Constructs a new Route. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRoute); - - /** Route routeLabels. */ - public routeLabels: google.maps.routing.v2.RouteLabel[]; - - /** Route legs. */ - public legs: google.maps.routing.v2.IRouteLeg[]; - - /** Route distanceMeters. */ - public distanceMeters: number; - - /** Route duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** Route staticDuration. */ - public staticDuration?: (google.protobuf.IDuration|null); - - /** Route polyline. */ - public polyline?: (google.maps.routing.v2.IPolyline|null); - - /** Route description. */ - public description: string; - - /** Route warnings. */ - public warnings: string[]; - - /** Route viewport. */ - public viewport?: (google.geo.type.IViewport|null); - - /** Route travelAdvisory. */ - public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); - - /** Route optimizedIntermediateWaypointIndex. */ - public optimizedIntermediateWaypointIndex: number[]; - - /** Route localizedValues. */ - public localizedValues?: (google.maps.routing.v2.Route.IRouteLocalizedValues|null); - - /** Route routeToken. */ - public routeToken: string; - - /** Route polylineDetails. */ - public polylineDetails?: (google.maps.routing.v2.IPolylineDetails|null); - - /** - * Creates a new Route instance using the specified properties. - * @param [properties] Properties to set - * @returns Route instance - */ - public static create(properties?: google.maps.routing.v2.IRoute): google.maps.routing.v2.Route; - - /** - * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. - * @param message Route message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. - * @param message Route message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Route message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Route - * @throws {Error} If the payload is not 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.routing.v2.Route; - - /** - * Decodes a Route message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Route - * @throws {Error} If the payload 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.routing.v2.Route; - - /** - * Verifies a Route message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Route message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Route - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Route; - - /** - * Creates a plain object from a Route message. Also converts values to other types if specified. - * @param message Route - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.Route, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Route to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Route - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Route { - - /** Properties of a RouteLocalizedValues. */ - interface IRouteLocalizedValues { - - /** RouteLocalizedValues distance */ - distance?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues duration */ - duration?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues staticDuration */ - staticDuration?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues transitFare */ - transitFare?: (google.type.ILocalizedText|null); - } - - /** Represents a RouteLocalizedValues. */ - class RouteLocalizedValues implements IRouteLocalizedValues { - - /** - * Constructs a new RouteLocalizedValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.Route.IRouteLocalizedValues); - - /** RouteLocalizedValues distance. */ - public distance?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues duration. */ - public duration?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues staticDuration. */ - public staticDuration?: (google.type.ILocalizedText|null); - - /** RouteLocalizedValues transitFare. */ - public transitFare?: (google.type.ILocalizedText|null); - - /** - * Creates a new RouteLocalizedValues instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLocalizedValues instance - */ - public static create(properties?: google.maps.routing.v2.Route.IRouteLocalizedValues): google.maps.routing.v2.Route.RouteLocalizedValues; - - /** - * Encodes the specified RouteLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. - * @param message RouteLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.Route.IRouteLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. - * @param message RouteLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.Route.IRouteLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLocalizedValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLocalizedValues - * @throws {Error} If the payload is not 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.routing.v2.Route.RouteLocalizedValues; - - /** - * Decodes a RouteLocalizedValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLocalizedValues - * @throws {Error} If the payload 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.routing.v2.Route.RouteLocalizedValues; - - /** - * Verifies a RouteLocalizedValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLocalizedValues - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Route.RouteLocalizedValues; - - /** - * Creates a plain object from a RouteLocalizedValues message. Also converts values to other types if specified. - * @param message RouteLocalizedValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.Route.RouteLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLocalizedValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLocalizedValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a RouteTravelAdvisory. */ - interface IRouteTravelAdvisory { - - /** RouteTravelAdvisory tollInfo */ - tollInfo?: (google.maps.routing.v2.ITollInfo|null); - - /** RouteTravelAdvisory speedReadingIntervals */ - speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); - - /** RouteTravelAdvisory fuelConsumptionMicroliters */ - fuelConsumptionMicroliters?: (number|Long|string|null); - - /** RouteTravelAdvisory routeRestrictionsPartiallyIgnored */ - routeRestrictionsPartiallyIgnored?: (boolean|null); - - /** RouteTravelAdvisory transitFare */ - transitFare?: (google.type.IMoney|null); - } - - /** Represents a RouteTravelAdvisory. */ - class RouteTravelAdvisory implements IRouteTravelAdvisory { - - /** - * Constructs a new RouteTravelAdvisory. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteTravelAdvisory); - - /** RouteTravelAdvisory tollInfo. */ - public tollInfo?: (google.maps.routing.v2.ITollInfo|null); - - /** RouteTravelAdvisory speedReadingIntervals. */ - public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; - - /** RouteTravelAdvisory fuelConsumptionMicroliters. */ - public fuelConsumptionMicroliters: (number|Long|string); - - /** RouteTravelAdvisory routeRestrictionsPartiallyIgnored. */ - public routeRestrictionsPartiallyIgnored: boolean; - - /** RouteTravelAdvisory transitFare. */ - public transitFare?: (google.type.IMoney|null); - - /** - * Creates a new RouteTravelAdvisory instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteTravelAdvisory instance - */ - public static create(properties?: google.maps.routing.v2.IRouteTravelAdvisory): google.maps.routing.v2.RouteTravelAdvisory; - - /** - * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. - * @param message RouteTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. - * @param message RouteTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteTravelAdvisory message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteTravelAdvisory - * @throws {Error} If the payload is not 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.routing.v2.RouteTravelAdvisory; - - /** - * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteTravelAdvisory - * @throws {Error} If the payload 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.routing.v2.RouteTravelAdvisory; - - /** - * Verifies a RouteTravelAdvisory message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteTravelAdvisory - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteTravelAdvisory; - - /** - * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. - * @param message RouteTravelAdvisory - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteTravelAdvisory to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteTravelAdvisory - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RouteLegTravelAdvisory. */ - interface IRouteLegTravelAdvisory { - - /** RouteLegTravelAdvisory tollInfo */ - tollInfo?: (google.maps.routing.v2.ITollInfo|null); - - /** RouteLegTravelAdvisory speedReadingIntervals */ - speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); - } - - /** Represents a RouteLegTravelAdvisory. */ - class RouteLegTravelAdvisory implements IRouteLegTravelAdvisory { - - /** - * Constructs a new RouteLegTravelAdvisory. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory); - - /** RouteLegTravelAdvisory tollInfo. */ - public tollInfo?: (google.maps.routing.v2.ITollInfo|null); - - /** RouteLegTravelAdvisory speedReadingIntervals. */ - public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; - - /** - * Creates a new RouteLegTravelAdvisory instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegTravelAdvisory instance - */ - public static create(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory): google.maps.routing.v2.RouteLegTravelAdvisory; - - /** - * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. - * @param message RouteLegTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. - * @param message RouteLegTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegTravelAdvisory - * @throws {Error} If the payload is not 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.routing.v2.RouteLegTravelAdvisory; - - /** - * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegTravelAdvisory - * @throws {Error} If the payload 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.routing.v2.RouteLegTravelAdvisory; - - /** - * Verifies a RouteLegTravelAdvisory message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegTravelAdvisory - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegTravelAdvisory; - - /** - * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. - * @param message RouteLegTravelAdvisory - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegTravelAdvisory to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegTravelAdvisory - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RouteLegStepTravelAdvisory. */ - interface IRouteLegStepTravelAdvisory { - - /** RouteLegStepTravelAdvisory speedReadingIntervals */ - speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); - } - - /** Represents a RouteLegStepTravelAdvisory. */ - class RouteLegStepTravelAdvisory implements IRouteLegStepTravelAdvisory { - - /** - * Constructs a new RouteLegStepTravelAdvisory. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory); - - /** RouteLegStepTravelAdvisory speedReadingIntervals. */ - public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; - - /** - * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegStepTravelAdvisory instance - */ - public static create(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory): google.maps.routing.v2.RouteLegStepTravelAdvisory; - - /** - * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. - * @param message RouteLegStepTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. - * @param message RouteLegStepTravelAdvisory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegStepTravelAdvisory - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTravelAdvisory; - - /** - * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegStepTravelAdvisory - * @throws {Error} If the payload 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.routing.v2.RouteLegStepTravelAdvisory; - - /** - * Verifies a RouteLegStepTravelAdvisory message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegStepTravelAdvisory - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTravelAdvisory; - - /** - * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. - * @param message RouteLegStepTravelAdvisory - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStepTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegStepTravelAdvisory to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegStepTravelAdvisory - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RouteLeg. */ - interface IRouteLeg { - - /** RouteLeg distanceMeters */ - distanceMeters?: (number|null); - - /** RouteLeg duration */ - duration?: (google.protobuf.IDuration|null); - - /** RouteLeg staticDuration */ - staticDuration?: (google.protobuf.IDuration|null); - - /** RouteLeg polyline */ - polyline?: (google.maps.routing.v2.IPolyline|null); - - /** RouteLeg startLocation */ - startLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLeg endLocation */ - endLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLeg steps */ - steps?: (google.maps.routing.v2.IRouteLegStep[]|null); - - /** RouteLeg travelAdvisory */ - travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); - - /** RouteLeg localizedValues */ - localizedValues?: (google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null); - - /** RouteLeg stepsOverview */ - stepsOverview?: (google.maps.routing.v2.RouteLeg.IStepsOverview|null); - } - - /** Represents a RouteLeg. */ - class RouteLeg implements IRouteLeg { - - /** - * Constructs a new RouteLeg. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteLeg); - - /** RouteLeg distanceMeters. */ - public distanceMeters: number; - - /** RouteLeg duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** RouteLeg staticDuration. */ - public staticDuration?: (google.protobuf.IDuration|null); - - /** RouteLeg polyline. */ - public polyline?: (google.maps.routing.v2.IPolyline|null); - - /** RouteLeg startLocation. */ - public startLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLeg endLocation. */ - public endLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLeg steps. */ - public steps: google.maps.routing.v2.IRouteLegStep[]; - - /** RouteLeg travelAdvisory. */ - public travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); - - /** RouteLeg localizedValues. */ - public localizedValues?: (google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null); - - /** RouteLeg stepsOverview. */ - public stepsOverview?: (google.maps.routing.v2.RouteLeg.IStepsOverview|null); - - /** - * Creates a new RouteLeg instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLeg instance - */ - public static create(properties?: google.maps.routing.v2.IRouteLeg): google.maps.routing.v2.RouteLeg; - - /** - * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. - * @param message RouteLeg message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. - * @param message RouteLeg message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLeg message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLeg - * @throws {Error} If the payload is not 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.routing.v2.RouteLeg; - - /** - * Decodes a RouteLeg message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLeg - * @throws {Error} If the payload 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.routing.v2.RouteLeg; - - /** - * Verifies a RouteLeg message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLeg - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg; - - /** - * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. - * @param message RouteLeg - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLeg, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLeg to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLeg - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RouteLeg { - - /** Properties of a RouteLegLocalizedValues. */ - interface IRouteLegLocalizedValues { - - /** RouteLegLocalizedValues distance */ - distance?: (google.type.ILocalizedText|null); - - /** RouteLegLocalizedValues duration */ - duration?: (google.type.ILocalizedText|null); - - /** RouteLegLocalizedValues staticDuration */ - staticDuration?: (google.type.ILocalizedText|null); - } - - /** Represents a RouteLegLocalizedValues. */ - class RouteLegLocalizedValues implements IRouteLegLocalizedValues { - - /** - * Constructs a new RouteLegLocalizedValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues); - - /** RouteLegLocalizedValues distance. */ - public distance?: (google.type.ILocalizedText|null); - - /** RouteLegLocalizedValues duration. */ - public duration?: (google.type.ILocalizedText|null); - - /** RouteLegLocalizedValues staticDuration. */ - public staticDuration?: (google.type.ILocalizedText|null); - - /** - * Creates a new RouteLegLocalizedValues instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegLocalizedValues instance - */ - public static create(properties?: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues): google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues; - - /** - * Encodes the specified RouteLegLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. - * @param message RouteLegLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. - * @param message RouteLegLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegLocalizedValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegLocalizedValues - * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.RouteLegLocalizedValues; - - /** - * Decodes a RouteLegLocalizedValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegLocalizedValues - * @throws {Error} If the payload 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.routing.v2.RouteLeg.RouteLegLocalizedValues; - - /** - * Verifies a RouteLegLocalizedValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegLocalizedValues - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues; - - /** - * Creates a plain object from a RouteLegLocalizedValues message. Also converts values to other types if specified. - * @param message RouteLegLocalizedValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegLocalizedValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegLocalizedValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StepsOverview. */ - interface IStepsOverview { - - /** StepsOverview multiModalSegments */ - multiModalSegments?: (google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment[]|null); - } - - /** Represents a StepsOverview. */ - class StepsOverview implements IStepsOverview { - - /** - * Constructs a new StepsOverview. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLeg.IStepsOverview); - - /** StepsOverview multiModalSegments. */ - public multiModalSegments: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment[]; - - /** - * Creates a new StepsOverview instance using the specified properties. - * @param [properties] Properties to set - * @returns StepsOverview instance - */ - public static create(properties?: google.maps.routing.v2.RouteLeg.IStepsOverview): google.maps.routing.v2.RouteLeg.StepsOverview; - - /** - * Encodes the specified StepsOverview message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. - * @param message StepsOverview message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLeg.IStepsOverview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StepsOverview message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. - * @param message StepsOverview message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.IStepsOverview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StepsOverview message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StepsOverview - * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.StepsOverview; - - /** - * Decodes a StepsOverview message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StepsOverview - * @throws {Error} If the payload 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.routing.v2.RouteLeg.StepsOverview; - - /** - * Verifies a StepsOverview message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StepsOverview message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StepsOverview - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.StepsOverview; - - /** - * Creates a plain object from a StepsOverview message. Also converts values to other types if specified. - * @param message StepsOverview - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLeg.StepsOverview, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StepsOverview to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StepsOverview - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StepsOverview { - - /** Properties of a MultiModalSegment. */ - interface IMultiModalSegment { - - /** MultiModalSegment stepStartIndex */ - stepStartIndex?: (number|null); - - /** MultiModalSegment stepEndIndex */ - stepEndIndex?: (number|null); - - /** MultiModalSegment navigationInstruction */ - navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); - - /** MultiModalSegment travelMode */ - travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); - } - - /** Represents a MultiModalSegment. */ - class MultiModalSegment implements IMultiModalSegment { - - /** - * Constructs a new MultiModalSegment. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment); - - /** MultiModalSegment stepStartIndex. */ - public stepStartIndex?: (number|null); - - /** MultiModalSegment stepEndIndex. */ - public stepEndIndex?: (number|null); - - /** MultiModalSegment navigationInstruction. */ - public navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); - - /** MultiModalSegment travelMode. */ - public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); - - /** - * Creates a new MultiModalSegment instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiModalSegment instance - */ - public static create(properties?: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment): google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; - - /** - * Encodes the specified MultiModalSegment message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. - * @param message MultiModalSegment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiModalSegment message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. - * @param message MultiModalSegment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiModalSegment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiModalSegment - * @throws {Error} If the payload is not 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.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; - - /** - * Decodes a MultiModalSegment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiModalSegment - * @throws {Error} If the payload 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.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; - - /** - * Verifies a MultiModalSegment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiModalSegment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiModalSegment - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment; - - /** - * Creates a plain object from a MultiModalSegment message. Also converts values to other types if specified. - * @param message MultiModalSegment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiModalSegment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiModalSegment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a RouteLegStep. */ - interface IRouteLegStep { - - /** RouteLegStep distanceMeters */ - distanceMeters?: (number|null); - - /** RouteLegStep staticDuration */ - staticDuration?: (google.protobuf.IDuration|null); - - /** RouteLegStep polyline */ - polyline?: (google.maps.routing.v2.IPolyline|null); - - /** RouteLegStep startLocation */ - startLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLegStep endLocation */ - endLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLegStep navigationInstruction */ - navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); - - /** RouteLegStep travelAdvisory */ - travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); - - /** RouteLegStep localizedValues */ - localizedValues?: (google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null); - - /** RouteLegStep transitDetails */ - transitDetails?: (google.maps.routing.v2.IRouteLegStepTransitDetails|null); - - /** RouteLegStep travelMode */ - travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); - } - - /** Represents a RouteLegStep. */ - class RouteLegStep implements IRouteLegStep { - - /** - * Constructs a new RouteLegStep. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteLegStep); - - /** RouteLegStep distanceMeters. */ - public distanceMeters: number; - - /** RouteLegStep staticDuration. */ - public staticDuration?: (google.protobuf.IDuration|null); - - /** RouteLegStep polyline. */ - public polyline?: (google.maps.routing.v2.IPolyline|null); - - /** RouteLegStep startLocation. */ - public startLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLegStep endLocation. */ - public endLocation?: (google.maps.routing.v2.ILocation|null); - - /** RouteLegStep navigationInstruction. */ - public navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); - - /** RouteLegStep travelAdvisory. */ - public travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); - - /** RouteLegStep localizedValues. */ - public localizedValues?: (google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null); - - /** RouteLegStep transitDetails. */ - public transitDetails?: (google.maps.routing.v2.IRouteLegStepTransitDetails|null); - - /** RouteLegStep travelMode. */ - public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); - - /** - * Creates a new RouteLegStep instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegStep instance - */ - public static create(properties?: google.maps.routing.v2.IRouteLegStep): google.maps.routing.v2.RouteLegStep; - - /** - * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. - * @param message RouteLegStep message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. - * @param message RouteLegStep message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegStep message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegStep - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStep; - - /** - * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegStep - * @throws {Error} If the payload 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.routing.v2.RouteLegStep; - - /** - * Verifies a RouteLegStep message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegStep - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStep; - - /** - * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. - * @param message RouteLegStep - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegStep to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegStep - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RouteLegStep { - - /** Properties of a RouteLegStepLocalizedValues. */ - interface IRouteLegStepLocalizedValues { - - /** RouteLegStepLocalizedValues distance */ - distance?: (google.type.ILocalizedText|null); - - /** RouteLegStepLocalizedValues staticDuration */ - staticDuration?: (google.type.ILocalizedText|null); - } - - /** Represents a RouteLegStepLocalizedValues. */ - class RouteLegStepLocalizedValues implements IRouteLegStepLocalizedValues { - - /** - * Constructs a new RouteLegStepLocalizedValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues); - - /** RouteLegStepLocalizedValues distance. */ - public distance?: (google.type.ILocalizedText|null); - - /** RouteLegStepLocalizedValues staticDuration. */ - public staticDuration?: (google.type.ILocalizedText|null); - - /** - * Creates a new RouteLegStepLocalizedValues instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegStepLocalizedValues instance - */ - public static create(properties?: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues): google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; - - /** - * Encodes the specified RouteLegStepLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. - * @param message RouteLegStepLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegStepLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. - * @param message RouteLegStepLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegStepLocalizedValues - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; - - /** - * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegStepLocalizedValues - * @throws {Error} If the payload 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.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; - - /** - * Verifies a RouteLegStepLocalizedValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegStepLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegStepLocalizedValues - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues; - - /** - * Creates a plain object from a RouteLegStepLocalizedValues message. Also converts values to other types if specified. - * @param message RouteLegStepLocalizedValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegStepLocalizedValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegStepLocalizedValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a RouteLegStepTransitDetails. */ - interface IRouteLegStepTransitDetails { - - /** RouteLegStepTransitDetails stopDetails */ - stopDetails?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null); - - /** RouteLegStepTransitDetails localizedValues */ - localizedValues?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null); - - /** RouteLegStepTransitDetails headsign */ - headsign?: (string|null); - - /** RouteLegStepTransitDetails headway */ - headway?: (google.protobuf.IDuration|null); - - /** RouteLegStepTransitDetails transitLine */ - transitLine?: (google.maps.routing.v2.ITransitLine|null); - - /** RouteLegStepTransitDetails stopCount */ - stopCount?: (number|null); - - /** RouteLegStepTransitDetails tripShortText */ - tripShortText?: (string|null); - } - - /** Represents a RouteLegStepTransitDetails. */ - class RouteLegStepTransitDetails implements IRouteLegStepTransitDetails { - - /** - * Constructs a new RouteLegStepTransitDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteLegStepTransitDetails); - - /** RouteLegStepTransitDetails stopDetails. */ - public stopDetails?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null); - - /** RouteLegStepTransitDetails localizedValues. */ - public localizedValues?: (google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null); - - /** RouteLegStepTransitDetails headsign. */ - public headsign: string; - - /** RouteLegStepTransitDetails headway. */ - public headway?: (google.protobuf.IDuration|null); - - /** RouteLegStepTransitDetails transitLine. */ - public transitLine?: (google.maps.routing.v2.ITransitLine|null); - - /** RouteLegStepTransitDetails stopCount. */ - public stopCount: number; - - /** RouteLegStepTransitDetails tripShortText. */ - public tripShortText: string; - - /** - * Creates a new RouteLegStepTransitDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteLegStepTransitDetails instance - */ - public static create(properties?: google.maps.routing.v2.IRouteLegStepTransitDetails): google.maps.routing.v2.RouteLegStepTransitDetails; - - /** - * Encodes the specified RouteLegStepTransitDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. - * @param message RouteLegStepTransitDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteLegStepTransitDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteLegStepTransitDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. - * @param message RouteLegStepTransitDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStepTransitDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteLegStepTransitDetails - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails; - - /** - * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteLegStepTransitDetails - * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails; - - /** - * Verifies a RouteLegStepTransitDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteLegStepTransitDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteLegStepTransitDetails - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails; - - /** - * Creates a plain object from a RouteLegStepTransitDetails message. Also converts values to other types if specified. - * @param message RouteLegStepTransitDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteLegStepTransitDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteLegStepTransitDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RouteLegStepTransitDetails { - - /** Properties of a TransitStopDetails. */ - interface ITransitStopDetails { - - /** TransitStopDetails arrivalStop */ - arrivalStop?: (google.maps.routing.v2.ITransitStop|null); - - /** TransitStopDetails arrivalTime */ - arrivalTime?: (google.protobuf.ITimestamp|null); - - /** TransitStopDetails departureStop */ - departureStop?: (google.maps.routing.v2.ITransitStop|null); - - /** TransitStopDetails departureTime */ - departureTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TransitStopDetails. */ - class TransitStopDetails implements ITransitStopDetails { - - /** - * Constructs a new TransitStopDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails); - - /** TransitStopDetails arrivalStop. */ - public arrivalStop?: (google.maps.routing.v2.ITransitStop|null); - - /** TransitStopDetails arrivalTime. */ - public arrivalTime?: (google.protobuf.ITimestamp|null); - - /** TransitStopDetails departureStop. */ - public departureStop?: (google.maps.routing.v2.ITransitStop|null); - - /** TransitStopDetails departureTime. */ - public departureTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TransitStopDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitStopDetails instance - */ - public static create(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails): google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; - - /** - * Encodes the specified TransitStopDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. - * @param message TransitStopDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitStopDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. - * @param message TransitStopDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitStopDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitStopDetails - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; - - /** - * Decodes a TransitStopDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitStopDetails - * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; - - /** - * Verifies a TransitStopDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitStopDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitStopDetails - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails; - - /** - * Creates a plain object from a TransitStopDetails message. Also converts values to other types if specified. - * @param message TransitStopDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitStopDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitStopDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitDetailsLocalizedValues. */ - interface ITransitDetailsLocalizedValues { - - /** TransitDetailsLocalizedValues arrivalTime */ - arrivalTime?: (google.maps.routing.v2.ILocalizedTime|null); - - /** TransitDetailsLocalizedValues departureTime */ - departureTime?: (google.maps.routing.v2.ILocalizedTime|null); - } - - /** Represents a TransitDetailsLocalizedValues. */ - class TransitDetailsLocalizedValues implements ITransitDetailsLocalizedValues { - - /** - * Constructs a new TransitDetailsLocalizedValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues); - - /** TransitDetailsLocalizedValues arrivalTime. */ - public arrivalTime?: (google.maps.routing.v2.ILocalizedTime|null); - - /** TransitDetailsLocalizedValues departureTime. */ - public departureTime?: (google.maps.routing.v2.ILocalizedTime|null); - - /** - * Creates a new TransitDetailsLocalizedValues instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitDetailsLocalizedValues instance - */ - public static create(properties?: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues): google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; - - /** - * Encodes the specified TransitDetailsLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. - * @param message TransitDetailsLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitDetailsLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. - * @param message TransitDetailsLocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitDetailsLocalizedValues - * @throws {Error} If the payload is not 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.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; - - /** - * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitDetailsLocalizedValues - * @throws {Error} If the payload 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.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; - - /** - * Verifies a TransitDetailsLocalizedValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitDetailsLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitDetailsLocalizedValues - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues; - - /** - * Creates a plain object from a TransitDetailsLocalizedValues message. Also converts values to other types if specified. - * @param message TransitDetailsLocalizedValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitDetailsLocalizedValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitDetailsLocalizedValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** RouteLabel enum. */ - enum RouteLabel { - ROUTE_LABEL_UNSPECIFIED = 0, - DEFAULT_ROUTE = 1, - DEFAULT_ROUTE_ALTERNATE = 2, - FUEL_EFFICIENT = 3, - SHORTER_DISTANCE = 4 - } - - /** RouteTravelMode enum. */ - enum RouteTravelMode { - TRAVEL_MODE_UNSPECIFIED = 0, - DRIVE = 1, - BICYCLE = 2, - WALK = 3, - TWO_WHEELER = 4, - TRANSIT = 7 - } - - /** Properties of a SpeedReadingInterval. */ - interface ISpeedReadingInterval { - - /** SpeedReadingInterval startPolylinePointIndex */ - startPolylinePointIndex?: (number|null); - - /** SpeedReadingInterval endPolylinePointIndex */ - endPolylinePointIndex?: (number|null); - - /** SpeedReadingInterval speed */ - speed?: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed|null); - } - - /** Represents a SpeedReadingInterval. */ - class SpeedReadingInterval implements ISpeedReadingInterval { - - /** - * Constructs a new SpeedReadingInterval. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ISpeedReadingInterval); - - /** SpeedReadingInterval startPolylinePointIndex. */ - public startPolylinePointIndex?: (number|null); - - /** SpeedReadingInterval endPolylinePointIndex. */ - public endPolylinePointIndex?: (number|null); - - /** SpeedReadingInterval speed. */ - public speed?: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed|null); - - /** SpeedReadingInterval speedType. */ - public speedType?: "speed"; - - /** - * Creates a new SpeedReadingInterval instance using the specified properties. - * @param [properties] Properties to set - * @returns SpeedReadingInterval instance - */ - public static create(properties?: google.maps.routing.v2.ISpeedReadingInterval): google.maps.routing.v2.SpeedReadingInterval; - - /** - * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. - * @param message SpeedReadingInterval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. - * @param message SpeedReadingInterval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpeedReadingInterval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpeedReadingInterval - * @throws {Error} If the payload is not 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.routing.v2.SpeedReadingInterval; - - /** - * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpeedReadingInterval - * @throws {Error} If the payload 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.routing.v2.SpeedReadingInterval; - - /** - * Verifies a SpeedReadingInterval message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpeedReadingInterval - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.SpeedReadingInterval; - - /** - * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. - * @param message SpeedReadingInterval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.SpeedReadingInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpeedReadingInterval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpeedReadingInterval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SpeedReadingInterval { - - /** Speed enum. */ - enum Speed { - SPEED_UNSPECIFIED = 0, - NORMAL = 1, - SLOW = 2, - TRAFFIC_JAM = 3 - } - } - - /** Properties of a TollInfo. */ - interface ITollInfo { - - /** TollInfo estimatedPrice */ - estimatedPrice?: (google.type.IMoney[]|null); - } - - /** Represents a TollInfo. */ - class TollInfo implements ITollInfo { - - /** - * Constructs a new TollInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITollInfo); - - /** TollInfo estimatedPrice. */ - public estimatedPrice: google.type.IMoney[]; - - /** - * Creates a new TollInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns TollInfo instance - */ - public static create(properties?: google.maps.routing.v2.ITollInfo): google.maps.routing.v2.TollInfo; - - /** - * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. - * @param message TollInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. - * @param message TollInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TollInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TollInfo - * @throws {Error} If the payload is not 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.routing.v2.TollInfo; - - /** - * Decodes a TollInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TollInfo - * @throws {Error} If the payload 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.routing.v2.TollInfo; - - /** - * Verifies a TollInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TollInfo - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TollInfo; - - /** - * Creates a plain object from a TollInfo message. Also converts values to other types if specified. - * @param message TollInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TollInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TollInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TollInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitAgency. */ - interface ITransitAgency { - - /** TransitAgency name */ - name?: (string|null); - - /** TransitAgency phoneNumber */ - phoneNumber?: (string|null); - - /** TransitAgency uri */ - uri?: (string|null); - } - - /** Represents a TransitAgency. */ - class TransitAgency implements ITransitAgency { - - /** - * Constructs a new TransitAgency. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITransitAgency); - - /** TransitAgency name. */ - public name: string; - - /** TransitAgency phoneNumber. */ - public phoneNumber: string; - - /** TransitAgency uri. */ - public uri: string; - - /** - * Creates a new TransitAgency instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitAgency instance - */ - public static create(properties?: google.maps.routing.v2.ITransitAgency): google.maps.routing.v2.TransitAgency; - - /** - * Encodes the specified TransitAgency message. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. - * @param message TransitAgency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITransitAgency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitAgency message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. - * @param message TransitAgency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITransitAgency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitAgency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitAgency - * @throws {Error} If the payload is not 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.routing.v2.TransitAgency; - - /** - * Decodes a TransitAgency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitAgency - * @throws {Error} If the payload 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.routing.v2.TransitAgency; - - /** - * Verifies a TransitAgency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitAgency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitAgency - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitAgency; - - /** - * Creates a plain object from a TransitAgency message. Also converts values to other types if specified. - * @param message TransitAgency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TransitAgency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitAgency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitAgency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitLine. */ - interface ITransitLine { - - /** TransitLine agencies */ - agencies?: (google.maps.routing.v2.ITransitAgency[]|null); - - /** TransitLine name */ - name?: (string|null); - - /** TransitLine uri */ - uri?: (string|null); - - /** TransitLine color */ - color?: (string|null); - - /** TransitLine iconUri */ - iconUri?: (string|null); - - /** TransitLine nameShort */ - nameShort?: (string|null); - - /** TransitLine textColor */ - textColor?: (string|null); - - /** TransitLine vehicle */ - vehicle?: (google.maps.routing.v2.ITransitVehicle|null); - } - - /** Represents a TransitLine. */ - class TransitLine implements ITransitLine { - - /** - * Constructs a new TransitLine. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITransitLine); - - /** TransitLine agencies. */ - public agencies: google.maps.routing.v2.ITransitAgency[]; - - /** TransitLine name. */ - public name: string; - - /** TransitLine uri. */ - public uri: string; - - /** TransitLine color. */ - public color: string; - - /** TransitLine iconUri. */ - public iconUri: string; - - /** TransitLine nameShort. */ - public nameShort: string; - - /** TransitLine textColor. */ - public textColor: string; - - /** TransitLine vehicle. */ - public vehicle?: (google.maps.routing.v2.ITransitVehicle|null); - - /** - * Creates a new TransitLine instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitLine instance - */ - public static create(properties?: google.maps.routing.v2.ITransitLine): google.maps.routing.v2.TransitLine; - - /** - * Encodes the specified TransitLine message. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. - * @param message TransitLine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITransitLine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitLine message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. - * @param message TransitLine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITransitLine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitLine message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitLine - * @throws {Error} If the payload is not 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.routing.v2.TransitLine; - - /** - * Decodes a TransitLine message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitLine - * @throws {Error} If the payload 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.routing.v2.TransitLine; - - /** - * Verifies a TransitLine message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitLine message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitLine - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitLine; - - /** - * Creates a plain object from a TransitLine message. Also converts values to other types if specified. - * @param message TransitLine - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TransitLine, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitLine to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitLine - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitStop. */ - interface ITransitStop { - - /** TransitStop name */ - name?: (string|null); - - /** TransitStop location */ - location?: (google.maps.routing.v2.ILocation|null); - } - - /** Represents a TransitStop. */ - class TransitStop implements ITransitStop { - - /** - * Constructs a new TransitStop. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITransitStop); - - /** TransitStop name. */ - public name: string; - - /** TransitStop location. */ - public location?: (google.maps.routing.v2.ILocation|null); - - /** - * Creates a new TransitStop instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitStop instance - */ - public static create(properties?: google.maps.routing.v2.ITransitStop): google.maps.routing.v2.TransitStop; - - /** - * Encodes the specified TransitStop message. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. - * @param message TransitStop message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITransitStop, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitStop message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. - * @param message TransitStop message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITransitStop, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitStop message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitStop - * @throws {Error} If the payload is not 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.routing.v2.TransitStop; - - /** - * Decodes a TransitStop message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitStop - * @throws {Error} If the payload 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.routing.v2.TransitStop; - - /** - * Verifies a TransitStop message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitStop message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitStop - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitStop; - - /** - * Creates a plain object from a TransitStop message. Also converts values to other types if specified. - * @param message TransitStop - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TransitStop, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitStop to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitStop - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitVehicle. */ - interface ITransitVehicle { - - /** TransitVehicle name */ - name?: (google.type.ILocalizedText|null); - - /** TransitVehicle type */ - type?: (google.maps.routing.v2.TransitVehicle.TransitVehicleType|keyof typeof google.maps.routing.v2.TransitVehicle.TransitVehicleType|null); - - /** TransitVehicle iconUri */ - iconUri?: (string|null); - - /** TransitVehicle localIconUri */ - localIconUri?: (string|null); - } - - /** Represents a TransitVehicle. */ - class TransitVehicle implements ITransitVehicle { - - /** - * Constructs a new TransitVehicle. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITransitVehicle); - - /** TransitVehicle name. */ - public name?: (google.type.ILocalizedText|null); - - /** TransitVehicle type. */ - public type: (google.maps.routing.v2.TransitVehicle.TransitVehicleType|keyof typeof google.maps.routing.v2.TransitVehicle.TransitVehicleType); - - /** TransitVehicle iconUri. */ - public iconUri: string; - - /** TransitVehicle localIconUri. */ - public localIconUri: string; - - /** - * Creates a new TransitVehicle instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitVehicle instance - */ - public static create(properties?: google.maps.routing.v2.ITransitVehicle): google.maps.routing.v2.TransitVehicle; - - /** - * Encodes the specified TransitVehicle message. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. - * @param message TransitVehicle message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITransitVehicle, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitVehicle message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. - * @param message TransitVehicle message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITransitVehicle, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitVehicle message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitVehicle - * @throws {Error} If the payload is not 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.routing.v2.TransitVehicle; - - /** - * Decodes a TransitVehicle message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitVehicle - * @throws {Error} If the payload 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.routing.v2.TransitVehicle; - - /** - * Verifies a TransitVehicle message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitVehicle message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitVehicle - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitVehicle; - - /** - * Creates a plain object from a TransitVehicle message. Also converts values to other types if specified. - * @param message TransitVehicle - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TransitVehicle, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitVehicle to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitVehicle - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransitVehicle { - - /** TransitVehicleType enum. */ - enum TransitVehicleType { - TRANSIT_VEHICLE_TYPE_UNSPECIFIED = 0, - BUS = 1, - CABLE_CAR = 2, - COMMUTER_TRAIN = 3, - FERRY = 4, - FUNICULAR = 5, - GONDOLA_LIFT = 6, - HEAVY_RAIL = 7, - HIGH_SPEED_TRAIN = 8, - INTERCITY_BUS = 9, - LONG_DISTANCE_TRAIN = 10, - METRO_RAIL = 11, - MONORAIL = 12, - OTHER = 13, - RAIL = 14, - SHARE_TAXI = 15, - SUBWAY = 16, - TRAM = 17, - TROLLEYBUS = 18 - } - } - - /** Properties of a RouteModifiers. */ - interface IRouteModifiers { - - /** RouteModifiers avoidTolls */ - avoidTolls?: (boolean|null); - - /** RouteModifiers avoidHighways */ - avoidHighways?: (boolean|null); - - /** RouteModifiers avoidFerries */ - avoidFerries?: (boolean|null); - - /** RouteModifiers avoidIndoor */ - avoidIndoor?: (boolean|null); - - /** RouteModifiers vehicleInfo */ - vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); - - /** RouteModifiers tollPasses */ - tollPasses?: (google.maps.routing.v2.TollPass[]|null); - } - - /** Represents a RouteModifiers. */ - class RouteModifiers implements IRouteModifiers { - - /** - * Constructs a new RouteModifiers. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteModifiers); - - /** RouteModifiers avoidTolls. */ - public avoidTolls: boolean; - - /** RouteModifiers avoidHighways. */ - public avoidHighways: boolean; - - /** RouteModifiers avoidFerries. */ - public avoidFerries: boolean; - - /** RouteModifiers avoidIndoor. */ - public avoidIndoor: boolean; - - /** RouteModifiers vehicleInfo. */ - public vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); - - /** RouteModifiers tollPasses. */ - public tollPasses: google.maps.routing.v2.TollPass[]; - - /** - * Creates a new RouteModifiers instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteModifiers instance - */ - public static create(properties?: google.maps.routing.v2.IRouteModifiers): google.maps.routing.v2.RouteModifiers; - - /** - * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. - * @param message RouteModifiers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. - * @param message RouteModifiers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteModifiers message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteModifiers - * @throws {Error} If the payload is not 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.routing.v2.RouteModifiers; - - /** - * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteModifiers - * @throws {Error} If the payload 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.routing.v2.RouteModifiers; - - /** - * Verifies a RouteModifiers message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteModifiers - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteModifiers; - - /** - * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. - * @param message RouteModifiers - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteModifiers to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteModifiers - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** TollPass enum. */ - enum TollPass { - TOLL_PASS_UNSPECIFIED = 0, - AU_ETOLL_TAG = 82, - AU_EWAY_TAG = 83, - AU_LINKT = 2, - AR_TELEPASE = 3, - BR_AUTO_EXPRESO = 81, - BR_CONECTCAR = 7, - BR_MOVE_MAIS = 8, - BR_PASSA_RAPIDO = 88, - BR_SEM_PARAR = 9, - BR_TAGGY = 10, - BR_VELOE = 11, - CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84, - CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85, - CA_US_BLUE_WATER_EDGE_PASS = 18, - CA_US_CONNEXION = 19, - CA_US_NEXUS_CARD = 20, - ID_E_TOLL = 16, - IN_FASTAG = 78, - IN_LOCAL_HP_PLATE_EXEMPT = 79, - JP_ETC = 98, - JP_ETC2 = 99, - MX_IAVE = 90, - MX_PASE = 91, - MX_QUICKPASS = 93, - MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89, - MX_TAG_IAVE = 12, - MX_TAG_TELEVIA = 13, - MX_TELEVIA = 92, - MX_VIAPASS = 14, - US_AL_FREEDOM_PASS = 21, - US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22, - US_CA_FASTRAK = 4, - US_CA_FASTRAK_CAV_STICKER = 86, - US_CO_EXPRESSTOLL = 23, - US_CO_GO_PASS = 24, - US_DE_EZPASSDE = 25, - US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65, - US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66, - US_FL_EPASS = 67, - US_FL_GIBA_TOLL_PASS = 68, - US_FL_LEEWAY = 69, - US_FL_SUNPASS = 70, - US_FL_SUNPASS_PRO = 71, - US_IL_EZPASSIL = 73, - US_IL_IPASS = 72, - US_IN_EZPASSIN = 26, - US_KS_BESTPASS_HORIZON = 27, - US_KS_KTAG = 28, - US_KS_NATIONALPASS = 29, - US_KS_PREPASS_ELITEPASS = 30, - US_KY_RIVERLINK = 31, - US_LA_GEAUXPASS = 32, - US_LA_TOLL_TAG = 33, - US_MA_EZPASSMA = 6, - US_MD_EZPASSMD = 34, - US_ME_EZPASSME = 35, - US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36, - US_MI_BCPASS = 94, - US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37, - US_MI_IQ_PROX_CARD = 38, - US_MI_IQ_TAG = 95, - US_MI_MACKINAC_BRIDGE_MAC_PASS = 39, - US_MI_NEXPRESS_TOLL = 40, - US_MN_EZPASSMN = 41, - US_NC_EZPASSNC = 42, - US_NC_PEACH_PASS = 87, - US_NC_QUICK_PASS = 43, - US_NH_EZPASSNH = 80, - US_NJ_DOWNBEACH_EXPRESS_PASS = 75, - US_NJ_EZPASSNJ = 74, - US_NY_EXPRESSPASS = 76, - US_NY_EZPASSNY = 77, - US_OH_EZPASSOH = 44, - US_PA_EZPASSPA = 45, - US_RI_EZPASSRI = 46, - US_SC_PALPASS = 47, - US_TX_AVI_TAG = 97, - US_TX_BANCPASS = 48, - US_TX_DEL_RIO_PASS = 49, - US_TX_EFAST_PASS = 50, - US_TX_EAGLE_PASS_EXPRESS_CARD = 51, - US_TX_EPTOLL = 52, - US_TX_EZ_CROSS = 53, - US_TX_EZTAG = 54, - US_TX_FUEGO_TAG = 96, - US_TX_LAREDO_TRADE_TAG = 55, - US_TX_PLUSPASS = 56, - US_TX_TOLLTAG = 57, - US_TX_TXTAG = 58, - US_TX_XPRESS_CARD = 59, - US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60, - US_VA_EZPASSVA = 61, - US_WA_BREEZEBY = 17, - US_WA_GOOD_TO_GO = 1, - US_WV_EZPASSWV = 62, - US_WV_MEMORIAL_BRIDGE_TICKETS = 63, - US_WV_MOV_PASS = 100, - US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64 - } - - /** Properties of a VehicleInfo. */ - interface IVehicleInfo { - - /** VehicleInfo emissionType */ - emissionType?: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType|null); - } - - /** Represents a VehicleInfo. */ - class VehicleInfo implements IVehicleInfo { - - /** - * Constructs a new VehicleInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IVehicleInfo); - - /** VehicleInfo emissionType. */ - public emissionType: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType); - - /** - * Creates a new VehicleInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns VehicleInfo instance - */ - public static create(properties?: google.maps.routing.v2.IVehicleInfo): google.maps.routing.v2.VehicleInfo; - - /** - * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. - * @param message VehicleInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. - * @param message VehicleInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VehicleInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VehicleInfo - * @throws {Error} If the payload is not 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.routing.v2.VehicleInfo; - - /** - * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VehicleInfo - * @throws {Error} If the payload 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.routing.v2.VehicleInfo; - - /** - * Verifies a VehicleInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VehicleInfo - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.VehicleInfo; - - /** - * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. - * @param message VehicleInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.VehicleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VehicleInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VehicleInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VehicleEmissionType enum. */ - enum VehicleEmissionType { - VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0, - GASOLINE = 1, - ELECTRIC = 2, - HYBRID = 3, - DIESEL = 4 - } - - /** Represents a Routes */ - class Routes extends $protobuf.rpc.Service { - - /** - * Constructs a new Routes 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 Routes 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): Routes; - - /** - * Calls ComputeRoutes. - * @param request ComputeRoutesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ComputeRoutesResponse - */ - public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest, callback: google.maps.routing.v2.Routes.ComputeRoutesCallback): void; - - /** - * Calls ComputeRoutes. - * @param request ComputeRoutesRequest message or plain object - * @returns Promise - */ - public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest): Promise; - - /** - * Calls ComputeRouteMatrix. - * @param request ComputeRouteMatrixRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RouteMatrixElement - */ - public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest, callback: google.maps.routing.v2.Routes.ComputeRouteMatrixCallback): void; - - /** - * Calls ComputeRouteMatrix. - * @param request ComputeRouteMatrixRequest message or plain object - * @returns Promise - */ - public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest): Promise; - } - - namespace Routes { - - /** - * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. - * @param error Error, if any - * @param [response] ComputeRoutesResponse - */ - type ComputeRoutesCallback = (error: (Error|null), response?: google.maps.routing.v2.ComputeRoutesResponse) => void; - - /** - * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. - * @param error Error, if any - * @param [response] RouteMatrixElement - */ - type ComputeRouteMatrixCallback = (error: (Error|null), response?: google.maps.routing.v2.RouteMatrixElement) => void; - } - - /** Properties of a ComputeRoutesRequest. */ - interface IComputeRoutesRequest { - - /** ComputeRoutesRequest origin */ - origin?: (google.maps.routing.v2.IWaypoint|null); - - /** ComputeRoutesRequest destination */ - destination?: (google.maps.routing.v2.IWaypoint|null); - - /** ComputeRoutesRequest intermediates */ - intermediates?: (google.maps.routing.v2.IWaypoint[]|null); - - /** ComputeRoutesRequest travelMode */ - travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); - - /** ComputeRoutesRequest routingPreference */ - routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); - - /** ComputeRoutesRequest polylineQuality */ - polylineQuality?: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality|null); - - /** ComputeRoutesRequest polylineEncoding */ - polylineEncoding?: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding|null); - - /** ComputeRoutesRequest departureTime */ - departureTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRoutesRequest arrivalTime */ - arrivalTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRoutesRequest computeAlternativeRoutes */ - computeAlternativeRoutes?: (boolean|null); - - /** ComputeRoutesRequest routeModifiers */ - routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); - - /** ComputeRoutesRequest languageCode */ - languageCode?: (string|null); - - /** ComputeRoutesRequest regionCode */ - regionCode?: (string|null); - - /** ComputeRoutesRequest units */ - units?: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units|null); - - /** ComputeRoutesRequest optimizeWaypointOrder */ - optimizeWaypointOrder?: (boolean|null); - - /** ComputeRoutesRequest requestedReferenceRoutes */ - requestedReferenceRoutes?: (google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[]|null); - - /** ComputeRoutesRequest extraComputations */ - extraComputations?: (google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[]|null); - - /** ComputeRoutesRequest trafficModel */ - trafficModel?: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel|null); - - /** ComputeRoutesRequest transitPreferences */ - transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); - } - - /** Represents a ComputeRoutesRequest. */ - class ComputeRoutesRequest implements IComputeRoutesRequest { - - /** - * Constructs a new ComputeRoutesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IComputeRoutesRequest); - - /** ComputeRoutesRequest origin. */ - public origin?: (google.maps.routing.v2.IWaypoint|null); - - /** ComputeRoutesRequest destination. */ - public destination?: (google.maps.routing.v2.IWaypoint|null); - - /** ComputeRoutesRequest intermediates. */ - public intermediates: google.maps.routing.v2.IWaypoint[]; - - /** ComputeRoutesRequest travelMode. */ - public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); - - /** ComputeRoutesRequest routingPreference. */ - public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); - - /** ComputeRoutesRequest polylineQuality. */ - public polylineQuality: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality); - - /** ComputeRoutesRequest polylineEncoding. */ - public polylineEncoding: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding); - - /** ComputeRoutesRequest departureTime. */ - public departureTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRoutesRequest arrivalTime. */ - public arrivalTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRoutesRequest computeAlternativeRoutes. */ - public computeAlternativeRoutes: boolean; - - /** ComputeRoutesRequest routeModifiers. */ - public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); - - /** ComputeRoutesRequest languageCode. */ - public languageCode: string; - - /** ComputeRoutesRequest regionCode. */ - public regionCode: string; - - /** ComputeRoutesRequest units. */ - public units: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units); - - /** ComputeRoutesRequest optimizeWaypointOrder. */ - public optimizeWaypointOrder: boolean; - - /** ComputeRoutesRequest requestedReferenceRoutes. */ - public requestedReferenceRoutes: google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[]; - - /** ComputeRoutesRequest extraComputations. */ - public extraComputations: google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[]; - - /** ComputeRoutesRequest trafficModel. */ - public trafficModel: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel); - - /** ComputeRoutesRequest transitPreferences. */ - public transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); - - /** - * Creates a new ComputeRoutesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeRoutesRequest instance - */ - public static create(properties?: google.maps.routing.v2.IComputeRoutesRequest): google.maps.routing.v2.ComputeRoutesRequest; - - /** - * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. - * @param message ComputeRoutesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. - * @param message ComputeRoutesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeRoutesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeRoutesRequest - * @throws {Error} If the payload is not 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.routing.v2.ComputeRoutesRequest; - - /** - * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeRoutesRequest - * @throws {Error} If the payload 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.routing.v2.ComputeRoutesRequest; - - /** - * Verifies a ComputeRoutesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeRoutesRequest - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesRequest; - - /** - * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. - * @param message ComputeRoutesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.ComputeRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeRoutesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeRoutesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ComputeRoutesRequest { - - /** ReferenceRoute enum. */ - enum ReferenceRoute { - REFERENCE_ROUTE_UNSPECIFIED = 0, - FUEL_EFFICIENT = 1, - SHORTER_DISTANCE = 2 - } - - /** ExtraComputation enum. */ - enum ExtraComputation { - EXTRA_COMPUTATION_UNSPECIFIED = 0, - TOLLS = 1, - FUEL_CONSUMPTION = 2, - TRAFFIC_ON_POLYLINE = 3, - HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4, - FLYOVER_INFO_ON_POLYLINE = 7, - NARROW_ROAD_INFO_ON_POLYLINE = 8 - } - } - - /** Properties of a ComputeRoutesResponse. */ - interface IComputeRoutesResponse { - - /** ComputeRoutesResponse routes */ - routes?: (google.maps.routing.v2.IRoute[]|null); - - /** ComputeRoutesResponse fallbackInfo */ - fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); - - /** ComputeRoutesResponse geocodingResults */ - geocodingResults?: (google.maps.routing.v2.IGeocodingResults|null); - } - - /** Represents a ComputeRoutesResponse. */ - class ComputeRoutesResponse implements IComputeRoutesResponse { - - /** - * Constructs a new ComputeRoutesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IComputeRoutesResponse); - - /** ComputeRoutesResponse routes. */ - public routes: google.maps.routing.v2.IRoute[]; - - /** ComputeRoutesResponse fallbackInfo. */ - public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); - - /** ComputeRoutesResponse geocodingResults. */ - public geocodingResults?: (google.maps.routing.v2.IGeocodingResults|null); - - /** - * Creates a new ComputeRoutesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeRoutesResponse instance - */ - public static create(properties?: google.maps.routing.v2.IComputeRoutesResponse): google.maps.routing.v2.ComputeRoutesResponse; - - /** - * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. - * @param message ComputeRoutesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. - * @param message ComputeRoutesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeRoutesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeRoutesResponse - * @throws {Error} If the payload is not 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.routing.v2.ComputeRoutesResponse; - - /** - * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeRoutesResponse - * @throws {Error} If the payload 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.routing.v2.ComputeRoutesResponse; - - /** - * Verifies a ComputeRoutesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeRoutesResponse - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesResponse; - - /** - * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. - * @param message ComputeRoutesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.ComputeRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeRoutesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeRoutesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeRouteMatrixRequest. */ - interface IComputeRouteMatrixRequest { - - /** ComputeRouteMatrixRequest origins */ - origins?: (google.maps.routing.v2.IRouteMatrixOrigin[]|null); - - /** ComputeRouteMatrixRequest destinations */ - destinations?: (google.maps.routing.v2.IRouteMatrixDestination[]|null); - - /** ComputeRouteMatrixRequest travelMode */ - travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); - - /** ComputeRouteMatrixRequest routingPreference */ - routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); - - /** ComputeRouteMatrixRequest departureTime */ - departureTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRouteMatrixRequest arrivalTime */ - arrivalTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRouteMatrixRequest languageCode */ - languageCode?: (string|null); - - /** ComputeRouteMatrixRequest regionCode */ - regionCode?: (string|null); - - /** ComputeRouteMatrixRequest units */ - units?: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units|null); - - /** ComputeRouteMatrixRequest extraComputations */ - extraComputations?: (google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[]|null); - - /** ComputeRouteMatrixRequest trafficModel */ - trafficModel?: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel|null); - - /** ComputeRouteMatrixRequest transitPreferences */ - transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); - } - - /** Represents a ComputeRouteMatrixRequest. */ - class ComputeRouteMatrixRequest implements IComputeRouteMatrixRequest { - - /** - * Constructs a new ComputeRouteMatrixRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest); - - /** ComputeRouteMatrixRequest origins. */ - public origins: google.maps.routing.v2.IRouteMatrixOrigin[]; - - /** ComputeRouteMatrixRequest destinations. */ - public destinations: google.maps.routing.v2.IRouteMatrixDestination[]; - - /** ComputeRouteMatrixRequest travelMode. */ - public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); - - /** ComputeRouteMatrixRequest routingPreference. */ - public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); - - /** ComputeRouteMatrixRequest departureTime. */ - public departureTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRouteMatrixRequest arrivalTime. */ - public arrivalTime?: (google.protobuf.ITimestamp|null); - - /** ComputeRouteMatrixRequest languageCode. */ - public languageCode: string; - - /** ComputeRouteMatrixRequest regionCode. */ - public regionCode: string; - - /** ComputeRouteMatrixRequest units. */ - public units: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units); - - /** ComputeRouteMatrixRequest extraComputations. */ - public extraComputations: google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[]; - - /** ComputeRouteMatrixRequest trafficModel. */ - public trafficModel: (google.maps.routing.v2.TrafficModel|keyof typeof google.maps.routing.v2.TrafficModel); - - /** ComputeRouteMatrixRequest transitPreferences. */ - public transitPreferences?: (google.maps.routing.v2.ITransitPreferences|null); - - /** - * Creates a new ComputeRouteMatrixRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeRouteMatrixRequest instance - */ - public static create(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest): google.maps.routing.v2.ComputeRouteMatrixRequest; - - /** - * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. - * @param message ComputeRouteMatrixRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. - * @param message ComputeRouteMatrixRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeRouteMatrixRequest - * @throws {Error} If the payload is not 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.routing.v2.ComputeRouteMatrixRequest; - - /** - * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeRouteMatrixRequest - * @throws {Error} If the payload 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.routing.v2.ComputeRouteMatrixRequest; - - /** - * Verifies a ComputeRouteMatrixRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeRouteMatrixRequest - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRouteMatrixRequest; - - /** - * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. - * @param message ComputeRouteMatrixRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.ComputeRouteMatrixRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeRouteMatrixRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeRouteMatrixRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ComputeRouteMatrixRequest { - - /** ExtraComputation enum. */ - enum ExtraComputation { - EXTRA_COMPUTATION_UNSPECIFIED = 0, - TOLLS = 1 - } - } - - /** Properties of a RouteMatrixOrigin. */ - interface IRouteMatrixOrigin { - - /** RouteMatrixOrigin waypoint */ - waypoint?: (google.maps.routing.v2.IWaypoint|null); - - /** RouteMatrixOrigin routeModifiers */ - routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); - } - - /** Represents a RouteMatrixOrigin. */ - class RouteMatrixOrigin implements IRouteMatrixOrigin { - - /** - * Constructs a new RouteMatrixOrigin. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteMatrixOrigin); - - /** RouteMatrixOrigin waypoint. */ - public waypoint?: (google.maps.routing.v2.IWaypoint|null); - - /** RouteMatrixOrigin routeModifiers. */ - public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); - - /** - * Creates a new RouteMatrixOrigin instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteMatrixOrigin instance - */ - public static create(properties?: google.maps.routing.v2.IRouteMatrixOrigin): google.maps.routing.v2.RouteMatrixOrigin; - - /** - * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. - * @param message RouteMatrixOrigin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. - * @param message RouteMatrixOrigin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteMatrixOrigin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteMatrixOrigin - * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixOrigin; - - /** - * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteMatrixOrigin - * @throws {Error} If the payload 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.routing.v2.RouteMatrixOrigin; - - /** - * Verifies a RouteMatrixOrigin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteMatrixOrigin - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixOrigin; - - /** - * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. - * @param message RouteMatrixOrigin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteMatrixOrigin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteMatrixOrigin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteMatrixOrigin - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RouteMatrixDestination. */ - interface IRouteMatrixDestination { - - /** RouteMatrixDestination waypoint */ - waypoint?: (google.maps.routing.v2.IWaypoint|null); - } - - /** Represents a RouteMatrixDestination. */ - class RouteMatrixDestination implements IRouteMatrixDestination { - - /** - * Constructs a new RouteMatrixDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteMatrixDestination); - - /** RouteMatrixDestination waypoint. */ - public waypoint?: (google.maps.routing.v2.IWaypoint|null); - - /** - * Creates a new RouteMatrixDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteMatrixDestination instance - */ - public static create(properties?: google.maps.routing.v2.IRouteMatrixDestination): google.maps.routing.v2.RouteMatrixDestination; - - /** - * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. - * @param message RouteMatrixDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. - * @param message RouteMatrixDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteMatrixDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteMatrixDestination - * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixDestination; - - /** - * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteMatrixDestination - * @throws {Error} If the payload 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.routing.v2.RouteMatrixDestination; - - /** - * Verifies a RouteMatrixDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteMatrixDestination - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixDestination; - - /** - * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. - * @param message RouteMatrixDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteMatrixDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteMatrixDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteMatrixDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RouteMatrixElement. */ - interface IRouteMatrixElement { - - /** RouteMatrixElement originIndex */ - originIndex?: (number|null); - - /** RouteMatrixElement destinationIndex */ - destinationIndex?: (number|null); - - /** RouteMatrixElement status */ - status?: (google.rpc.IStatus|null); - - /** RouteMatrixElement condition */ - condition?: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition|null); - - /** RouteMatrixElement distanceMeters */ - distanceMeters?: (number|null); - - /** RouteMatrixElement duration */ - duration?: (google.protobuf.IDuration|null); - - /** RouteMatrixElement staticDuration */ - staticDuration?: (google.protobuf.IDuration|null); - - /** RouteMatrixElement travelAdvisory */ - travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); - - /** RouteMatrixElement fallbackInfo */ - fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); - - /** RouteMatrixElement localizedValues */ - localizedValues?: (google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null); - } - - /** Represents a RouteMatrixElement. */ - class RouteMatrixElement implements IRouteMatrixElement { - - /** - * Constructs a new RouteMatrixElement. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.IRouteMatrixElement); - - /** RouteMatrixElement originIndex. */ - public originIndex?: (number|null); - - /** RouteMatrixElement destinationIndex. */ - public destinationIndex?: (number|null); - - /** RouteMatrixElement status. */ - public status?: (google.rpc.IStatus|null); - - /** RouteMatrixElement condition. */ - public condition: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition); - - /** RouteMatrixElement distanceMeters. */ - public distanceMeters: number; - - /** RouteMatrixElement duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** RouteMatrixElement staticDuration. */ - public staticDuration?: (google.protobuf.IDuration|null); - - /** RouteMatrixElement travelAdvisory. */ - public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); - - /** RouteMatrixElement fallbackInfo. */ - public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); - - /** RouteMatrixElement localizedValues. */ - public localizedValues?: (google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null); - - /** - * Creates a new RouteMatrixElement instance using the specified properties. - * @param [properties] Properties to set - * @returns RouteMatrixElement instance - */ - public static create(properties?: google.maps.routing.v2.IRouteMatrixElement): google.maps.routing.v2.RouteMatrixElement; - - /** - * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. - * @param message RouteMatrixElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. - * @param message RouteMatrixElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RouteMatrixElement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RouteMatrixElement - * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixElement; - - /** - * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RouteMatrixElement - * @throws {Error} If the payload 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.routing.v2.RouteMatrixElement; - - /** - * Verifies a RouteMatrixElement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RouteMatrixElement - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixElement; - - /** - * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. - * @param message RouteMatrixElement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteMatrixElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RouteMatrixElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RouteMatrixElement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RouteMatrixElement { - - /** Properties of a LocalizedValues. */ - interface ILocalizedValues { - - /** LocalizedValues distance */ - distance?: (google.type.ILocalizedText|null); - - /** LocalizedValues duration */ - duration?: (google.type.ILocalizedText|null); - - /** LocalizedValues staticDuration */ - staticDuration?: (google.type.ILocalizedText|null); - - /** LocalizedValues transitFare */ - transitFare?: (google.type.ILocalizedText|null); - } - - /** Represents a LocalizedValues. */ - class LocalizedValues implements ILocalizedValues { - - /** - * Constructs a new LocalizedValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues); - - /** LocalizedValues distance. */ - public distance?: (google.type.ILocalizedText|null); - - /** LocalizedValues duration. */ - public duration?: (google.type.ILocalizedText|null); - - /** LocalizedValues staticDuration. */ - public staticDuration?: (google.type.ILocalizedText|null); - - /** LocalizedValues transitFare. */ - public transitFare?: (google.type.ILocalizedText|null); - - /** - * Creates a new LocalizedValues instance using the specified properties. - * @param [properties] Properties to set - * @returns LocalizedValues instance - */ - public static create(properties?: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues): google.maps.routing.v2.RouteMatrixElement.LocalizedValues; - - /** - * Encodes the specified LocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. - * @param message LocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. - * @param message LocalizedValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.RouteMatrixElement.ILocalizedValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocalizedValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocalizedValues - * @throws {Error} If the payload is not 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.routing.v2.RouteMatrixElement.LocalizedValues; - - /** - * Decodes a LocalizedValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocalizedValues - * @throws {Error} If the payload 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.routing.v2.RouteMatrixElement.LocalizedValues; - - /** - * Verifies a LocalizedValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocalizedValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocalizedValues - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixElement.LocalizedValues; - - /** - * Creates a plain object from a LocalizedValues message. Also converts values to other types if specified. - * @param message LocalizedValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.RouteMatrixElement.LocalizedValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocalizedValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocalizedValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** RouteMatrixElementCondition enum. */ - enum RouteMatrixElementCondition { - ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0, - ROUTE_EXISTS = 1, - ROUTE_NOT_FOUND = 2 - } - - /** RoutingPreference enum. */ - enum RoutingPreference { - ROUTING_PREFERENCE_UNSPECIFIED = 0, - TRAFFIC_UNAWARE = 1, - TRAFFIC_AWARE = 2, - TRAFFIC_AWARE_OPTIMAL = 3 - } - - /** TrafficModel enum. */ - enum TrafficModel { - TRAFFIC_MODEL_UNSPECIFIED = 0, - BEST_GUESS = 1, - PESSIMISTIC = 2, - OPTIMISTIC = 3 - } - - /** Properties of a TransitPreferences. */ - interface ITransitPreferences { - - /** TransitPreferences allowedTravelModes */ - allowedTravelModes?: (google.maps.routing.v2.TransitPreferences.TransitTravelMode[]|null); - - /** TransitPreferences routingPreference */ - routingPreference?: (google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|keyof typeof google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|null); - } - - /** Represents a TransitPreferences. */ - class TransitPreferences implements ITransitPreferences { - - /** - * Constructs a new TransitPreferences. - * @param [properties] Properties to set - */ - constructor(properties?: google.maps.routing.v2.ITransitPreferences); - - /** TransitPreferences allowedTravelModes. */ - public allowedTravelModes: google.maps.routing.v2.TransitPreferences.TransitTravelMode[]; - - /** TransitPreferences routingPreference. */ - public routingPreference: (google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|keyof typeof google.maps.routing.v2.TransitPreferences.TransitRoutingPreference); - - /** - * Creates a new TransitPreferences instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitPreferences instance - */ - public static create(properties?: google.maps.routing.v2.ITransitPreferences): google.maps.routing.v2.TransitPreferences; - - /** - * Encodes the specified TransitPreferences message. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. - * @param message TransitPreferences message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.maps.routing.v2.ITransitPreferences, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitPreferences message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. - * @param message TransitPreferences message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.maps.routing.v2.ITransitPreferences, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitPreferences message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitPreferences - * @throws {Error} If the payload is not 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.routing.v2.TransitPreferences; - - /** - * Decodes a TransitPreferences message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitPreferences - * @throws {Error} If the payload 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.routing.v2.TransitPreferences; - - /** - * Verifies a TransitPreferences message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransitPreferences message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitPreferences - */ - public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TransitPreferences; - - /** - * Creates a plain object from a TransitPreferences message. Also converts values to other types if specified. - * @param message TransitPreferences - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.maps.routing.v2.TransitPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitPreferences to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitPreferences - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransitPreferences { - - /** TransitTravelMode enum. */ - enum TransitTravelMode { - TRANSIT_TRAVEL_MODE_UNSPECIFIED = 0, - BUS = 1, - SUBWAY = 2, - TRAIN = 3, - LIGHT_RAIL = 4, - RAIL = 5 - } - - /** TransitRoutingPreference enum. */ - enum TransitRoutingPreference { - TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED = 0, - LESS_WALKING = 1, - FEWER_TRANSFERS = 2 - } - } - - /** Units enum. */ - enum Units { - UNITS_UNSPECIFIED = 0, - METRIC = 1, - IMPERIAL = 2 - } - - /** Properties of a Waypoint. */ - interface IWaypoint { - - /** Waypoint location */ - location?: (google.maps.routing.v2.ILocation|null); - - /** Waypoint placeId */ - placeId?: (string|null); - - /** Waypoint address */ - address?: (string|null); - - /** Waypoint navigationPointToken */ - navigationPointToken?: (string|null); - - /** Waypoint via */ - via?: (boolean|null); - - /** Waypoint vehicleStopover */ - vehicleStopover?: (boolean|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.routing.v2.IWaypoint); - - /** Waypoint location. */ - public location?: (google.maps.routing.v2.ILocation|null); - - /** Waypoint placeId. */ - public placeId?: (string|null); - - /** Waypoint address. */ - public address?: (string|null); - - /** Waypoint navigationPointToken. */ - public navigationPointToken?: (string|null); - - /** Waypoint via. */ - public via: boolean; - - /** Waypoint vehicleStopover. */ - public vehicleStopover: boolean; - - /** Waypoint sideOfRoad. */ - public sideOfRoad: boolean; - - /** Waypoint locationType. */ - public locationType?: ("location"|"placeId"|"address"|"navigationPointToken"); - - /** - * Creates a new Waypoint instance using the specified properties. - * @param [properties] Properties to set - * @returns Waypoint instance - */ - public static create(properties?: google.maps.routing.v2.IWaypoint): google.maps.routing.v2.Waypoint; - - /** - * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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.routing.v2.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; - } - } - } - } - - /** 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 api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - } -} diff --git a/owl-bot-staging/google-maps-routing/protos/protos.js b/owl-bot-staging/google-maps-routing/protos/protos.js deleted file mode 100644 index f61a469c4b6..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/protos.js +++ /dev/null @@ -1,37043 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._googlemaps_routing_protos || ($protobuf.roots._googlemaps_routing_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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 a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - 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 a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(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]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - */ - - /** - * 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ - - /** - * 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; - - /** - * 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.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - 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"; - } - 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]); - } - 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.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.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - return protobuf; - })(); - - google.geo = (function() { - - /** - * Namespace geo. - * @memberof google - * @namespace - */ - var geo = {}; - - geo.type = (function() { - - /** - * Namespace type. - * @memberof google.geo - * @namespace - */ - var type = {}; - - type.Viewport = (function() { - - /** - * Properties of a Viewport. - * @memberof google.geo.type - * @interface IViewport - * @property {google.type.ILatLng|null} [low] Viewport low - * @property {google.type.ILatLng|null} [high] Viewport high - */ - - /** - * Constructs a new Viewport. - * @memberof google.geo.type - * @classdesc Represents a Viewport. - * @implements IViewport - * @constructor - * @param {google.geo.type.IViewport=} [properties] Properties to set - */ - function Viewport(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Viewport low. - * @member {google.type.ILatLng|null|undefined} low - * @memberof google.geo.type.Viewport - * @instance - */ - Viewport.prototype.low = null; - - /** - * Viewport high. - * @member {google.type.ILatLng|null|undefined} high - * @memberof google.geo.type.Viewport - * @instance - */ - Viewport.prototype.high = null; - - /** - * Creates a new Viewport instance using the specified properties. - * @function create - * @memberof google.geo.type.Viewport - * @static - * @param {google.geo.type.IViewport=} [properties] Properties to set - * @returns {google.geo.type.Viewport} Viewport instance - */ - Viewport.create = function create(properties) { - return new Viewport(properties); - }; - - /** - * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. - * @function encode - * @memberof google.geo.type.Viewport - * @static - * @param {google.geo.type.IViewport} message Viewport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Viewport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.low != null && Object.hasOwnProperty.call(message, "low")) - $root.google.type.LatLng.encode(message.low, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.high != null && Object.hasOwnProperty.call(message, "high")) - $root.google.type.LatLng.encode(message.high, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.geo.type.Viewport - * @static - * @param {google.geo.type.IViewport} message Viewport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Viewport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Viewport message from the specified reader or buffer. - * @function decode - * @memberof google.geo.type.Viewport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.geo.type.Viewport} Viewport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Viewport.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.geo.type.Viewport(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.low = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - } - case 2: { - message.high = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Viewport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.geo.type.Viewport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.geo.type.Viewport} Viewport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Viewport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Viewport message. - * @function verify - * @memberof google.geo.type.Viewport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Viewport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.low != null && message.hasOwnProperty("low")) { - var error = $root.google.type.LatLng.verify(message.low); - if (error) - return "low." + error; - } - if (message.high != null && message.hasOwnProperty("high")) { - var error = $root.google.type.LatLng.verify(message.high); - if (error) - return "high." + error; - } - return null; - }; - - /** - * Creates a Viewport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.geo.type.Viewport - * @static - * @param {Object.} object Plain object - * @returns {google.geo.type.Viewport} Viewport - */ - Viewport.fromObject = function fromObject(object) { - if (object instanceof $root.google.geo.type.Viewport) - return object; - var message = new $root.google.geo.type.Viewport(); - if (object.low != null) { - if (typeof object.low !== "object") - throw TypeError(".google.geo.type.Viewport.low: object expected"); - message.low = $root.google.type.LatLng.fromObject(object.low); - } - if (object.high != null) { - if (typeof object.high !== "object") - throw TypeError(".google.geo.type.Viewport.high: object expected"); - message.high = $root.google.type.LatLng.fromObject(object.high); - } - return message; - }; - - /** - * Creates a plain object from a Viewport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.geo.type.Viewport - * @static - * @param {google.geo.type.Viewport} message Viewport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Viewport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.low = null; - object.high = null; - } - if (message.low != null && message.hasOwnProperty("low")) - object.low = $root.google.type.LatLng.toObject(message.low, options); - if (message.high != null && message.hasOwnProperty("high")) - object.high = $root.google.type.LatLng.toObject(message.high, options); - return object; - }; - - /** - * Converts this Viewport to JSON. - * @function toJSON - * @memberof google.geo.type.Viewport - * @instance - * @returns {Object.} JSON object - */ - Viewport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Viewport - * @function getTypeUrl - * @memberof google.geo.type.Viewport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Viewport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.geo.type.Viewport"; - }; - - return Viewport; - })(); - - return type; - })(); - - return geo; - })(); - - 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, error) { - 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(); - if (tag === error) - break; - 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; - })(); - - type.LocalizedText = (function() { - - /** - * Properties of a LocalizedText. - * @memberof google.type - * @interface ILocalizedText - * @property {string|null} [text] LocalizedText text - * @property {string|null} [languageCode] LocalizedText languageCode - */ - - /** - * Constructs a new LocalizedText. - * @memberof google.type - * @classdesc Represents a LocalizedText. - * @implements ILocalizedText - * @constructor - * @param {google.type.ILocalizedText=} [properties] Properties to set - */ - function LocalizedText(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocalizedText text. - * @member {string} text - * @memberof google.type.LocalizedText - * @instance - */ - LocalizedText.prototype.text = ""; - - /** - * LocalizedText languageCode. - * @member {string} languageCode - * @memberof google.type.LocalizedText - * @instance - */ - LocalizedText.prototype.languageCode = ""; - - /** - * Creates a new LocalizedText instance using the specified properties. - * @function create - * @memberof google.type.LocalizedText - * @static - * @param {google.type.ILocalizedText=} [properties] Properties to set - * @returns {google.type.LocalizedText} LocalizedText instance - */ - LocalizedText.create = function create(properties) { - return new LocalizedText(properties); - }; - - /** - * Encodes the specified LocalizedText message. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. - * @function encode - * @memberof google.type.LocalizedText - * @static - * @param {google.type.ILocalizedText} message LocalizedText message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedText.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - return writer; - }; - - /** - * Encodes the specified LocalizedText message, length delimited. Does not implicitly {@link google.type.LocalizedText.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.LocalizedText - * @static - * @param {google.type.ILocalizedText} message LocalizedText message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedText.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocalizedText message from the specified reader or buffer. - * @function decode - * @memberof google.type.LocalizedText - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.LocalizedText} LocalizedText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedText.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LocalizedText(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.languageCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocalizedText message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.LocalizedText - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.LocalizedText} LocalizedText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedText.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocalizedText message. - * @function verify - * @memberof google.type.LocalizedText - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocalizedText.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; - - /** - * Creates a LocalizedText message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.LocalizedText - * @static - * @param {Object.} object Plain object - * @returns {google.type.LocalizedText} LocalizedText - */ - LocalizedText.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.LocalizedText) - return object; - var message = new $root.google.type.LocalizedText(); - if (object.text != null) - message.text = String(object.text); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; - - /** - * Creates a plain object from a LocalizedText message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.LocalizedText - * @static - * @param {google.type.LocalizedText} message LocalizedText - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocalizedText.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.languageCode = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; - - /** - * Converts this LocalizedText to JSON. - * @function toJSON - * @memberof google.type.LocalizedText - * @instance - * @returns {Object.} JSON object - */ - LocalizedText.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocalizedText - * @function getTypeUrl - * @memberof google.type.LocalizedText - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocalizedText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.LocalizedText"; - }; - - return LocalizedText; - })(); - - type.Money = (function() { - - /** - * Properties of a Money. - * @memberof google.type - * @interface IMoney - * @property {string|null} [currencyCode] Money currencyCode - * @property {number|Long|null} [units] Money units - * @property {number|null} [nanos] Money nanos - */ - - /** - * Constructs a new Money. - * @memberof google.type - * @classdesc Represents a Money. - * @implements IMoney - * @constructor - * @param {google.type.IMoney=} [properties] Properties to set - */ - function Money(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Money currencyCode. - * @member {string} currencyCode - * @memberof google.type.Money - * @instance - */ - Money.prototype.currencyCode = ""; - - /** - * Money units. - * @member {number|Long} units - * @memberof google.type.Money - * @instance - */ - Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Money nanos. - * @member {number} nanos - * @memberof google.type.Money - * @instance - */ - Money.prototype.nanos = 0; - - /** - * Creates a new Money instance using the specified properties. - * @function create - * @memberof google.type.Money - * @static - * @param {google.type.IMoney=} [properties] Properties to set - * @returns {google.type.Money} Money instance - */ - Money.create = function create(properties) { - return new Money(properties); - }; - - /** - * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @function encode - * @memberof google.type.Money - * @static - * @param {google.type.IMoney} message Money message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Money.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); - if (message.units != null && Object.hasOwnProperty.call(message, "units")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Money - * @static - * @param {google.type.IMoney} message Money message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Money.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Money message from the specified reader or buffer. - * @function decode - * @memberof google.type.Money - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Money} Money - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Money.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.currencyCode = reader.string(); - break; - } - case 2: { - message.units = reader.int64(); - break; - } - case 3: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Money message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Money - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Money} Money - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Money.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Money message. - * @function verify - * @memberof google.type.Money - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Money.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.units != null && message.hasOwnProperty("units")) - if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) - return "units: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Money message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Money - * @static - * @param {Object.} object Plain object - * @returns {google.type.Money} Money - */ - Money.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Money) - return object; - var message = new $root.google.type.Money(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.units != null) - if ($util.Long) - (message.units = $util.Long.fromValue(object.units)).unsigned = false; - else if (typeof object.units === "string") - message.units = parseInt(object.units, 10); - else if (typeof object.units === "number") - message.units = object.units; - else if (typeof object.units === "object") - message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Money message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Money - * @static - * @param {google.type.Money} message Money - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Money.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.currencyCode = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.units = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.units != null && message.hasOwnProperty("units")) - if (typeof message.units === "number") - object.units = options.longs === String ? String(message.units) : message.units; - else - object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Money to JSON. - * @function toJSON - * @memberof google.type.Money - * @instance - * @returns {Object.} JSON object - */ - Money.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Money - * @function getTypeUrl - * @memberof google.type.Money - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Money"; - }; - - return Money; - })(); - - return type; - })(); - - google.maps = (function() { - - /** - * Namespace maps. - * @memberof google - * @namespace - */ - var maps = {}; - - maps.routing = (function() { - - /** - * Namespace routing. - * @memberof google.maps - * @namespace - */ - var routing = {}; - - routing.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.maps.routing - * @namespace - */ - var v2 = {}; - - v2.FallbackInfo = (function() { - - /** - * Properties of a FallbackInfo. - * @memberof google.maps.routing.v2 - * @interface IFallbackInfo - * @property {google.maps.routing.v2.FallbackRoutingMode|null} [routingMode] FallbackInfo routingMode - * @property {google.maps.routing.v2.FallbackReason|null} [reason] FallbackInfo reason - */ - - /** - * Constructs a new FallbackInfo. - * @memberof google.maps.routing.v2 - * @classdesc Represents a FallbackInfo. - * @implements IFallbackInfo - * @constructor - * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set - */ - function FallbackInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FallbackInfo routingMode. - * @member {google.maps.routing.v2.FallbackRoutingMode} routingMode - * @memberof google.maps.routing.v2.FallbackInfo - * @instance - */ - FallbackInfo.prototype.routingMode = 0; - - /** - * FallbackInfo reason. - * @member {google.maps.routing.v2.FallbackReason} reason - * @memberof google.maps.routing.v2.FallbackInfo - * @instance - */ - FallbackInfo.prototype.reason = 0; - - /** - * Creates a new FallbackInfo instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set - * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo instance - */ - FallbackInfo.create = function create(properties) { - return new FallbackInfo(properties); - }; - - /** - * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FallbackInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.routingMode != null && Object.hasOwnProperty.call(message, "routingMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.routingMode); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); - return writer; - }; - - /** - * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FallbackInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FallbackInfo message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FallbackInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.FallbackInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.routingMode = reader.int32(); - break; - } - case 2: { - message.reason = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FallbackInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FallbackInfo message. - * @function verify - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FallbackInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.routingMode != null && message.hasOwnProperty("routingMode")) - switch (message.routingMode) { - default: - return "routingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo - */ - FallbackInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.FallbackInfo) - return object; - var message = new $root.google.maps.routing.v2.FallbackInfo(); - switch (object.routingMode) { - default: - if (typeof object.routingMode === "number") { - message.routingMode = object.routingMode; - break; - } - break; - case "FALLBACK_ROUTING_MODE_UNSPECIFIED": - case 0: - message.routingMode = 0; - break; - case "FALLBACK_TRAFFIC_UNAWARE": - case 1: - message.routingMode = 1; - break; - case "FALLBACK_TRAFFIC_AWARE": - case 2: - message.routingMode = 2; - break; - } - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "FALLBACK_REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "SERVER_ERROR": - case 1: - message.reason = 1; - break; - case "LATENCY_EXCEEDED": - case 2: - message.reason = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {google.maps.routing.v2.FallbackInfo} message FallbackInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FallbackInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.routingMode = options.enums === String ? "FALLBACK_ROUTING_MODE_UNSPECIFIED" : 0; - object.reason = options.enums === String ? "FALLBACK_REASON_UNSPECIFIED" : 0; - } - if (message.routingMode != null && message.hasOwnProperty("routingMode")) - object.routingMode = options.enums === String ? $root.google.maps.routing.v2.FallbackRoutingMode[message.routingMode] === undefined ? message.routingMode : $root.google.maps.routing.v2.FallbackRoutingMode[message.routingMode] : message.routingMode; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.maps.routing.v2.FallbackReason[message.reason] === undefined ? message.reason : $root.google.maps.routing.v2.FallbackReason[message.reason] : message.reason; - return object; - }; - - /** - * Converts this FallbackInfo to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.FallbackInfo - * @instance - * @returns {Object.} JSON object - */ - FallbackInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FallbackInfo - * @function getTypeUrl - * @memberof google.maps.routing.v2.FallbackInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FallbackInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.FallbackInfo"; - }; - - return FallbackInfo; - })(); - - /** - * FallbackReason enum. - * @name google.maps.routing.v2.FallbackReason - * @enum {number} - * @property {number} FALLBACK_REASON_UNSPECIFIED=0 FALLBACK_REASON_UNSPECIFIED value - * @property {number} SERVER_ERROR=1 SERVER_ERROR value - * @property {number} LATENCY_EXCEEDED=2 LATENCY_EXCEEDED value - */ - v2.FallbackReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FALLBACK_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERVER_ERROR"] = 1; - values[valuesById[2] = "LATENCY_EXCEEDED"] = 2; - return values; - })(); - - /** - * FallbackRoutingMode enum. - * @name google.maps.routing.v2.FallbackRoutingMode - * @enum {number} - * @property {number} FALLBACK_ROUTING_MODE_UNSPECIFIED=0 FALLBACK_ROUTING_MODE_UNSPECIFIED value - * @property {number} FALLBACK_TRAFFIC_UNAWARE=1 FALLBACK_TRAFFIC_UNAWARE value - * @property {number} FALLBACK_TRAFFIC_AWARE=2 FALLBACK_TRAFFIC_AWARE value - */ - v2.FallbackRoutingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FALLBACK_ROUTING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FALLBACK_TRAFFIC_UNAWARE"] = 1; - values[valuesById[2] = "FALLBACK_TRAFFIC_AWARE"] = 2; - return values; - })(); - - v2.GeocodingResults = (function() { - - /** - * Properties of a GeocodingResults. - * @memberof google.maps.routing.v2 - * @interface IGeocodingResults - * @property {google.maps.routing.v2.IGeocodedWaypoint|null} [origin] GeocodingResults origin - * @property {google.maps.routing.v2.IGeocodedWaypoint|null} [destination] GeocodingResults destination - * @property {Array.|null} [intermediates] GeocodingResults intermediates - */ - - /** - * Constructs a new GeocodingResults. - * @memberof google.maps.routing.v2 - * @classdesc Represents a GeocodingResults. - * @implements IGeocodingResults - * @constructor - * @param {google.maps.routing.v2.IGeocodingResults=} [properties] Properties to set - */ - function GeocodingResults(properties) { - this.intermediates = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeocodingResults origin. - * @member {google.maps.routing.v2.IGeocodedWaypoint|null|undefined} origin - * @memberof google.maps.routing.v2.GeocodingResults - * @instance - */ - GeocodingResults.prototype.origin = null; - - /** - * GeocodingResults destination. - * @member {google.maps.routing.v2.IGeocodedWaypoint|null|undefined} destination - * @memberof google.maps.routing.v2.GeocodingResults - * @instance - */ - GeocodingResults.prototype.destination = null; - - /** - * GeocodingResults intermediates. - * @member {Array.} intermediates - * @memberof google.maps.routing.v2.GeocodingResults - * @instance - */ - GeocodingResults.prototype.intermediates = $util.emptyArray; - - /** - * Creates a new GeocodingResults instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {google.maps.routing.v2.IGeocodingResults=} [properties] Properties to set - * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults instance - */ - GeocodingResults.create = function create(properties) { - return new GeocodingResults(properties); - }; - - /** - * Encodes the specified GeocodingResults message. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {google.maps.routing.v2.IGeocodingResults} message GeocodingResults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeocodingResults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) - $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.destination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.intermediates != null && message.intermediates.length) - for (var i = 0; i < message.intermediates.length; ++i) - $root.google.maps.routing.v2.GeocodedWaypoint.encode(message.intermediates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeocodingResults message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodingResults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {google.maps.routing.v2.IGeocodingResults} message GeocodingResults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeocodingResults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeocodingResults message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeocodingResults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.GeocodingResults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.origin = $root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32()); - break; - } - case 2: { - message.destination = $root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.intermediates && message.intermediates.length)) - message.intermediates = []; - message.intermediates.push($root.google.maps.routing.v2.GeocodedWaypoint.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeocodingResults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeocodingResults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeocodingResults message. - * @function verify - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeocodingResults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.origin != null && message.hasOwnProperty("origin")) { - var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.origin); - if (error) - return "origin." + error; - } - if (message.destination != null && message.hasOwnProperty("destination")) { - var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.destination); - if (error) - return "destination." + error; - } - if (message.intermediates != null && message.hasOwnProperty("intermediates")) { - if (!Array.isArray(message.intermediates)) - return "intermediates: array expected"; - for (var i = 0; i < message.intermediates.length; ++i) { - var error = $root.google.maps.routing.v2.GeocodedWaypoint.verify(message.intermediates[i]); - if (error) - return "intermediates." + error; - } - } - return null; - }; - - /** - * Creates a GeocodingResults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.GeocodingResults} GeocodingResults - */ - GeocodingResults.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.GeocodingResults) - return object; - var message = new $root.google.maps.routing.v2.GeocodingResults(); - if (object.origin != null) { - if (typeof object.origin !== "object") - throw TypeError(".google.maps.routing.v2.GeocodingResults.origin: object expected"); - message.origin = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.origin); - } - if (object.destination != null) { - if (typeof object.destination !== "object") - throw TypeError(".google.maps.routing.v2.GeocodingResults.destination: object expected"); - message.destination = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.destination); - } - if (object.intermediates) { - if (!Array.isArray(object.intermediates)) - throw TypeError(".google.maps.routing.v2.GeocodingResults.intermediates: array expected"); - message.intermediates = []; - for (var i = 0; i < object.intermediates.length; ++i) { - if (typeof object.intermediates[i] !== "object") - throw TypeError(".google.maps.routing.v2.GeocodingResults.intermediates: object expected"); - message.intermediates[i] = $root.google.maps.routing.v2.GeocodedWaypoint.fromObject(object.intermediates[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeocodingResults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {google.maps.routing.v2.GeocodingResults} message GeocodingResults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeocodingResults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intermediates = []; - if (options.defaults) { - object.origin = null; - object.destination = null; - } - if (message.origin != null && message.hasOwnProperty("origin")) - object.origin = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.origin, options); - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.destination, options); - if (message.intermediates && message.intermediates.length) { - object.intermediates = []; - for (var j = 0; j < message.intermediates.length; ++j) - object.intermediates[j] = $root.google.maps.routing.v2.GeocodedWaypoint.toObject(message.intermediates[j], options); - } - return object; - }; - - /** - * Converts this GeocodingResults to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.GeocodingResults - * @instance - * @returns {Object.} JSON object - */ - GeocodingResults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeocodingResults - * @function getTypeUrl - * @memberof google.maps.routing.v2.GeocodingResults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeocodingResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.GeocodingResults"; - }; - - return GeocodingResults; - })(); - - v2.GeocodedWaypoint = (function() { - - /** - * Properties of a GeocodedWaypoint. - * @memberof google.maps.routing.v2 - * @interface IGeocodedWaypoint - * @property {google.rpc.IStatus|null} [geocoderStatus] GeocodedWaypoint geocoderStatus - * @property {number|null} [intermediateWaypointRequestIndex] GeocodedWaypoint intermediateWaypointRequestIndex - * @property {Array.|null} [type] GeocodedWaypoint type - * @property {boolean|null} [partialMatch] GeocodedWaypoint partialMatch - * @property {string|null} [placeId] GeocodedWaypoint placeId - */ - - /** - * Constructs a new GeocodedWaypoint. - * @memberof google.maps.routing.v2 - * @classdesc Represents a GeocodedWaypoint. - * @implements IGeocodedWaypoint - * @constructor - * @param {google.maps.routing.v2.IGeocodedWaypoint=} [properties] Properties to set - */ - function GeocodedWaypoint(properties) { - this.type = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeocodedWaypoint geocoderStatus. - * @member {google.rpc.IStatus|null|undefined} geocoderStatus - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - */ - GeocodedWaypoint.prototype.geocoderStatus = null; - - /** - * GeocodedWaypoint intermediateWaypointRequestIndex. - * @member {number|null|undefined} intermediateWaypointRequestIndex - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - */ - GeocodedWaypoint.prototype.intermediateWaypointRequestIndex = null; - - /** - * GeocodedWaypoint type. - * @member {Array.} type - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - */ - GeocodedWaypoint.prototype.type = $util.emptyArray; - - /** - * GeocodedWaypoint partialMatch. - * @member {boolean} partialMatch - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - */ - GeocodedWaypoint.prototype.partialMatch = false; - - /** - * GeocodedWaypoint placeId. - * @member {string} placeId - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - */ - GeocodedWaypoint.prototype.placeId = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GeocodedWaypoint.prototype, "_intermediateWaypointRequestIndex", { - get: $util.oneOfGetter($oneOfFields = ["intermediateWaypointRequestIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GeocodedWaypoint instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {google.maps.routing.v2.IGeocodedWaypoint=} [properties] Properties to set - * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint instance - */ - GeocodedWaypoint.create = function create(properties) { - return new GeocodedWaypoint(properties); - }; - - /** - * Encodes the specified GeocodedWaypoint message. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {google.maps.routing.v2.IGeocodedWaypoint} message GeocodedWaypoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeocodedWaypoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.geocoderStatus != null && Object.hasOwnProperty.call(message, "geocoderStatus")) - $root.google.rpc.Status.encode(message.geocoderStatus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.intermediateWaypointRequestIndex != null && Object.hasOwnProperty.call(message, "intermediateWaypointRequestIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intermediateWaypointRequestIndex); - if (message.type != null && message.type.length) - for (var i = 0; i < message.type.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type[i]); - if (message.partialMatch != null && Object.hasOwnProperty.call(message, "partialMatch")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.partialMatch); - if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.placeId); - return writer; - }; - - /** - * Encodes the specified GeocodedWaypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.GeocodedWaypoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {google.maps.routing.v2.IGeocodedWaypoint} message GeocodedWaypoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeocodedWaypoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeocodedWaypoint message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeocodedWaypoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.GeocodedWaypoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.geocoderStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.intermediateWaypointRequestIndex = reader.int32(); - break; - } - case 3: { - if (!(message.type && message.type.length)) - message.type = []; - message.type.push(reader.string()); - break; - } - case 4: { - message.partialMatch = reader.bool(); - break; - } - case 5: { - message.placeId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeocodedWaypoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeocodedWaypoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeocodedWaypoint message. - * @function verify - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeocodedWaypoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.geocoderStatus != null && message.hasOwnProperty("geocoderStatus")) { - var error = $root.google.rpc.Status.verify(message.geocoderStatus); - if (error) - return "geocoderStatus." + error; - } - if (message.intermediateWaypointRequestIndex != null && message.hasOwnProperty("intermediateWaypointRequestIndex")) { - properties._intermediateWaypointRequestIndex = 1; - if (!$util.isInteger(message.intermediateWaypointRequestIndex)) - return "intermediateWaypointRequestIndex: integer expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - if (!Array.isArray(message.type)) - return "type: array expected"; - for (var i = 0; i < message.type.length; ++i) - if (!$util.isString(message.type[i])) - return "type: string[] expected"; - } - if (message.partialMatch != null && message.hasOwnProperty("partialMatch")) - if (typeof message.partialMatch !== "boolean") - return "partialMatch: boolean expected"; - if (message.placeId != null && message.hasOwnProperty("placeId")) - if (!$util.isString(message.placeId)) - return "placeId: string expected"; - return null; - }; - - /** - * Creates a GeocodedWaypoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.GeocodedWaypoint} GeocodedWaypoint - */ - GeocodedWaypoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.GeocodedWaypoint) - return object; - var message = new $root.google.maps.routing.v2.GeocodedWaypoint(); - if (object.geocoderStatus != null) { - if (typeof object.geocoderStatus !== "object") - throw TypeError(".google.maps.routing.v2.GeocodedWaypoint.geocoderStatus: object expected"); - message.geocoderStatus = $root.google.rpc.Status.fromObject(object.geocoderStatus); - } - if (object.intermediateWaypointRequestIndex != null) - message.intermediateWaypointRequestIndex = object.intermediateWaypointRequestIndex | 0; - if (object.type) { - if (!Array.isArray(object.type)) - throw TypeError(".google.maps.routing.v2.GeocodedWaypoint.type: array expected"); - message.type = []; - for (var i = 0; i < object.type.length; ++i) - message.type[i] = String(object.type[i]); - } - if (object.partialMatch != null) - message.partialMatch = Boolean(object.partialMatch); - if (object.placeId != null) - message.placeId = String(object.placeId); - return message; - }; - - /** - * Creates a plain object from a GeocodedWaypoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {google.maps.routing.v2.GeocodedWaypoint} message GeocodedWaypoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeocodedWaypoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.type = []; - if (options.defaults) { - object.geocoderStatus = null; - object.partialMatch = false; - object.placeId = ""; - } - if (message.geocoderStatus != null && message.hasOwnProperty("geocoderStatus")) - object.geocoderStatus = $root.google.rpc.Status.toObject(message.geocoderStatus, options); - if (message.intermediateWaypointRequestIndex != null && message.hasOwnProperty("intermediateWaypointRequestIndex")) { - object.intermediateWaypointRequestIndex = message.intermediateWaypointRequestIndex; - if (options.oneofs) - object._intermediateWaypointRequestIndex = "intermediateWaypointRequestIndex"; - } - if (message.type && message.type.length) { - object.type = []; - for (var j = 0; j < message.type.length; ++j) - object.type[j] = message.type[j]; - } - if (message.partialMatch != null && message.hasOwnProperty("partialMatch")) - object.partialMatch = message.partialMatch; - if (message.placeId != null && message.hasOwnProperty("placeId")) - object.placeId = message.placeId; - return object; - }; - - /** - * Converts this GeocodedWaypoint to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @instance - * @returns {Object.} JSON object - */ - GeocodedWaypoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeocodedWaypoint - * @function getTypeUrl - * @memberof google.maps.routing.v2.GeocodedWaypoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeocodedWaypoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.GeocodedWaypoint"; - }; - - return GeocodedWaypoint; - })(); - - v2.LocalizedTime = (function() { - - /** - * Properties of a LocalizedTime. - * @memberof google.maps.routing.v2 - * @interface ILocalizedTime - * @property {google.type.ILocalizedText|null} [time] LocalizedTime time - * @property {string|null} [timeZone] LocalizedTime timeZone - */ - - /** - * Constructs a new LocalizedTime. - * @memberof google.maps.routing.v2 - * @classdesc Represents a LocalizedTime. - * @implements ILocalizedTime - * @constructor - * @param {google.maps.routing.v2.ILocalizedTime=} [properties] Properties to set - */ - function LocalizedTime(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocalizedTime time. - * @member {google.type.ILocalizedText|null|undefined} time - * @memberof google.maps.routing.v2.LocalizedTime - * @instance - */ - LocalizedTime.prototype.time = null; - - /** - * LocalizedTime timeZone. - * @member {string} timeZone - * @memberof google.maps.routing.v2.LocalizedTime - * @instance - */ - LocalizedTime.prototype.timeZone = ""; - - /** - * Creates a new LocalizedTime instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {google.maps.routing.v2.ILocalizedTime=} [properties] Properties to set - * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime instance - */ - LocalizedTime.create = function create(properties) { - return new LocalizedTime(properties); - }; - - /** - * Encodes the specified LocalizedTime message. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {google.maps.routing.v2.ILocalizedTime} message LocalizedTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.type.LocalizedText.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified LocalizedTime message, length delimited. Does not implicitly {@link google.maps.routing.v2.LocalizedTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {google.maps.routing.v2.ILocalizedTime} message LocalizedTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocalizedTime message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedTime.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.LocalizedTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.time = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 2: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocalizedTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocalizedTime message. - * @function verify - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocalizedTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.type.LocalizedText.verify(message.time); - if (error) - return "time." + error; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - return null; - }; - - /** - * Creates a LocalizedTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.LocalizedTime} LocalizedTime - */ - LocalizedTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.LocalizedTime) - return object; - var message = new $root.google.maps.routing.v2.LocalizedTime(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.maps.routing.v2.LocalizedTime.time: object expected"); - message.time = $root.google.type.LocalizedText.fromObject(object.time); - } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a LocalizedTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {google.maps.routing.v2.LocalizedTime} message LocalizedTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocalizedTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.time = null; - object.timeZone = ""; - } - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.type.LocalizedText.toObject(message.time, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - return object; - }; - - /** - * Converts this LocalizedTime to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.LocalizedTime - * @instance - * @returns {Object.} JSON object - */ - LocalizedTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocalizedTime - * @function getTypeUrl - * @memberof google.maps.routing.v2.LocalizedTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocalizedTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.LocalizedTime"; - }; - - return LocalizedTime; - })(); - - v2.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.maps.routing.v2 - * @interface ILocation - * @property {google.type.ILatLng|null} [latLng] Location latLng - * @property {google.protobuf.IInt32Value|null} [heading] Location heading - */ - - /** - * Constructs a new Location. - * @memberof google.maps.routing.v2 - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.maps.routing.v2.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.routing.v2.Location - * @instance - */ - Location.prototype.latLng = null; - - /** - * Location heading. - * @member {google.protobuf.IInt32Value|null|undefined} heading - * @memberof google.maps.routing.v2.Location - * @instance - */ - Location.prototype.heading = null; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.Location - * @static - * @param {google.maps.routing.v2.ILocation=} [properties] Properties to set - * @returns {google.maps.routing.v2.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.Location - * @static - * @param {google.maps.routing.v2.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")) - $root.google.protobuf.Int32Value.encode(message.heading, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.Location - * @static - * @param {google.maps.routing.v2.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.routing.v2.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - } - case 2: { - message.heading = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - 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.routing.v2.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.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.routing.v2.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.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")) { - var error = $root.google.protobuf.Int32Value.verify(message.heading); - if (error) - return "heading." + error; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.Location - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.Location) - return object; - var message = new $root.google.maps.routing.v2.Location(); - if (object.latLng != null) { - if (typeof object.latLng !== "object") - throw TypeError(".google.maps.routing.v2.Location.latLng: object expected"); - message.latLng = $root.google.type.LatLng.fromObject(object.latLng); - } - if (object.heading != null) { - if (typeof object.heading !== "object") - throw TypeError(".google.maps.routing.v2.Location.heading: object expected"); - message.heading = $root.google.protobuf.Int32Value.fromObject(object.heading); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.Location - * @static - * @param {google.maps.routing.v2.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; - object.heading = 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 = $root.google.protobuf.Int32Value.toObject(message.heading, options); - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.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.routing.v2.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.routing.v2.Location"; - }; - - return Location; - })(); - - /** - * Maneuver enum. - * @name google.maps.routing.v2.Maneuver - * @enum {number} - * @property {number} MANEUVER_UNSPECIFIED=0 MANEUVER_UNSPECIFIED value - * @property {number} TURN_SLIGHT_LEFT=1 TURN_SLIGHT_LEFT value - * @property {number} TURN_SHARP_LEFT=2 TURN_SHARP_LEFT value - * @property {number} UTURN_LEFT=3 UTURN_LEFT value - * @property {number} TURN_LEFT=4 TURN_LEFT value - * @property {number} TURN_SLIGHT_RIGHT=5 TURN_SLIGHT_RIGHT value - * @property {number} TURN_SHARP_RIGHT=6 TURN_SHARP_RIGHT value - * @property {number} UTURN_RIGHT=7 UTURN_RIGHT value - * @property {number} TURN_RIGHT=8 TURN_RIGHT value - * @property {number} STRAIGHT=9 STRAIGHT value - * @property {number} RAMP_LEFT=10 RAMP_LEFT value - * @property {number} RAMP_RIGHT=11 RAMP_RIGHT value - * @property {number} MERGE=12 MERGE value - * @property {number} FORK_LEFT=13 FORK_LEFT value - * @property {number} FORK_RIGHT=14 FORK_RIGHT value - * @property {number} FERRY=15 FERRY value - * @property {number} FERRY_TRAIN=16 FERRY_TRAIN value - * @property {number} ROUNDABOUT_LEFT=17 ROUNDABOUT_LEFT value - * @property {number} ROUNDABOUT_RIGHT=18 ROUNDABOUT_RIGHT value - * @property {number} DEPART=19 DEPART value - * @property {number} NAME_CHANGE=20 NAME_CHANGE value - */ - v2.Maneuver = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MANEUVER_UNSPECIFIED"] = 0; - values[valuesById[1] = "TURN_SLIGHT_LEFT"] = 1; - values[valuesById[2] = "TURN_SHARP_LEFT"] = 2; - values[valuesById[3] = "UTURN_LEFT"] = 3; - values[valuesById[4] = "TURN_LEFT"] = 4; - values[valuesById[5] = "TURN_SLIGHT_RIGHT"] = 5; - values[valuesById[6] = "TURN_SHARP_RIGHT"] = 6; - values[valuesById[7] = "UTURN_RIGHT"] = 7; - values[valuesById[8] = "TURN_RIGHT"] = 8; - values[valuesById[9] = "STRAIGHT"] = 9; - values[valuesById[10] = "RAMP_LEFT"] = 10; - values[valuesById[11] = "RAMP_RIGHT"] = 11; - values[valuesById[12] = "MERGE"] = 12; - values[valuesById[13] = "FORK_LEFT"] = 13; - values[valuesById[14] = "FORK_RIGHT"] = 14; - values[valuesById[15] = "FERRY"] = 15; - values[valuesById[16] = "FERRY_TRAIN"] = 16; - values[valuesById[17] = "ROUNDABOUT_LEFT"] = 17; - values[valuesById[18] = "ROUNDABOUT_RIGHT"] = 18; - values[valuesById[19] = "DEPART"] = 19; - values[valuesById[20] = "NAME_CHANGE"] = 20; - return values; - })(); - - v2.NavigationInstruction = (function() { - - /** - * Properties of a NavigationInstruction. - * @memberof google.maps.routing.v2 - * @interface INavigationInstruction - * @property {google.maps.routing.v2.Maneuver|null} [maneuver] NavigationInstruction maneuver - * @property {string|null} [instructions] NavigationInstruction instructions - */ - - /** - * Constructs a new NavigationInstruction. - * @memberof google.maps.routing.v2 - * @classdesc Represents a NavigationInstruction. - * @implements INavigationInstruction - * @constructor - * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set - */ - function NavigationInstruction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NavigationInstruction maneuver. - * @member {google.maps.routing.v2.Maneuver} maneuver - * @memberof google.maps.routing.v2.NavigationInstruction - * @instance - */ - NavigationInstruction.prototype.maneuver = 0; - - /** - * NavigationInstruction instructions. - * @member {string} instructions - * @memberof google.maps.routing.v2.NavigationInstruction - * @instance - */ - NavigationInstruction.prototype.instructions = ""; - - /** - * Creates a new NavigationInstruction instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set - * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction instance - */ - NavigationInstruction.create = function create(properties) { - return new NavigationInstruction(properties); - }; - - /** - * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NavigationInstruction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maneuver != null && Object.hasOwnProperty.call(message, "maneuver")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maneuver); - if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructions); - return writer; - }; - - /** - * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NavigationInstruction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NavigationInstruction message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NavigationInstruction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.NavigationInstruction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.maneuver = reader.int32(); - break; - } - case 2: { - message.instructions = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NavigationInstruction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NavigationInstruction message. - * @function verify - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NavigationInstruction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maneuver != null && message.hasOwnProperty("maneuver")) - switch (message.maneuver) { - default: - return "maneuver: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - break; - } - if (message.instructions != null && message.hasOwnProperty("instructions")) - if (!$util.isString(message.instructions)) - return "instructions: string expected"; - return null; - }; - - /** - * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction - */ - NavigationInstruction.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.NavigationInstruction) - return object; - var message = new $root.google.maps.routing.v2.NavigationInstruction(); - switch (object.maneuver) { - default: - if (typeof object.maneuver === "number") { - message.maneuver = object.maneuver; - break; - } - break; - case "MANEUVER_UNSPECIFIED": - case 0: - message.maneuver = 0; - break; - case "TURN_SLIGHT_LEFT": - case 1: - message.maneuver = 1; - break; - case "TURN_SHARP_LEFT": - case 2: - message.maneuver = 2; - break; - case "UTURN_LEFT": - case 3: - message.maneuver = 3; - break; - case "TURN_LEFT": - case 4: - message.maneuver = 4; - break; - case "TURN_SLIGHT_RIGHT": - case 5: - message.maneuver = 5; - break; - case "TURN_SHARP_RIGHT": - case 6: - message.maneuver = 6; - break; - case "UTURN_RIGHT": - case 7: - message.maneuver = 7; - break; - case "TURN_RIGHT": - case 8: - message.maneuver = 8; - break; - case "STRAIGHT": - case 9: - message.maneuver = 9; - break; - case "RAMP_LEFT": - case 10: - message.maneuver = 10; - break; - case "RAMP_RIGHT": - case 11: - message.maneuver = 11; - break; - case "MERGE": - case 12: - message.maneuver = 12; - break; - case "FORK_LEFT": - case 13: - message.maneuver = 13; - break; - case "FORK_RIGHT": - case 14: - message.maneuver = 14; - break; - case "FERRY": - case 15: - message.maneuver = 15; - break; - case "FERRY_TRAIN": - case 16: - message.maneuver = 16; - break; - case "ROUNDABOUT_LEFT": - case 17: - message.maneuver = 17; - break; - case "ROUNDABOUT_RIGHT": - case 18: - message.maneuver = 18; - break; - case "DEPART": - case 19: - message.maneuver = 19; - break; - case "NAME_CHANGE": - case 20: - message.maneuver = 20; - break; - } - if (object.instructions != null) - message.instructions = String(object.instructions); - return message; - }; - - /** - * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {google.maps.routing.v2.NavigationInstruction} message NavigationInstruction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NavigationInstruction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maneuver = options.enums === String ? "MANEUVER_UNSPECIFIED" : 0; - object.instructions = ""; - } - if (message.maneuver != null && message.hasOwnProperty("maneuver")) - object.maneuver = options.enums === String ? $root.google.maps.routing.v2.Maneuver[message.maneuver] === undefined ? message.maneuver : $root.google.maps.routing.v2.Maneuver[message.maneuver] : message.maneuver; - if (message.instructions != null && message.hasOwnProperty("instructions")) - object.instructions = message.instructions; - return object; - }; - - /** - * Converts this NavigationInstruction to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.NavigationInstruction - * @instance - * @returns {Object.} JSON object - */ - NavigationInstruction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NavigationInstruction - * @function getTypeUrl - * @memberof google.maps.routing.v2.NavigationInstruction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NavigationInstruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.NavigationInstruction"; - }; - - return NavigationInstruction; - })(); - - v2.Polyline = (function() { - - /** - * Properties of a Polyline. - * @memberof google.maps.routing.v2 - * @interface IPolyline - * @property {string|null} [encodedPolyline] Polyline encodedPolyline - * @property {google.protobuf.IStruct|null} [geoJsonLinestring] Polyline geoJsonLinestring - */ - - /** - * Constructs a new Polyline. - * @memberof google.maps.routing.v2 - * @classdesc Represents a Polyline. - * @implements IPolyline - * @constructor - * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set - */ - function Polyline(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Polyline encodedPolyline. - * @member {string|null|undefined} encodedPolyline - * @memberof google.maps.routing.v2.Polyline - * @instance - */ - Polyline.prototype.encodedPolyline = null; - - /** - * Polyline geoJsonLinestring. - * @member {google.protobuf.IStruct|null|undefined} geoJsonLinestring - * @memberof google.maps.routing.v2.Polyline - * @instance - */ - Polyline.prototype.geoJsonLinestring = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Polyline polylineType. - * @member {"encodedPolyline"|"geoJsonLinestring"|undefined} polylineType - * @memberof google.maps.routing.v2.Polyline - * @instance - */ - Object.defineProperty(Polyline.prototype, "polylineType", { - get: $util.oneOfGetter($oneOfFields = ["encodedPolyline", "geoJsonLinestring"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Polyline instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set - * @returns {google.maps.routing.v2.Polyline} Polyline instance - */ - Polyline.create = function create(properties) { - return new Polyline(properties); - }; - - /** - * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polyline.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encodedPolyline != null && Object.hasOwnProperty.call(message, "encodedPolyline")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.encodedPolyline); - if (message.geoJsonLinestring != null && Object.hasOwnProperty.call(message, "geoJsonLinestring")) - $root.google.protobuf.Struct.encode(message.geoJsonLinestring, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polyline.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Polyline message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.Polyline} Polyline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polyline.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Polyline(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encodedPolyline = reader.string(); - break; - } - case 2: { - message.geoJsonLinestring = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Polyline message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.Polyline} Polyline - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polyline.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Polyline message. - * @function verify - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Polyline.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { - properties.polylineType = 1; - if (!$util.isString(message.encodedPolyline)) - return "encodedPolyline: string expected"; - } - if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { - if (properties.polylineType === 1) - return "polylineType: multiple values"; - properties.polylineType = 1; - { - var error = $root.google.protobuf.Struct.verify(message.geoJsonLinestring); - if (error) - return "geoJsonLinestring." + error; - } - } - return null; - }; - - /** - * Creates a Polyline message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.Polyline} Polyline - */ - Polyline.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.Polyline) - return object; - var message = new $root.google.maps.routing.v2.Polyline(); - if (object.encodedPolyline != null) - message.encodedPolyline = String(object.encodedPolyline); - if (object.geoJsonLinestring != null) { - if (typeof object.geoJsonLinestring !== "object") - throw TypeError(".google.maps.routing.v2.Polyline.geoJsonLinestring: object expected"); - message.geoJsonLinestring = $root.google.protobuf.Struct.fromObject(object.geoJsonLinestring); - } - return message; - }; - - /** - * Creates a plain object from a Polyline message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {google.maps.routing.v2.Polyline} message Polyline - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Polyline.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { - object.encodedPolyline = message.encodedPolyline; - if (options.oneofs) - object.polylineType = "encodedPolyline"; - } - if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { - object.geoJsonLinestring = $root.google.protobuf.Struct.toObject(message.geoJsonLinestring, options); - if (options.oneofs) - object.polylineType = "geoJsonLinestring"; - } - return object; - }; - - /** - * Converts this Polyline to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.Polyline - * @instance - * @returns {Object.} JSON object - */ - Polyline.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Polyline - * @function getTypeUrl - * @memberof google.maps.routing.v2.Polyline - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Polyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.Polyline"; - }; - - return Polyline; - })(); - - /** - * PolylineQuality enum. - * @name google.maps.routing.v2.PolylineQuality - * @enum {number} - * @property {number} POLYLINE_QUALITY_UNSPECIFIED=0 POLYLINE_QUALITY_UNSPECIFIED value - * @property {number} HIGH_QUALITY=1 HIGH_QUALITY value - * @property {number} OVERVIEW=2 OVERVIEW value - */ - v2.PolylineQuality = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "POLYLINE_QUALITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGH_QUALITY"] = 1; - values[valuesById[2] = "OVERVIEW"] = 2; - return values; - })(); - - /** - * PolylineEncoding enum. - * @name google.maps.routing.v2.PolylineEncoding - * @enum {number} - * @property {number} POLYLINE_ENCODING_UNSPECIFIED=0 POLYLINE_ENCODING_UNSPECIFIED value - * @property {number} ENCODED_POLYLINE=1 ENCODED_POLYLINE value - * @property {number} GEO_JSON_LINESTRING=2 GEO_JSON_LINESTRING value - */ - v2.PolylineEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "POLYLINE_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENCODED_POLYLINE"] = 1; - values[valuesById[2] = "GEO_JSON_LINESTRING"] = 2; - return values; - })(); - - v2.PolylineDetails = (function() { - - /** - * Properties of a PolylineDetails. - * @memberof google.maps.routing.v2 - * @interface IPolylineDetails - * @property {Array.|null} [flyoverInfo] PolylineDetails flyoverInfo - * @property {Array.|null} [narrowRoadInfo] PolylineDetails narrowRoadInfo - */ - - /** - * Constructs a new PolylineDetails. - * @memberof google.maps.routing.v2 - * @classdesc Represents a PolylineDetails. - * @implements IPolylineDetails - * @constructor - * @param {google.maps.routing.v2.IPolylineDetails=} [properties] Properties to set - */ - function PolylineDetails(properties) { - this.flyoverInfo = []; - this.narrowRoadInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolylineDetails flyoverInfo. - * @member {Array.} flyoverInfo - * @memberof google.maps.routing.v2.PolylineDetails - * @instance - */ - PolylineDetails.prototype.flyoverInfo = $util.emptyArray; - - /** - * PolylineDetails narrowRoadInfo. - * @member {Array.} narrowRoadInfo - * @memberof google.maps.routing.v2.PolylineDetails - * @instance - */ - PolylineDetails.prototype.narrowRoadInfo = $util.emptyArray; - - /** - * Creates a new PolylineDetails instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {google.maps.routing.v2.IPolylineDetails=} [properties] Properties to set - * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails instance - */ - PolylineDetails.create = function create(properties) { - return new PolylineDetails(properties); - }; - - /** - * Encodes the specified PolylineDetails message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {google.maps.routing.v2.IPolylineDetails} message PolylineDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolylineDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.flyoverInfo != null && message.flyoverInfo.length) - for (var i = 0; i < message.flyoverInfo.length; ++i) - $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.encode(message.flyoverInfo[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.narrowRoadInfo != null && message.narrowRoadInfo.length) - for (var i = 0; i < message.narrowRoadInfo.length; ++i) - $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.encode(message.narrowRoadInfo[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolylineDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {google.maps.routing.v2.IPolylineDetails} message PolylineDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolylineDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolylineDetails message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolylineDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 12: { - if (!(message.flyoverInfo && message.flyoverInfo.length)) - message.flyoverInfo = []; - message.flyoverInfo.push($root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.decode(reader, reader.uint32())); - break; - } - case 13: { - if (!(message.narrowRoadInfo && message.narrowRoadInfo.length)) - message.narrowRoadInfo = []; - message.narrowRoadInfo.push($root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolylineDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolylineDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolylineDetails message. - * @function verify - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolylineDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.flyoverInfo != null && message.hasOwnProperty("flyoverInfo")) { - if (!Array.isArray(message.flyoverInfo)) - return "flyoverInfo: array expected"; - for (var i = 0; i < message.flyoverInfo.length; ++i) { - var error = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify(message.flyoverInfo[i]); - if (error) - return "flyoverInfo." + error; - } - } - if (message.narrowRoadInfo != null && message.hasOwnProperty("narrowRoadInfo")) { - if (!Array.isArray(message.narrowRoadInfo)) - return "narrowRoadInfo: array expected"; - for (var i = 0; i < message.narrowRoadInfo.length; ++i) { - var error = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify(message.narrowRoadInfo[i]); - if (error) - return "narrowRoadInfo." + error; - } - } - return null; - }; - - /** - * Creates a PolylineDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.PolylineDetails} PolylineDetails - */ - PolylineDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.PolylineDetails) - return object; - var message = new $root.google.maps.routing.v2.PolylineDetails(); - if (object.flyoverInfo) { - if (!Array.isArray(object.flyoverInfo)) - throw TypeError(".google.maps.routing.v2.PolylineDetails.flyoverInfo: array expected"); - message.flyoverInfo = []; - for (var i = 0; i < object.flyoverInfo.length; ++i) { - if (typeof object.flyoverInfo[i] !== "object") - throw TypeError(".google.maps.routing.v2.PolylineDetails.flyoverInfo: object expected"); - message.flyoverInfo[i] = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.fromObject(object.flyoverInfo[i]); - } - } - if (object.narrowRoadInfo) { - if (!Array.isArray(object.narrowRoadInfo)) - throw TypeError(".google.maps.routing.v2.PolylineDetails.narrowRoadInfo: array expected"); - message.narrowRoadInfo = []; - for (var i = 0; i < object.narrowRoadInfo.length; ++i) { - if (typeof object.narrowRoadInfo[i] !== "object") - throw TypeError(".google.maps.routing.v2.PolylineDetails.narrowRoadInfo: object expected"); - message.narrowRoadInfo[i] = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.fromObject(object.narrowRoadInfo[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolylineDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {google.maps.routing.v2.PolylineDetails} message PolylineDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolylineDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.flyoverInfo = []; - object.narrowRoadInfo = []; - } - if (message.flyoverInfo && message.flyoverInfo.length) { - object.flyoverInfo = []; - for (var j = 0; j < message.flyoverInfo.length; ++j) - object.flyoverInfo[j] = $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo.toObject(message.flyoverInfo[j], options); - } - if (message.narrowRoadInfo && message.narrowRoadInfo.length) { - object.narrowRoadInfo = []; - for (var j = 0; j < message.narrowRoadInfo.length; ++j) - object.narrowRoadInfo[j] = $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.toObject(message.narrowRoadInfo[j], options); - } - return object; - }; - - /** - * Converts this PolylineDetails to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.PolylineDetails - * @instance - * @returns {Object.} JSON object - */ - PolylineDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolylineDetails - * @function getTypeUrl - * @memberof google.maps.routing.v2.PolylineDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolylineDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails"; - }; - - PolylineDetails.PolylinePointIndex = (function() { - - /** - * Properties of a PolylinePointIndex. - * @memberof google.maps.routing.v2.PolylineDetails - * @interface IPolylinePointIndex - * @property {number|null} [startIndex] PolylinePointIndex startIndex - * @property {number|null} [endIndex] PolylinePointIndex endIndex - */ - - /** - * Constructs a new PolylinePointIndex. - * @memberof google.maps.routing.v2.PolylineDetails - * @classdesc Represents a PolylinePointIndex. - * @implements IPolylinePointIndex - * @constructor - * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex=} [properties] Properties to set - */ - function PolylinePointIndex(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolylinePointIndex startIndex. - * @member {number|null|undefined} startIndex - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @instance - */ - PolylinePointIndex.prototype.startIndex = null; - - /** - * PolylinePointIndex endIndex. - * @member {number|null|undefined} endIndex - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @instance - */ - PolylinePointIndex.prototype.endIndex = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(PolylinePointIndex.prototype, "_startIndex", { - get: $util.oneOfGetter($oneOfFields = ["startIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(PolylinePointIndex.prototype, "_endIndex", { - get: $util.oneOfGetter($oneOfFields = ["endIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PolylinePointIndex instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex=} [properties] Properties to set - * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex instance - */ - PolylinePointIndex.create = function create(properties) { - return new PolylinePointIndex(properties); - }; - - /** - * Encodes the specified PolylinePointIndex message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex} message PolylinePointIndex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolylinePointIndex.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); - if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); - return writer; - }; - - /** - * Encodes the specified PolylinePointIndex message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex} message PolylinePointIndex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolylinePointIndex.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolylinePointIndex message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolylinePointIndex.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startIndex = reader.int32(); - break; - } - case 2: { - message.endIndex = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolylinePointIndex message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolylinePointIndex.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolylinePointIndex message. - * @function verify - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolylinePointIndex.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.startIndex != null && message.hasOwnProperty("startIndex")) { - properties._startIndex = 1; - if (!$util.isInteger(message.startIndex)) - return "startIndex: integer expected"; - } - if (message.endIndex != null && message.hasOwnProperty("endIndex")) { - properties._endIndex = 1; - if (!$util.isInteger(message.endIndex)) - return "endIndex: integer expected"; - } - return null; - }; - - /** - * Creates a PolylinePointIndex message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} PolylinePointIndex - */ - PolylinePointIndex.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex) - return object; - var message = new $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex(); - if (object.startIndex != null) - message.startIndex = object.startIndex | 0; - if (object.endIndex != null) - message.endIndex = object.endIndex | 0; - return message; - }; - - /** - * Creates a plain object from a PolylinePointIndex message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {google.maps.routing.v2.PolylineDetails.PolylinePointIndex} message PolylinePointIndex - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolylinePointIndex.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.startIndex != null && message.hasOwnProperty("startIndex")) { - object.startIndex = message.startIndex; - if (options.oneofs) - object._startIndex = "startIndex"; - } - if (message.endIndex != null && message.hasOwnProperty("endIndex")) { - object.endIndex = message.endIndex; - if (options.oneofs) - object._endIndex = "endIndex"; - } - return object; - }; - - /** - * Converts this PolylinePointIndex to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @instance - * @returns {Object.} JSON object - */ - PolylinePointIndex.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolylinePointIndex - * @function getTypeUrl - * @memberof google.maps.routing.v2.PolylineDetails.PolylinePointIndex - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolylinePointIndex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.PolylinePointIndex"; - }; - - return PolylinePointIndex; - })(); - - /** - * RoadFeatureState enum. - * @name google.maps.routing.v2.PolylineDetails.RoadFeatureState - * @enum {number} - * @property {number} ROAD_FEATURE_STATE_UNSPECIFIED=0 ROAD_FEATURE_STATE_UNSPECIFIED value - * @property {number} EXISTS=1 EXISTS value - * @property {number} DOES_NOT_EXIST=2 DOES_NOT_EXIST value - */ - PolylineDetails.RoadFeatureState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROAD_FEATURE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXISTS"] = 1; - values[valuesById[2] = "DOES_NOT_EXIST"] = 2; - return values; - })(); - - PolylineDetails.FlyoverInfo = (function() { - - /** - * Properties of a FlyoverInfo. - * @memberof google.maps.routing.v2.PolylineDetails - * @interface IFlyoverInfo - * @property {google.maps.routing.v2.PolylineDetails.RoadFeatureState|null} [flyoverPresence] FlyoverInfo flyoverPresence - * @property {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null} [polylinePointIndex] FlyoverInfo polylinePointIndex - */ - - /** - * Constructs a new FlyoverInfo. - * @memberof google.maps.routing.v2.PolylineDetails - * @classdesc Represents a FlyoverInfo. - * @implements IFlyoverInfo - * @constructor - * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo=} [properties] Properties to set - */ - function FlyoverInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FlyoverInfo flyoverPresence. - * @member {google.maps.routing.v2.PolylineDetails.RoadFeatureState} flyoverPresence - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @instance - */ - FlyoverInfo.prototype.flyoverPresence = 0; - - /** - * FlyoverInfo polylinePointIndex. - * @member {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null|undefined} polylinePointIndex - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @instance - */ - FlyoverInfo.prototype.polylinePointIndex = null; - - /** - * Creates a new FlyoverInfo instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo=} [properties] Properties to set - * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo instance - */ - FlyoverInfo.create = function create(properties) { - return new FlyoverInfo(properties); - }; - - /** - * Encodes the specified FlyoverInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo} message FlyoverInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FlyoverInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.flyoverPresence != null && Object.hasOwnProperty.call(message, "flyoverPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.flyoverPresence); - if (message.polylinePointIndex != null && Object.hasOwnProperty.call(message, "polylinePointIndex")) - $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.encode(message.polylinePointIndex, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FlyoverInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.FlyoverInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.IFlyoverInfo} message FlyoverInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FlyoverInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FlyoverInfo message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FlyoverInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.flyoverPresence = reader.int32(); - break; - } - case 2: { - message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FlyoverInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FlyoverInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FlyoverInfo message. - * @function verify - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FlyoverInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.flyoverPresence != null && message.hasOwnProperty("flyoverPresence")) - switch (message.flyoverPresence) { - default: - return "flyoverPresence: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) { - var error = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify(message.polylinePointIndex); - if (error) - return "polylinePointIndex." + error; - } - return null; - }; - - /** - * Creates a FlyoverInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.PolylineDetails.FlyoverInfo} FlyoverInfo - */ - FlyoverInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo) - return object; - var message = new $root.google.maps.routing.v2.PolylineDetails.FlyoverInfo(); - switch (object.flyoverPresence) { - default: - if (typeof object.flyoverPresence === "number") { - message.flyoverPresence = object.flyoverPresence; - break; - } - break; - case "ROAD_FEATURE_STATE_UNSPECIFIED": - case 0: - message.flyoverPresence = 0; - break; - case "EXISTS": - case 1: - message.flyoverPresence = 1; - break; - case "DOES_NOT_EXIST": - case 2: - message.flyoverPresence = 2; - break; - } - if (object.polylinePointIndex != null) { - if (typeof object.polylinePointIndex !== "object") - throw TypeError(".google.maps.routing.v2.PolylineDetails.FlyoverInfo.polylinePointIndex: object expected"); - message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.fromObject(object.polylinePointIndex); - } - return message; - }; - - /** - * Creates a plain object from a FlyoverInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.FlyoverInfo} message FlyoverInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FlyoverInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.flyoverPresence = options.enums === String ? "ROAD_FEATURE_STATE_UNSPECIFIED" : 0; - object.polylinePointIndex = null; - } - if (message.flyoverPresence != null && message.hasOwnProperty("flyoverPresence")) - object.flyoverPresence = options.enums === String ? $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.flyoverPresence] === undefined ? message.flyoverPresence : $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.flyoverPresence] : message.flyoverPresence; - if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) - object.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.toObject(message.polylinePointIndex, options); - return object; - }; - - /** - * Converts this FlyoverInfo to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @instance - * @returns {Object.} JSON object - */ - FlyoverInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FlyoverInfo - * @function getTypeUrl - * @memberof google.maps.routing.v2.PolylineDetails.FlyoverInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FlyoverInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.FlyoverInfo"; - }; - - return FlyoverInfo; - })(); - - PolylineDetails.NarrowRoadInfo = (function() { - - /** - * Properties of a NarrowRoadInfo. - * @memberof google.maps.routing.v2.PolylineDetails - * @interface INarrowRoadInfo - * @property {google.maps.routing.v2.PolylineDetails.RoadFeatureState|null} [narrowRoadPresence] NarrowRoadInfo narrowRoadPresence - * @property {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null} [polylinePointIndex] NarrowRoadInfo polylinePointIndex - */ - - /** - * Constructs a new NarrowRoadInfo. - * @memberof google.maps.routing.v2.PolylineDetails - * @classdesc Represents a NarrowRoadInfo. - * @implements INarrowRoadInfo - * @constructor - * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo=} [properties] Properties to set - */ - function NarrowRoadInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NarrowRoadInfo narrowRoadPresence. - * @member {google.maps.routing.v2.PolylineDetails.RoadFeatureState} narrowRoadPresence - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @instance - */ - NarrowRoadInfo.prototype.narrowRoadPresence = 0; - - /** - * NarrowRoadInfo polylinePointIndex. - * @member {google.maps.routing.v2.PolylineDetails.IPolylinePointIndex|null|undefined} polylinePointIndex - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @instance - */ - NarrowRoadInfo.prototype.polylinePointIndex = null; - - /** - * Creates a new NarrowRoadInfo instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo=} [properties] Properties to set - * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo instance - */ - NarrowRoadInfo.create = function create(properties) { - return new NarrowRoadInfo(properties); - }; - - /** - * Encodes the specified NarrowRoadInfo message. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo} message NarrowRoadInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NarrowRoadInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.narrowRoadPresence != null && Object.hasOwnProperty.call(message, "narrowRoadPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.narrowRoadPresence); - if (message.polylinePointIndex != null && Object.hasOwnProperty.call(message, "polylinePointIndex")) - $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.encode(message.polylinePointIndex, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NarrowRoadInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.INarrowRoadInfo} message NarrowRoadInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NarrowRoadInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NarrowRoadInfo message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NarrowRoadInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.narrowRoadPresence = reader.int32(); - break; - } - case 2: { - message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NarrowRoadInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NarrowRoadInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NarrowRoadInfo message. - * @function verify - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NarrowRoadInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.narrowRoadPresence != null && message.hasOwnProperty("narrowRoadPresence")) - switch (message.narrowRoadPresence) { - default: - return "narrowRoadPresence: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) { - var error = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.verify(message.polylinePointIndex); - if (error) - return "polylinePointIndex." + error; - } - return null; - }; - - /** - * Creates a NarrowRoadInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} NarrowRoadInfo - */ - NarrowRoadInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo) - return object; - var message = new $root.google.maps.routing.v2.PolylineDetails.NarrowRoadInfo(); - switch (object.narrowRoadPresence) { - default: - if (typeof object.narrowRoadPresence === "number") { - message.narrowRoadPresence = object.narrowRoadPresence; - break; - } - break; - case "ROAD_FEATURE_STATE_UNSPECIFIED": - case 0: - message.narrowRoadPresence = 0; - break; - case "EXISTS": - case 1: - message.narrowRoadPresence = 1; - break; - case "DOES_NOT_EXIST": - case 2: - message.narrowRoadPresence = 2; - break; - } - if (object.polylinePointIndex != null) { - if (typeof object.polylinePointIndex !== "object") - throw TypeError(".google.maps.routing.v2.PolylineDetails.NarrowRoadInfo.polylinePointIndex: object expected"); - message.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.fromObject(object.polylinePointIndex); - } - return message; - }; - - /** - * Creates a plain object from a NarrowRoadInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {google.maps.routing.v2.PolylineDetails.NarrowRoadInfo} message NarrowRoadInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NarrowRoadInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.narrowRoadPresence = options.enums === String ? "ROAD_FEATURE_STATE_UNSPECIFIED" : 0; - object.polylinePointIndex = null; - } - if (message.narrowRoadPresence != null && message.hasOwnProperty("narrowRoadPresence")) - object.narrowRoadPresence = options.enums === String ? $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.narrowRoadPresence] === undefined ? message.narrowRoadPresence : $root.google.maps.routing.v2.PolylineDetails.RoadFeatureState[message.narrowRoadPresence] : message.narrowRoadPresence; - if (message.polylinePointIndex != null && message.hasOwnProperty("polylinePointIndex")) - object.polylinePointIndex = $root.google.maps.routing.v2.PolylineDetails.PolylinePointIndex.toObject(message.polylinePointIndex, options); - return object; - }; - - /** - * Converts this NarrowRoadInfo to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @instance - * @returns {Object.} JSON object - */ - NarrowRoadInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NarrowRoadInfo - * @function getTypeUrl - * @memberof google.maps.routing.v2.PolylineDetails.NarrowRoadInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NarrowRoadInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.PolylineDetails.NarrowRoadInfo"; - }; - - return NarrowRoadInfo; - })(); - - return PolylineDetails; - })(); - - v2.Route = (function() { - - /** - * Properties of a Route. - * @memberof google.maps.routing.v2 - * @interface IRoute - * @property {Array.|null} [routeLabels] Route routeLabels - * @property {Array.|null} [legs] Route legs - * @property {number|null} [distanceMeters] Route distanceMeters - * @property {google.protobuf.IDuration|null} [duration] Route duration - * @property {google.protobuf.IDuration|null} [staticDuration] Route staticDuration - * @property {google.maps.routing.v2.IPolyline|null} [polyline] Route polyline - * @property {string|null} [description] Route description - * @property {Array.|null} [warnings] Route warnings - * @property {google.geo.type.IViewport|null} [viewport] Route viewport - * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] Route travelAdvisory - * @property {Array.|null} [optimizedIntermediateWaypointIndex] Route optimizedIntermediateWaypointIndex - * @property {google.maps.routing.v2.Route.IRouteLocalizedValues|null} [localizedValues] Route localizedValues - * @property {string|null} [routeToken] Route routeToken - * @property {google.maps.routing.v2.IPolylineDetails|null} [polylineDetails] Route polylineDetails - */ - - /** - * Constructs a new Route. - * @memberof google.maps.routing.v2 - * @classdesc Represents a Route. - * @implements IRoute - * @constructor - * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set - */ - function Route(properties) { - this.routeLabels = []; - this.legs = []; - this.warnings = []; - this.optimizedIntermediateWaypointIndex = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Route routeLabels. - * @member {Array.} routeLabels - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.routeLabels = $util.emptyArray; - - /** - * Route legs. - * @member {Array.} legs - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.legs = $util.emptyArray; - - /** - * Route distanceMeters. - * @member {number} distanceMeters - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.distanceMeters = 0; - - /** - * Route duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.duration = null; - - /** - * Route staticDuration. - * @member {google.protobuf.IDuration|null|undefined} staticDuration - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.staticDuration = null; - - /** - * Route polyline. - * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.polyline = null; - - /** - * Route description. - * @member {string} description - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.description = ""; - - /** - * Route warnings. - * @member {Array.} warnings - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.warnings = $util.emptyArray; - - /** - * Route viewport. - * @member {google.geo.type.IViewport|null|undefined} viewport - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.viewport = null; - - /** - * Route travelAdvisory. - * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.travelAdvisory = null; - - /** - * Route optimizedIntermediateWaypointIndex. - * @member {Array.} optimizedIntermediateWaypointIndex - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.optimizedIntermediateWaypointIndex = $util.emptyArray; - - /** - * Route localizedValues. - * @member {google.maps.routing.v2.Route.IRouteLocalizedValues|null|undefined} localizedValues - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.localizedValues = null; - - /** - * Route routeToken. - * @member {string} routeToken - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.routeToken = ""; - - /** - * Route polylineDetails. - * @member {google.maps.routing.v2.IPolylineDetails|null|undefined} polylineDetails - * @memberof google.maps.routing.v2.Route - * @instance - */ - Route.prototype.polylineDetails = null; - - /** - * Creates a new Route instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.Route - * @static - * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set - * @returns {google.maps.routing.v2.Route} Route instance - */ - Route.create = function create(properties) { - return new Route(properties); - }; - - /** - * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.Route - * @static - * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Route.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.legs != null && message.legs.length) - for (var i = 0; i < message.legs.length; ++i) - $root.google.maps.routing.v2.RouteLeg.encode(message.legs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.distanceMeters); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) - $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.warnings[i]); - if (message.viewport != null && Object.hasOwnProperty.call(message, "viewport")) - $root.google.geo.type.Viewport.encode(message.viewport, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) - $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.optimizedIntermediateWaypointIndex != null && message.optimizedIntermediateWaypointIndex.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.optimizedIntermediateWaypointIndex.length; ++i) - writer.int32(message.optimizedIntermediateWaypointIndex[i]); - writer.ldelim(); - } - if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) - $root.google.maps.routing.v2.Route.RouteLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.routeToken != null && Object.hasOwnProperty.call(message, "routeToken")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.routeToken); - if (message.routeLabels != null && message.routeLabels.length) { - writer.uint32(/* id 13, wireType 2 =*/106).fork(); - for (var i = 0; i < message.routeLabels.length; ++i) - writer.int32(message.routeLabels[i]); - writer.ldelim(); - } - if (message.polylineDetails != null && Object.hasOwnProperty.call(message, "polylineDetails")) - $root.google.maps.routing.v2.PolylineDetails.encode(message.polylineDetails, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.Route - * @static - * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Route.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Route message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.Route - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.Route} Route - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Route.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Route(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 13: { - if (!(message.routeLabels && message.routeLabels.length)) - message.routeLabels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.routeLabels.push(reader.int32()); - } else - message.routeLabels.push(reader.int32()); - break; - } - case 1: { - if (!(message.legs && message.legs.length)) - message.legs = []; - message.legs.push($root.google.maps.routing.v2.RouteLeg.decode(reader, reader.uint32())); - break; - } - case 2: { - message.distanceMeters = reader.int32(); - break; - } - case 3: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); - break; - } - case 6: { - message.description = reader.string(); - break; - } - case 7: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - case 8: { - message.viewport = $root.google.geo.type.Viewport.decode(reader, reader.uint32()); - break; - } - case 9: { - message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.optimizedIntermediateWaypointIndex && message.optimizedIntermediateWaypointIndex.length)) - message.optimizedIntermediateWaypointIndex = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.optimizedIntermediateWaypointIndex.push(reader.int32()); - } else - message.optimizedIntermediateWaypointIndex.push(reader.int32()); - break; - } - case 11: { - message.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.decode(reader, reader.uint32()); - break; - } - case 12: { - message.routeToken = reader.string(); - break; - } - case 14: { - message.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Route message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.Route - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.Route} Route - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Route.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Route message. - * @function verify - * @memberof google.maps.routing.v2.Route - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Route.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.routeLabels != null && message.hasOwnProperty("routeLabels")) { - if (!Array.isArray(message.routeLabels)) - return "routeLabels: array expected"; - for (var i = 0; i < message.routeLabels.length; ++i) - switch (message.routeLabels[i]) { - default: - return "routeLabels: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - } - if (message.legs != null && message.hasOwnProperty("legs")) { - if (!Array.isArray(message.legs)) - return "legs: array expected"; - for (var i = 0; i < message.legs.length; ++i) { - var error = $root.google.maps.routing.v2.RouteLeg.verify(message.legs[i]); - if (error) - return "legs." + error; - } - } - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - if (!$util.isInteger(message.distanceMeters)) - return "distanceMeters: integer expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.protobuf.Duration.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.polyline != null && message.hasOwnProperty("polyline")) { - var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); - if (error) - return "polyline." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - if (message.viewport != null && message.hasOwnProperty("viewport")) { - var error = $root.google.geo.type.Viewport.verify(message.viewport); - if (error) - return "viewport." + error; - } - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { - var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); - if (error) - return "travelAdvisory." + error; - } - if (message.optimizedIntermediateWaypointIndex != null && message.hasOwnProperty("optimizedIntermediateWaypointIndex")) { - if (!Array.isArray(message.optimizedIntermediateWaypointIndex)) - return "optimizedIntermediateWaypointIndex: array expected"; - for (var i = 0; i < message.optimizedIntermediateWaypointIndex.length; ++i) - if (!$util.isInteger(message.optimizedIntermediateWaypointIndex[i])) - return "optimizedIntermediateWaypointIndex: integer[] expected"; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { - var error = $root.google.maps.routing.v2.Route.RouteLocalizedValues.verify(message.localizedValues); - if (error) - return "localizedValues." + error; - } - if (message.routeToken != null && message.hasOwnProperty("routeToken")) - if (!$util.isString(message.routeToken)) - return "routeToken: string expected"; - if (message.polylineDetails != null && message.hasOwnProperty("polylineDetails")) { - var error = $root.google.maps.routing.v2.PolylineDetails.verify(message.polylineDetails); - if (error) - return "polylineDetails." + error; - } - return null; - }; - - /** - * Creates a Route message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.Route - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.Route} Route - */ - Route.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.Route) - return object; - var message = new $root.google.maps.routing.v2.Route(); - if (object.routeLabels) { - if (!Array.isArray(object.routeLabels)) - throw TypeError(".google.maps.routing.v2.Route.routeLabels: array expected"); - message.routeLabels = []; - for (var i = 0; i < object.routeLabels.length; ++i) - switch (object.routeLabels[i]) { - default: - if (typeof object.routeLabels[i] === "number") { - message.routeLabels[i] = object.routeLabels[i]; - break; - } - case "ROUTE_LABEL_UNSPECIFIED": - case 0: - message.routeLabels[i] = 0; - break; - case "DEFAULT_ROUTE": - case 1: - message.routeLabels[i] = 1; - break; - case "DEFAULT_ROUTE_ALTERNATE": - case 2: - message.routeLabels[i] = 2; - break; - case "FUEL_EFFICIENT": - case 3: - message.routeLabels[i] = 3; - break; - case "SHORTER_DISTANCE": - case 4: - message.routeLabels[i] = 4; - break; - } - } - if (object.legs) { - if (!Array.isArray(object.legs)) - throw TypeError(".google.maps.routing.v2.Route.legs: array expected"); - message.legs = []; - for (var i = 0; i < object.legs.length; ++i) { - if (typeof object.legs[i] !== "object") - throw TypeError(".google.maps.routing.v2.Route.legs: object expected"); - message.legs[i] = $root.google.maps.routing.v2.RouteLeg.fromObject(object.legs[i]); - } - } - if (object.distanceMeters != null) - message.distanceMeters = object.distanceMeters | 0; - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.Route.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.Route.staticDuration: object expected"); - message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); - } - if (object.polyline != null) { - if (typeof object.polyline !== "object") - throw TypeError(".google.maps.routing.v2.Route.polyline: object expected"); - message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); - } - if (object.description != null) - message.description = String(object.description); - if (object.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.maps.routing.v2.Route.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - if (object.viewport != null) { - if (typeof object.viewport !== "object") - throw TypeError(".google.maps.routing.v2.Route.viewport: object expected"); - message.viewport = $root.google.geo.type.Viewport.fromObject(object.viewport); - } - if (object.travelAdvisory != null) { - if (typeof object.travelAdvisory !== "object") - throw TypeError(".google.maps.routing.v2.Route.travelAdvisory: object expected"); - message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); - } - if (object.optimizedIntermediateWaypointIndex) { - if (!Array.isArray(object.optimizedIntermediateWaypointIndex)) - throw TypeError(".google.maps.routing.v2.Route.optimizedIntermediateWaypointIndex: array expected"); - message.optimizedIntermediateWaypointIndex = []; - for (var i = 0; i < object.optimizedIntermediateWaypointIndex.length; ++i) - message.optimizedIntermediateWaypointIndex[i] = object.optimizedIntermediateWaypointIndex[i] | 0; - } - if (object.localizedValues != null) { - if (typeof object.localizedValues !== "object") - throw TypeError(".google.maps.routing.v2.Route.localizedValues: object expected"); - message.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.fromObject(object.localizedValues); - } - if (object.routeToken != null) - message.routeToken = String(object.routeToken); - if (object.polylineDetails != null) { - if (typeof object.polylineDetails !== "object") - throw TypeError(".google.maps.routing.v2.Route.polylineDetails: object expected"); - message.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.fromObject(object.polylineDetails); - } - return message; - }; - - /** - * Creates a plain object from a Route message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.Route - * @static - * @param {google.maps.routing.v2.Route} message Route - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Route.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.legs = []; - object.warnings = []; - object.optimizedIntermediateWaypointIndex = []; - object.routeLabels = []; - } - if (options.defaults) { - object.distanceMeters = 0; - object.duration = null; - object.staticDuration = null; - object.polyline = null; - object.description = ""; - object.viewport = null; - object.travelAdvisory = null; - object.localizedValues = null; - object.routeToken = ""; - object.polylineDetails = null; - } - if (message.legs && message.legs.length) { - object.legs = []; - for (var j = 0; j < message.legs.length; ++j) - object.legs[j] = $root.google.maps.routing.v2.RouteLeg.toObject(message.legs[j], options); - } - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - object.distanceMeters = message.distanceMeters; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); - if (message.polyline != null && message.hasOwnProperty("polyline")) - object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - if (message.viewport != null && message.hasOwnProperty("viewport")) - object.viewport = $root.google.geo.type.Viewport.toObject(message.viewport, options); - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) - object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); - if (message.optimizedIntermediateWaypointIndex && message.optimizedIntermediateWaypointIndex.length) { - object.optimizedIntermediateWaypointIndex = []; - for (var j = 0; j < message.optimizedIntermediateWaypointIndex.length; ++j) - object.optimizedIntermediateWaypointIndex[j] = message.optimizedIntermediateWaypointIndex[j]; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) - object.localizedValues = $root.google.maps.routing.v2.Route.RouteLocalizedValues.toObject(message.localizedValues, options); - if (message.routeToken != null && message.hasOwnProperty("routeToken")) - object.routeToken = message.routeToken; - if (message.routeLabels && message.routeLabels.length) { - object.routeLabels = []; - for (var j = 0; j < message.routeLabels.length; ++j) - object.routeLabels[j] = options.enums === String ? $root.google.maps.routing.v2.RouteLabel[message.routeLabels[j]] === undefined ? message.routeLabels[j] : $root.google.maps.routing.v2.RouteLabel[message.routeLabels[j]] : message.routeLabels[j]; - } - if (message.polylineDetails != null && message.hasOwnProperty("polylineDetails")) - object.polylineDetails = $root.google.maps.routing.v2.PolylineDetails.toObject(message.polylineDetails, options); - return object; - }; - - /** - * Converts this Route to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.Route - * @instance - * @returns {Object.} JSON object - */ - Route.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Route - * @function getTypeUrl - * @memberof google.maps.routing.v2.Route - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Route.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.Route"; - }; - - Route.RouteLocalizedValues = (function() { - - /** - * Properties of a RouteLocalizedValues. - * @memberof google.maps.routing.v2.Route - * @interface IRouteLocalizedValues - * @property {google.type.ILocalizedText|null} [distance] RouteLocalizedValues distance - * @property {google.type.ILocalizedText|null} [duration] RouteLocalizedValues duration - * @property {google.type.ILocalizedText|null} [staticDuration] RouteLocalizedValues staticDuration - * @property {google.type.ILocalizedText|null} [transitFare] RouteLocalizedValues transitFare - */ - - /** - * Constructs a new RouteLocalizedValues. - * @memberof google.maps.routing.v2.Route - * @classdesc Represents a RouteLocalizedValues. - * @implements IRouteLocalizedValues - * @constructor - * @param {google.maps.routing.v2.Route.IRouteLocalizedValues=} [properties] Properties to set - */ - function RouteLocalizedValues(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLocalizedValues distance. - * @member {google.type.ILocalizedText|null|undefined} distance - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @instance - */ - RouteLocalizedValues.prototype.distance = null; - - /** - * RouteLocalizedValues duration. - * @member {google.type.ILocalizedText|null|undefined} duration - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @instance - */ - RouteLocalizedValues.prototype.duration = null; - - /** - * RouteLocalizedValues staticDuration. - * @member {google.type.ILocalizedText|null|undefined} staticDuration - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @instance - */ - RouteLocalizedValues.prototype.staticDuration = null; - - /** - * RouteLocalizedValues transitFare. - * @member {google.type.ILocalizedText|null|undefined} transitFare - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @instance - */ - RouteLocalizedValues.prototype.transitFare = null; - - /** - * Creates a new RouteLocalizedValues instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {google.maps.routing.v2.Route.IRouteLocalizedValues=} [properties] Properties to set - * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues instance - */ - RouteLocalizedValues.create = function create(properties) { - return new RouteLocalizedValues(properties); - }; - - /** - * Encodes the specified RouteLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {google.maps.routing.v2.Route.IRouteLocalizedValues} message RouteLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLocalizedValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) - $root.google.type.LocalizedText.encode(message.transitFare, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.RouteLocalizedValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {google.maps.routing.v2.Route.IRouteLocalizedValues} message RouteLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLocalizedValues message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLocalizedValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Route.RouteLocalizedValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 2: { - message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 3: { - message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 4: { - message.transitFare = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLocalizedValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLocalizedValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLocalizedValues message. - * @function verify - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLocalizedValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distance != null && message.hasOwnProperty("distance")) { - var error = $root.google.type.LocalizedText.verify(message.distance); - if (error) - return "distance." + error; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.type.LocalizedText.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.type.LocalizedText.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.transitFare != null && message.hasOwnProperty("transitFare")) { - var error = $root.google.type.LocalizedText.verify(message.transitFare); - if (error) - return "transitFare." + error; - } - return null; - }; - - /** - * Creates a RouteLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.Route.RouteLocalizedValues} RouteLocalizedValues - */ - RouteLocalizedValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.Route.RouteLocalizedValues) - return object; - var message = new $root.google.maps.routing.v2.Route.RouteLocalizedValues(); - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.distance: object expected"); - message.distance = $root.google.type.LocalizedText.fromObject(object.distance); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.duration: object expected"); - message.duration = $root.google.type.LocalizedText.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.staticDuration: object expected"); - message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); - } - if (object.transitFare != null) { - if (typeof object.transitFare !== "object") - throw TypeError(".google.maps.routing.v2.Route.RouteLocalizedValues.transitFare: object expected"); - message.transitFare = $root.google.type.LocalizedText.fromObject(object.transitFare); - } - return message; - }; - - /** - * Creates a plain object from a RouteLocalizedValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {google.maps.routing.v2.Route.RouteLocalizedValues} message RouteLocalizedValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLocalizedValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.distance = null; - object.duration = null; - object.staticDuration = null; - object.transitFare = null; - } - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); - if (message.transitFare != null && message.hasOwnProperty("transitFare")) - object.transitFare = $root.google.type.LocalizedText.toObject(message.transitFare, options); - return object; - }; - - /** - * Converts this RouteLocalizedValues to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @instance - * @returns {Object.} JSON object - */ - RouteLocalizedValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLocalizedValues - * @function getTypeUrl - * @memberof google.maps.routing.v2.Route.RouteLocalizedValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.Route.RouteLocalizedValues"; - }; - - return RouteLocalizedValues; - })(); - - return Route; - })(); - - v2.RouteTravelAdvisory = (function() { - - /** - * Properties of a RouteTravelAdvisory. - * @memberof google.maps.routing.v2 - * @interface IRouteTravelAdvisory - * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteTravelAdvisory tollInfo - * @property {Array.|null} [speedReadingIntervals] RouteTravelAdvisory speedReadingIntervals - * @property {number|Long|null} [fuelConsumptionMicroliters] RouteTravelAdvisory fuelConsumptionMicroliters - * @property {boolean|null} [routeRestrictionsPartiallyIgnored] RouteTravelAdvisory routeRestrictionsPartiallyIgnored - * @property {google.type.IMoney|null} [transitFare] RouteTravelAdvisory transitFare - */ - - /** - * Constructs a new RouteTravelAdvisory. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteTravelAdvisory. - * @implements IRouteTravelAdvisory - * @constructor - * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set - */ - function RouteTravelAdvisory(properties) { - this.speedReadingIntervals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteTravelAdvisory tollInfo. - * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - */ - RouteTravelAdvisory.prototype.tollInfo = null; - - /** - * RouteTravelAdvisory speedReadingIntervals. - * @member {Array.} speedReadingIntervals - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - */ - RouteTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; - - /** - * RouteTravelAdvisory fuelConsumptionMicroliters. - * @member {number|Long} fuelConsumptionMicroliters - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - */ - RouteTravelAdvisory.prototype.fuelConsumptionMicroliters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RouteTravelAdvisory routeRestrictionsPartiallyIgnored. - * @member {boolean} routeRestrictionsPartiallyIgnored - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - */ - RouteTravelAdvisory.prototype.routeRestrictionsPartiallyIgnored = false; - - /** - * RouteTravelAdvisory transitFare. - * @member {google.type.IMoney|null|undefined} transitFare - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - */ - RouteTravelAdvisory.prototype.transitFare = null; - - /** - * Creates a new RouteTravelAdvisory instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory instance - */ - RouteTravelAdvisory.create = function create(properties) { - return new RouteTravelAdvisory(properties); - }; - - /** - * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteTravelAdvisory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) - $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) - for (var i = 0; i < message.speedReadingIntervals.length; ++i) - $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.fuelConsumptionMicroliters != null && Object.hasOwnProperty.call(message, "fuelConsumptionMicroliters")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.fuelConsumptionMicroliters); - if (message.routeRestrictionsPartiallyIgnored != null && Object.hasOwnProperty.call(message, "routeRestrictionsPartiallyIgnored")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.routeRestrictionsPartiallyIgnored); - if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) - $root.google.type.Money.encode(message.transitFare, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteTravelAdvisory message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteTravelAdvisory.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) - message.speedReadingIntervals = []; - message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); - break; - } - case 5: { - message.fuelConsumptionMicroliters = reader.int64(); - break; - } - case 6: { - message.routeRestrictionsPartiallyIgnored = reader.bool(); - break; - } - case 7: { - message.transitFare = $root.google.type.Money.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteTravelAdvisory message. - * @function verify - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteTravelAdvisory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { - var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); - if (error) - return "tollInfo." + error; - } - if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { - if (!Array.isArray(message.speedReadingIntervals)) - return "speedReadingIntervals: array expected"; - for (var i = 0; i < message.speedReadingIntervals.length; ++i) { - var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); - if (error) - return "speedReadingIntervals." + error; - } - } - if (message.fuelConsumptionMicroliters != null && message.hasOwnProperty("fuelConsumptionMicroliters")) - if (!$util.isInteger(message.fuelConsumptionMicroliters) && !(message.fuelConsumptionMicroliters && $util.isInteger(message.fuelConsumptionMicroliters.low) && $util.isInteger(message.fuelConsumptionMicroliters.high))) - return "fuelConsumptionMicroliters: integer|Long expected"; - if (message.routeRestrictionsPartiallyIgnored != null && message.hasOwnProperty("routeRestrictionsPartiallyIgnored")) - if (typeof message.routeRestrictionsPartiallyIgnored !== "boolean") - return "routeRestrictionsPartiallyIgnored: boolean expected"; - if (message.transitFare != null && message.hasOwnProperty("transitFare")) { - var error = $root.google.type.Money.verify(message.transitFare); - if (error) - return "transitFare." + error; - } - return null; - }; - - /** - * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory - */ - RouteTravelAdvisory.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteTravelAdvisory) - return object; - var message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); - if (object.tollInfo != null) { - if (typeof object.tollInfo !== "object") - throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.tollInfo: object expected"); - message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); - } - if (object.speedReadingIntervals) { - if (!Array.isArray(object.speedReadingIntervals)) - throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: array expected"); - message.speedReadingIntervals = []; - for (var i = 0; i < object.speedReadingIntervals.length; ++i) { - if (typeof object.speedReadingIntervals[i] !== "object") - throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: object expected"); - message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); - } - } - if (object.fuelConsumptionMicroliters != null) - if ($util.Long) - (message.fuelConsumptionMicroliters = $util.Long.fromValue(object.fuelConsumptionMicroliters)).unsigned = false; - else if (typeof object.fuelConsumptionMicroliters === "string") - message.fuelConsumptionMicroliters = parseInt(object.fuelConsumptionMicroliters, 10); - else if (typeof object.fuelConsumptionMicroliters === "number") - message.fuelConsumptionMicroliters = object.fuelConsumptionMicroliters; - else if (typeof object.fuelConsumptionMicroliters === "object") - message.fuelConsumptionMicroliters = new $util.LongBits(object.fuelConsumptionMicroliters.low >>> 0, object.fuelConsumptionMicroliters.high >>> 0).toNumber(); - if (object.routeRestrictionsPartiallyIgnored != null) - message.routeRestrictionsPartiallyIgnored = Boolean(object.routeRestrictionsPartiallyIgnored); - if (object.transitFare != null) { - if (typeof object.transitFare !== "object") - throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.transitFare: object expected"); - message.transitFare = $root.google.type.Money.fromObject(object.transitFare); - } - return message; - }; - - /** - * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {google.maps.routing.v2.RouteTravelAdvisory} message RouteTravelAdvisory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteTravelAdvisory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.speedReadingIntervals = []; - if (options.defaults) { - object.tollInfo = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.fuelConsumptionMicroliters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fuelConsumptionMicroliters = options.longs === String ? "0" : 0; - object.routeRestrictionsPartiallyIgnored = false; - object.transitFare = null; - } - if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) - object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); - if (message.speedReadingIntervals && message.speedReadingIntervals.length) { - object.speedReadingIntervals = []; - for (var j = 0; j < message.speedReadingIntervals.length; ++j) - object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); - } - if (message.fuelConsumptionMicroliters != null && message.hasOwnProperty("fuelConsumptionMicroliters")) - if (typeof message.fuelConsumptionMicroliters === "number") - object.fuelConsumptionMicroliters = options.longs === String ? String(message.fuelConsumptionMicroliters) : message.fuelConsumptionMicroliters; - else - object.fuelConsumptionMicroliters = options.longs === String ? $util.Long.prototype.toString.call(message.fuelConsumptionMicroliters) : options.longs === Number ? new $util.LongBits(message.fuelConsumptionMicroliters.low >>> 0, message.fuelConsumptionMicroliters.high >>> 0).toNumber() : message.fuelConsumptionMicroliters; - if (message.routeRestrictionsPartiallyIgnored != null && message.hasOwnProperty("routeRestrictionsPartiallyIgnored")) - object.routeRestrictionsPartiallyIgnored = message.routeRestrictionsPartiallyIgnored; - if (message.transitFare != null && message.hasOwnProperty("transitFare")) - object.transitFare = $root.google.type.Money.toObject(message.transitFare, options); - return object; - }; - - /** - * Converts this RouteTravelAdvisory to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @instance - * @returns {Object.} JSON object - */ - RouteTravelAdvisory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteTravelAdvisory - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteTravelAdvisory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteTravelAdvisory"; - }; - - return RouteTravelAdvisory; - })(); - - v2.RouteLegTravelAdvisory = (function() { - - /** - * Properties of a RouteLegTravelAdvisory. - * @memberof google.maps.routing.v2 - * @interface IRouteLegTravelAdvisory - * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteLegTravelAdvisory tollInfo - * @property {Array.|null} [speedReadingIntervals] RouteLegTravelAdvisory speedReadingIntervals - */ - - /** - * Constructs a new RouteLegTravelAdvisory. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteLegTravelAdvisory. - * @implements IRouteLegTravelAdvisory - * @constructor - * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set - */ - function RouteLegTravelAdvisory(properties) { - this.speedReadingIntervals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegTravelAdvisory tollInfo. - * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @instance - */ - RouteLegTravelAdvisory.prototype.tollInfo = null; - - /** - * RouteLegTravelAdvisory speedReadingIntervals. - * @member {Array.} speedReadingIntervals - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @instance - */ - RouteLegTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; - - /** - * Creates a new RouteLegTravelAdvisory instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory instance - */ - RouteLegTravelAdvisory.create = function create(properties) { - return new RouteLegTravelAdvisory(properties); - }; - - /** - * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegTravelAdvisory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) - $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) - for (var i = 0; i < message.speedReadingIntervals.length; ++i) - $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegTravelAdvisory.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) - message.speedReadingIntervals = []; - message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegTravelAdvisory message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegTravelAdvisory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { - var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); - if (error) - return "tollInfo." + error; - } - if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { - if (!Array.isArray(message.speedReadingIntervals)) - return "speedReadingIntervals: array expected"; - for (var i = 0; i < message.speedReadingIntervals.length; ++i) { - var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); - if (error) - return "speedReadingIntervals." + error; - } - } - return null; - }; - - /** - * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory - */ - RouteLegTravelAdvisory.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegTravelAdvisory) - return object; - var message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); - if (object.tollInfo != null) { - if (typeof object.tollInfo !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.tollInfo: object expected"); - message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); - } - if (object.speedReadingIntervals) { - if (!Array.isArray(object.speedReadingIntervals)) - throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: array expected"); - message.speedReadingIntervals = []; - for (var i = 0; i < object.speedReadingIntervals.length; ++i) { - if (typeof object.speedReadingIntervals[i] !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: object expected"); - message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {google.maps.routing.v2.RouteLegTravelAdvisory} message RouteLegTravelAdvisory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegTravelAdvisory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.speedReadingIntervals = []; - if (options.defaults) - object.tollInfo = null; - if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) - object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); - if (message.speedReadingIntervals && message.speedReadingIntervals.length) { - object.speedReadingIntervals = []; - for (var j = 0; j < message.speedReadingIntervals.length; ++j) - object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); - } - return object; - }; - - /** - * Converts this RouteLegTravelAdvisory to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @instance - * @returns {Object.} JSON object - */ - RouteLegTravelAdvisory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegTravelAdvisory - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegTravelAdvisory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegTravelAdvisory"; - }; - - return RouteLegTravelAdvisory; - })(); - - v2.RouteLegStepTravelAdvisory = (function() { - - /** - * Properties of a RouteLegStepTravelAdvisory. - * @memberof google.maps.routing.v2 - * @interface IRouteLegStepTravelAdvisory - * @property {Array.|null} [speedReadingIntervals] RouteLegStepTravelAdvisory speedReadingIntervals - */ - - /** - * Constructs a new RouteLegStepTravelAdvisory. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteLegStepTravelAdvisory. - * @implements IRouteLegStepTravelAdvisory - * @constructor - * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set - */ - function RouteLegStepTravelAdvisory(properties) { - this.speedReadingIntervals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegStepTravelAdvisory speedReadingIntervals. - * @member {Array.} speedReadingIntervals - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @instance - */ - RouteLegStepTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; - - /** - * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory instance - */ - RouteLegStepTravelAdvisory.create = function create(properties) { - return new RouteLegStepTravelAdvisory(properties); - }; - - /** - * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepTravelAdvisory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) - for (var i = 0; i < message.speedReadingIntervals.length; ++i) - $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepTravelAdvisory.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) - message.speedReadingIntervals = []; - message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegStepTravelAdvisory message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegStepTravelAdvisory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { - if (!Array.isArray(message.speedReadingIntervals)) - return "speedReadingIntervals: array expected"; - for (var i = 0; i < message.speedReadingIntervals.length; ++i) { - var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); - if (error) - return "speedReadingIntervals." + error; - } - } - return null; - }; - - /** - * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory - */ - RouteLegStepTravelAdvisory.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStepTravelAdvisory) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); - if (object.speedReadingIntervals) { - if (!Array.isArray(object.speedReadingIntervals)) - throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: array expected"); - message.speedReadingIntervals = []; - for (var i = 0; i < object.speedReadingIntervals.length; ++i) { - if (typeof object.speedReadingIntervals[i] !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: object expected"); - message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {google.maps.routing.v2.RouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegStepTravelAdvisory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.speedReadingIntervals = []; - if (message.speedReadingIntervals && message.speedReadingIntervals.length) { - object.speedReadingIntervals = []; - for (var j = 0; j < message.speedReadingIntervals.length; ++j) - object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); - } - return object; - }; - - /** - * Converts this RouteLegStepTravelAdvisory to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @instance - * @returns {Object.} JSON object - */ - RouteLegStepTravelAdvisory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegStepTravelAdvisory - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegStepTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTravelAdvisory"; - }; - - return RouteLegStepTravelAdvisory; - })(); - - v2.RouteLeg = (function() { - - /** - * Properties of a RouteLeg. - * @memberof google.maps.routing.v2 - * @interface IRouteLeg - * @property {number|null} [distanceMeters] RouteLeg distanceMeters - * @property {google.protobuf.IDuration|null} [duration] RouteLeg duration - * @property {google.protobuf.IDuration|null} [staticDuration] RouteLeg staticDuration - * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLeg polyline - * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLeg startLocation - * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLeg endLocation - * @property {Array.|null} [steps] RouteLeg steps - * @property {google.maps.routing.v2.IRouteLegTravelAdvisory|null} [travelAdvisory] RouteLeg travelAdvisory - * @property {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null} [localizedValues] RouteLeg localizedValues - * @property {google.maps.routing.v2.RouteLeg.IStepsOverview|null} [stepsOverview] RouteLeg stepsOverview - */ - - /** - * Constructs a new RouteLeg. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteLeg. - * @implements IRouteLeg - * @constructor - * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set - */ - function RouteLeg(properties) { - this.steps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLeg distanceMeters. - * @member {number} distanceMeters - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.distanceMeters = 0; - - /** - * RouteLeg duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.duration = null; - - /** - * RouteLeg staticDuration. - * @member {google.protobuf.IDuration|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.staticDuration = null; - - /** - * RouteLeg polyline. - * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.polyline = null; - - /** - * RouteLeg startLocation. - * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.startLocation = null; - - /** - * RouteLeg endLocation. - * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.endLocation = null; - - /** - * RouteLeg steps. - * @member {Array.} steps - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.steps = $util.emptyArray; - - /** - * RouteLeg travelAdvisory. - * @member {google.maps.routing.v2.IRouteLegTravelAdvisory|null|undefined} travelAdvisory - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.travelAdvisory = null; - - /** - * RouteLeg localizedValues. - * @member {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues|null|undefined} localizedValues - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.localizedValues = null; - - /** - * RouteLeg stepsOverview. - * @member {google.maps.routing.v2.RouteLeg.IStepsOverview|null|undefined} stepsOverview - * @memberof google.maps.routing.v2.RouteLeg - * @instance - */ - RouteLeg.prototype.stepsOverview = null; - - /** - * Creates a new RouteLeg instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLeg} RouteLeg instance - */ - RouteLeg.create = function create(properties) { - return new RouteLeg(properties); - }; - - /** - * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLeg.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); - 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(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) - $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) - $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) - $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.steps != null && message.steps.length) - for (var i = 0; i < message.steps.length; ++i) - $root.google.maps.routing.v2.RouteLegStep.encode(message.steps[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) - $root.google.maps.routing.v2.RouteLegTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) - $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.stepsOverview != null && Object.hasOwnProperty.call(message, "stepsOverview")) - $root.google.maps.routing.v2.RouteLeg.StepsOverview.encode(message.stepsOverview, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLeg.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLeg message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLeg} RouteLeg - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLeg.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distanceMeters = reader.int32(); - break; - } - case 2: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); - break; - } - case 5: { - message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - case 6: { - message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.steps && message.steps.length)) - message.steps = []; - message.steps.push($root.google.maps.routing.v2.RouteLegStep.decode(reader, reader.uint32())); - break; - } - case 8: { - message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.decode(reader, reader.uint32()); - break; - } - case 9: { - message.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.decode(reader, reader.uint32()); - break; - } - case 10: { - message.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLeg message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLeg} RouteLeg - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLeg.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLeg message. - * @function verify - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLeg.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - if (!$util.isInteger(message.distanceMeters)) - return "distanceMeters: integer expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.protobuf.Duration.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.polyline != null && message.hasOwnProperty("polyline")) { - var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); - if (error) - return "polyline." + error; - } - if (message.startLocation != null && message.hasOwnProperty("startLocation")) { - var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); - if (error) - return "startLocation." + error; - } - if (message.endLocation != null && message.hasOwnProperty("endLocation")) { - var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); - if (error) - return "endLocation." + error; - } - if (message.steps != null && message.hasOwnProperty("steps")) { - if (!Array.isArray(message.steps)) - return "steps: array expected"; - for (var i = 0; i < message.steps.length; ++i) { - var error = $root.google.maps.routing.v2.RouteLegStep.verify(message.steps[i]); - if (error) - return "steps." + error; - } - } - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { - var error = $root.google.maps.routing.v2.RouteLegTravelAdvisory.verify(message.travelAdvisory); - if (error) - return "travelAdvisory." + error; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { - var error = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify(message.localizedValues); - if (error) - return "localizedValues." + error; - } - if (message.stepsOverview != null && message.hasOwnProperty("stepsOverview")) { - var error = $root.google.maps.routing.v2.RouteLeg.StepsOverview.verify(message.stepsOverview); - if (error) - return "stepsOverview." + error; - } - return null; - }; - - /** - * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLeg} RouteLeg - */ - RouteLeg.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLeg) - return object; - var message = new $root.google.maps.routing.v2.RouteLeg(); - if (object.distanceMeters != null) - message.distanceMeters = object.distanceMeters | 0; - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.staticDuration: object expected"); - message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); - } - if (object.polyline != null) { - if (typeof object.polyline !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.polyline: object expected"); - message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); - } - if (object.startLocation != null) { - if (typeof object.startLocation !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.startLocation: object expected"); - message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); - } - if (object.endLocation != null) { - if (typeof object.endLocation !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.endLocation: object expected"); - message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); - } - if (object.steps) { - if (!Array.isArray(object.steps)) - throw TypeError(".google.maps.routing.v2.RouteLeg.steps: array expected"); - message.steps = []; - for (var i = 0; i < object.steps.length; ++i) { - if (typeof object.steps[i] !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.steps: object expected"); - message.steps[i] = $root.google.maps.routing.v2.RouteLegStep.fromObject(object.steps[i]); - } - } - if (object.travelAdvisory != null) { - if (typeof object.travelAdvisory !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.travelAdvisory: object expected"); - message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.fromObject(object.travelAdvisory); - } - if (object.localizedValues != null) { - if (typeof object.localizedValues !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.localizedValues: object expected"); - message.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.fromObject(object.localizedValues); - } - if (object.stepsOverview != null) { - if (typeof object.stepsOverview !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.stepsOverview: object expected"); - message.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.fromObject(object.stepsOverview); - } - return message; - }; - - /** - * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {google.maps.routing.v2.RouteLeg} message RouteLeg - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLeg.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.steps = []; - if (options.defaults) { - object.distanceMeters = 0; - object.duration = null; - object.staticDuration = null; - object.polyline = null; - object.startLocation = null; - object.endLocation = null; - object.travelAdvisory = null; - object.localizedValues = null; - object.stepsOverview = null; - } - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - object.distanceMeters = message.distanceMeters; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); - if (message.polyline != null && message.hasOwnProperty("polyline")) - object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); - if (message.startLocation != null && message.hasOwnProperty("startLocation")) - object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); - if (message.endLocation != null && message.hasOwnProperty("endLocation")) - object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); - if (message.steps && message.steps.length) { - object.steps = []; - for (var j = 0; j < message.steps.length; ++j) - object.steps[j] = $root.google.maps.routing.v2.RouteLegStep.toObject(message.steps[j], options); - } - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) - object.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.toObject(message.travelAdvisory, options); - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) - object.localizedValues = $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.toObject(message.localizedValues, options); - if (message.stepsOverview != null && message.hasOwnProperty("stepsOverview")) - object.stepsOverview = $root.google.maps.routing.v2.RouteLeg.StepsOverview.toObject(message.stepsOverview, options); - return object; - }; - - /** - * Converts this RouteLeg to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLeg - * @instance - * @returns {Object.} JSON object - */ - RouteLeg.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLeg - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLeg - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLeg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg"; - }; - - RouteLeg.RouteLegLocalizedValues = (function() { - - /** - * Properties of a RouteLegLocalizedValues. - * @memberof google.maps.routing.v2.RouteLeg - * @interface IRouteLegLocalizedValues - * @property {google.type.ILocalizedText|null} [distance] RouteLegLocalizedValues distance - * @property {google.type.ILocalizedText|null} [duration] RouteLegLocalizedValues duration - * @property {google.type.ILocalizedText|null} [staticDuration] RouteLegLocalizedValues staticDuration - */ - - /** - * Constructs a new RouteLegLocalizedValues. - * @memberof google.maps.routing.v2.RouteLeg - * @classdesc Represents a RouteLegLocalizedValues. - * @implements IRouteLegLocalizedValues - * @constructor - * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues=} [properties] Properties to set - */ - function RouteLegLocalizedValues(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegLocalizedValues distance. - * @member {google.type.ILocalizedText|null|undefined} distance - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @instance - */ - RouteLegLocalizedValues.prototype.distance = null; - - /** - * RouteLegLocalizedValues duration. - * @member {google.type.ILocalizedText|null|undefined} duration - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @instance - */ - RouteLegLocalizedValues.prototype.duration = null; - - /** - * RouteLegLocalizedValues staticDuration. - * @member {google.type.ILocalizedText|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @instance - */ - RouteLegLocalizedValues.prototype.staticDuration = null; - - /** - * Creates a new RouteLegLocalizedValues instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues instance - */ - RouteLegLocalizedValues.create = function create(properties) { - return new RouteLegLocalizedValues(properties); - }; - - /** - * Encodes the specified RouteLegLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues} message RouteLegLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegLocalizedValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLegLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLeg.IRouteLegLocalizedValues} message RouteLegLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegLocalizedValues message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegLocalizedValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 2: { - message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 3: { - message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegLocalizedValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegLocalizedValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegLocalizedValues message. - * @function verify - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegLocalizedValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distance != null && message.hasOwnProperty("distance")) { - var error = $root.google.type.LocalizedText.verify(message.distance); - if (error) - return "distance." + error; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.type.LocalizedText.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.type.LocalizedText.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - return null; - }; - - /** - * Creates a RouteLegLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} RouteLegLocalizedValues - */ - RouteLegLocalizedValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues) - return object; - var message = new $root.google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues(); - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.distance: object expected"); - message.distance = $root.google.type.LocalizedText.fromObject(object.distance); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.duration: object expected"); - message.duration = $root.google.type.LocalizedText.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues.staticDuration: object expected"); - message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); - } - return message; - }; - - /** - * Creates a plain object from a RouteLegLocalizedValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues} message RouteLegLocalizedValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegLocalizedValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.distance = null; - object.duration = null; - object.staticDuration = null; - } - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); - return object; - }; - - /** - * Converts this RouteLegLocalizedValues to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @instance - * @returns {Object.} JSON object - */ - RouteLegLocalizedValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegLocalizedValues - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues"; - }; - - return RouteLegLocalizedValues; - })(); - - RouteLeg.StepsOverview = (function() { - - /** - * Properties of a StepsOverview. - * @memberof google.maps.routing.v2.RouteLeg - * @interface IStepsOverview - * @property {Array.|null} [multiModalSegments] StepsOverview multiModalSegments - */ - - /** - * Constructs a new StepsOverview. - * @memberof google.maps.routing.v2.RouteLeg - * @classdesc Represents a StepsOverview. - * @implements IStepsOverview - * @constructor - * @param {google.maps.routing.v2.RouteLeg.IStepsOverview=} [properties] Properties to set - */ - function StepsOverview(properties) { - this.multiModalSegments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StepsOverview multiModalSegments. - * @member {Array.} multiModalSegments - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @instance - */ - StepsOverview.prototype.multiModalSegments = $util.emptyArray; - - /** - * Creates a new StepsOverview instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {google.maps.routing.v2.RouteLeg.IStepsOverview=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview instance - */ - StepsOverview.create = function create(properties) { - return new StepsOverview(properties); - }; - - /** - * Encodes the specified StepsOverview message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {google.maps.routing.v2.RouteLeg.IStepsOverview} message StepsOverview message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StepsOverview.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.multiModalSegments != null && message.multiModalSegments.length) - for (var i = 0; i < message.multiModalSegments.length; ++i) - $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.encode(message.multiModalSegments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StepsOverview message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {google.maps.routing.v2.RouteLeg.IStepsOverview} message StepsOverview message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StepsOverview.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StepsOverview message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StepsOverview.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.multiModalSegments && message.multiModalSegments.length)) - message.multiModalSegments = []; - message.multiModalSegments.push($root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StepsOverview message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StepsOverview.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StepsOverview message. - * @function verify - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StepsOverview.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.multiModalSegments != null && message.hasOwnProperty("multiModalSegments")) { - if (!Array.isArray(message.multiModalSegments)) - return "multiModalSegments: array expected"; - for (var i = 0; i < message.multiModalSegments.length; ++i) { - var error = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify(message.multiModalSegments[i]); - if (error) - return "multiModalSegments." + error; - } - } - return null; - }; - - /** - * Creates a StepsOverview message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview} StepsOverview - */ - StepsOverview.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLeg.StepsOverview) - return object; - var message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview(); - if (object.multiModalSegments) { - if (!Array.isArray(object.multiModalSegments)) - throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.multiModalSegments: array expected"); - message.multiModalSegments = []; - for (var i = 0; i < object.multiModalSegments.length; ++i) { - if (typeof object.multiModalSegments[i] !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.multiModalSegments: object expected"); - message.multiModalSegments[i] = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.fromObject(object.multiModalSegments[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a StepsOverview message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {google.maps.routing.v2.RouteLeg.StepsOverview} message StepsOverview - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StepsOverview.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.multiModalSegments = []; - if (message.multiModalSegments && message.multiModalSegments.length) { - object.multiModalSegments = []; - for (var j = 0; j < message.multiModalSegments.length; ++j) - object.multiModalSegments[j] = $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.toObject(message.multiModalSegments[j], options); - } - return object; - }; - - /** - * Converts this StepsOverview to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @instance - * @returns {Object.} JSON object - */ - StepsOverview.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StepsOverview - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StepsOverview.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.StepsOverview"; - }; - - StepsOverview.MultiModalSegment = (function() { - - /** - * Properties of a MultiModalSegment. - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @interface IMultiModalSegment - * @property {number|null} [stepStartIndex] MultiModalSegment stepStartIndex - * @property {number|null} [stepEndIndex] MultiModalSegment stepEndIndex - * @property {google.maps.routing.v2.INavigationInstruction|null} [navigationInstruction] MultiModalSegment navigationInstruction - * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] MultiModalSegment travelMode - */ - - /** - * Constructs a new MultiModalSegment. - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview - * @classdesc Represents a MultiModalSegment. - * @implements IMultiModalSegment - * @constructor - * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment=} [properties] Properties to set - */ - function MultiModalSegment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiModalSegment stepStartIndex. - * @member {number|null|undefined} stepStartIndex - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @instance - */ - MultiModalSegment.prototype.stepStartIndex = null; - - /** - * MultiModalSegment stepEndIndex. - * @member {number|null|undefined} stepEndIndex - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @instance - */ - MultiModalSegment.prototype.stepEndIndex = null; - - /** - * MultiModalSegment navigationInstruction. - * @member {google.maps.routing.v2.INavigationInstruction|null|undefined} navigationInstruction - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @instance - */ - MultiModalSegment.prototype.navigationInstruction = null; - - /** - * MultiModalSegment travelMode. - * @member {google.maps.routing.v2.RouteTravelMode} travelMode - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @instance - */ - MultiModalSegment.prototype.travelMode = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MultiModalSegment.prototype, "_stepStartIndex", { - get: $util.oneOfGetter($oneOfFields = ["stepStartIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(MultiModalSegment.prototype, "_stepEndIndex", { - get: $util.oneOfGetter($oneOfFields = ["stepEndIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new MultiModalSegment instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment instance - */ - MultiModalSegment.create = function create(properties) { - return new MultiModalSegment(properties); - }; - - /** - * Encodes the specified MultiModalSegment message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment} message MultiModalSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiModalSegment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stepStartIndex != null && Object.hasOwnProperty.call(message, "stepStartIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stepStartIndex); - if (message.stepEndIndex != null && Object.hasOwnProperty.call(message, "stepEndIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stepEndIndex); - if (message.navigationInstruction != null && Object.hasOwnProperty.call(message, "navigationInstruction")) - $root.google.maps.routing.v2.NavigationInstruction.encode(message.navigationInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.travelMode); - return writer; - }; - - /** - * Encodes the specified MultiModalSegment message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {google.maps.routing.v2.RouteLeg.StepsOverview.IMultiModalSegment} message MultiModalSegment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiModalSegment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiModalSegment message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiModalSegment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stepStartIndex = reader.int32(); - break; - } - case 2: { - message.stepEndIndex = reader.int32(); - break; - } - case 3: { - message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.decode(reader, reader.uint32()); - break; - } - case 4: { - message.travelMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiModalSegment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiModalSegment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiModalSegment message. - * @function verify - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiModalSegment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stepStartIndex != null && message.hasOwnProperty("stepStartIndex")) { - properties._stepStartIndex = 1; - if (!$util.isInteger(message.stepStartIndex)) - return "stepStartIndex: integer expected"; - } - if (message.stepEndIndex != null && message.hasOwnProperty("stepEndIndex")) { - properties._stepEndIndex = 1; - if (!$util.isInteger(message.stepEndIndex)) - return "stepEndIndex: integer expected"; - } - if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) { - var error = $root.google.maps.routing.v2.NavigationInstruction.verify(message.navigationInstruction); - if (error) - return "navigationInstruction." + error; - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - switch (message.travelMode) { - default: - return "travelMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 7: - break; - } - return null; - }; - - /** - * Creates a MultiModalSegment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} MultiModalSegment - */ - MultiModalSegment.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment) - return object; - var message = new $root.google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment(); - if (object.stepStartIndex != null) - message.stepStartIndex = object.stepStartIndex | 0; - if (object.stepEndIndex != null) - message.stepEndIndex = object.stepEndIndex | 0; - if (object.navigationInstruction != null) { - if (typeof object.navigationInstruction !== "object") - throw TypeError(".google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment.navigationInstruction: object expected"); - message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.fromObject(object.navigationInstruction); - } - 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 "DRIVE": - case 1: - message.travelMode = 1; - break; - case "BICYCLE": - case 2: - message.travelMode = 2; - break; - case "WALK": - case 3: - message.travelMode = 3; - break; - case "TWO_WHEELER": - case 4: - message.travelMode = 4; - break; - case "TRANSIT": - case 7: - message.travelMode = 7; - break; - } - return message; - }; - - /** - * Creates a plain object from a MultiModalSegment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment} message MultiModalSegment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiModalSegment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.navigationInstruction = null; - object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; - } - if (message.stepStartIndex != null && message.hasOwnProperty("stepStartIndex")) { - object.stepStartIndex = message.stepStartIndex; - if (options.oneofs) - object._stepStartIndex = "stepStartIndex"; - } - if (message.stepEndIndex != null && message.hasOwnProperty("stepEndIndex")) { - object.stepEndIndex = message.stepEndIndex; - if (options.oneofs) - object._stepEndIndex = "stepEndIndex"; - } - if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) - object.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.toObject(message.navigationInstruction, options); - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; - return object; - }; - - /** - * Converts this MultiModalSegment to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @instance - * @returns {Object.} JSON object - */ - MultiModalSegment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiModalSegment - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiModalSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment"; - }; - - return MultiModalSegment; - })(); - - return StepsOverview; - })(); - - return RouteLeg; - })(); - - v2.RouteLegStep = (function() { - - /** - * Properties of a RouteLegStep. - * @memberof google.maps.routing.v2 - * @interface IRouteLegStep - * @property {number|null} [distanceMeters] RouteLegStep distanceMeters - * @property {google.protobuf.IDuration|null} [staticDuration] RouteLegStep staticDuration - * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLegStep polyline - * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLegStep startLocation - * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLegStep endLocation - * @property {google.maps.routing.v2.INavigationInstruction|null} [navigationInstruction] RouteLegStep navigationInstruction - * @property {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null} [travelAdvisory] RouteLegStep travelAdvisory - * @property {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null} [localizedValues] RouteLegStep localizedValues - * @property {google.maps.routing.v2.IRouteLegStepTransitDetails|null} [transitDetails] RouteLegStep transitDetails - * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] RouteLegStep travelMode - */ - - /** - * Constructs a new RouteLegStep. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteLegStep. - * @implements IRouteLegStep - * @constructor - * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set - */ - function RouteLegStep(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegStep distanceMeters. - * @member {number} distanceMeters - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.distanceMeters = 0; - - /** - * RouteLegStep staticDuration. - * @member {google.protobuf.IDuration|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.staticDuration = null; - - /** - * RouteLegStep polyline. - * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.polyline = null; - - /** - * RouteLegStep startLocation. - * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.startLocation = null; - - /** - * RouteLegStep endLocation. - * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.endLocation = null; - - /** - * RouteLegStep navigationInstruction. - * @member {google.maps.routing.v2.INavigationInstruction|null|undefined} navigationInstruction - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.navigationInstruction = null; - - /** - * RouteLegStep travelAdvisory. - * @member {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null|undefined} travelAdvisory - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.travelAdvisory = null; - - /** - * RouteLegStep localizedValues. - * @member {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues|null|undefined} localizedValues - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.localizedValues = null; - - /** - * RouteLegStep transitDetails. - * @member {google.maps.routing.v2.IRouteLegStepTransitDetails|null|undefined} transitDetails - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.transitDetails = null; - - /** - * RouteLegStep travelMode. - * @member {google.maps.routing.v2.RouteTravelMode} travelMode - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - */ - RouteLegStep.prototype.travelMode = 0; - - /** - * Creates a new RouteLegStep instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep instance - */ - RouteLegStep.create = function create(properties) { - return new RouteLegStep(properties); - }; - - /** - * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStep.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) - $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) - $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) - $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.navigationInstruction != null && Object.hasOwnProperty.call(message, "navigationInstruction")) - $root.google.maps.routing.v2.NavigationInstruction.encode(message.navigationInstruction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) - $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) - $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.transitDetails != null && Object.hasOwnProperty.call(message, "transitDetails")) - $root.google.maps.routing.v2.RouteLegStepTransitDetails.encode(message.transitDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.travelMode); - return writer; - }; - - /** - * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStep.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegStep message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStep.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStep(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distanceMeters = reader.int32(); - break; - } - case 2: { - message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); - break; - } - case 4: { - message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - case 5: { - message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - case 6: { - message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.decode(reader, reader.uint32()); - break; - } - case 7: { - message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.decode(reader, reader.uint32()); - break; - } - case 8: { - message.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.decode(reader, reader.uint32()); - break; - } - case 9: { - message.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.decode(reader, reader.uint32()); - break; - } - case 10: { - message.travelMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStep.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegStep message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegStep.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - if (!$util.isInteger(message.distanceMeters)) - return "distanceMeters: integer expected"; - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.protobuf.Duration.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.polyline != null && message.hasOwnProperty("polyline")) { - var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); - if (error) - return "polyline." + error; - } - if (message.startLocation != null && message.hasOwnProperty("startLocation")) { - var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); - if (error) - return "startLocation." + error; - } - if (message.endLocation != null && message.hasOwnProperty("endLocation")) { - var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); - if (error) - return "endLocation." + error; - } - if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) { - var error = $root.google.maps.routing.v2.NavigationInstruction.verify(message.navigationInstruction); - if (error) - return "navigationInstruction." + error; - } - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { - var error = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.verify(message.travelAdvisory); - if (error) - return "travelAdvisory." + error; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { - var error = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify(message.localizedValues); - if (error) - return "localizedValues." + error; - } - if (message.transitDetails != null && message.hasOwnProperty("transitDetails")) { - var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.verify(message.transitDetails); - if (error) - return "transitDetails." + error; - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - switch (message.travelMode) { - default: - return "travelMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 7: - break; - } - return null; - }; - - /** - * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep - */ - RouteLegStep.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStep) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStep(); - if (object.distanceMeters != null) - message.distanceMeters = object.distanceMeters | 0; - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.staticDuration: object expected"); - message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); - } - if (object.polyline != null) { - if (typeof object.polyline !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.polyline: object expected"); - message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); - } - if (object.startLocation != null) { - if (typeof object.startLocation !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.startLocation: object expected"); - message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); - } - if (object.endLocation != null) { - if (typeof object.endLocation !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.endLocation: object expected"); - message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); - } - if (object.navigationInstruction != null) { - if (typeof object.navigationInstruction !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.navigationInstruction: object expected"); - message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.fromObject(object.navigationInstruction); - } - if (object.travelAdvisory != null) { - if (typeof object.travelAdvisory !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.travelAdvisory: object expected"); - message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.fromObject(object.travelAdvisory); - } - if (object.localizedValues != null) { - if (typeof object.localizedValues !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.localizedValues: object expected"); - message.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.fromObject(object.localizedValues); - } - if (object.transitDetails != null) { - if (typeof object.transitDetails !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.transitDetails: object expected"); - message.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.fromObject(object.transitDetails); - } - 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 "DRIVE": - case 1: - message.travelMode = 1; - break; - case "BICYCLE": - case 2: - message.travelMode = 2; - break; - case "WALK": - case 3: - message.travelMode = 3; - break; - case "TWO_WHEELER": - case 4: - message.travelMode = 4; - break; - case "TRANSIT": - case 7: - message.travelMode = 7; - break; - } - return message; - }; - - /** - * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {google.maps.routing.v2.RouteLegStep} message RouteLegStep - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegStep.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.distanceMeters = 0; - object.staticDuration = null; - object.polyline = null; - object.startLocation = null; - object.endLocation = null; - object.navigationInstruction = null; - object.travelAdvisory = null; - object.localizedValues = null; - object.transitDetails = null; - object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; - } - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - object.distanceMeters = message.distanceMeters; - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); - if (message.polyline != null && message.hasOwnProperty("polyline")) - object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); - if (message.startLocation != null && message.hasOwnProperty("startLocation")) - object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); - if (message.endLocation != null && message.hasOwnProperty("endLocation")) - object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); - if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) - object.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.toObject(message.navigationInstruction, options); - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) - object.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.toObject(message.travelAdvisory, options); - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) - object.localizedValues = $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.toObject(message.localizedValues, options); - if (message.transitDetails != null && message.hasOwnProperty("transitDetails")) - object.transitDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.toObject(message.transitDetails, options); - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; - return object; - }; - - /** - * Converts this RouteLegStep to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStep - * @instance - * @returns {Object.} JSON object - */ - RouteLegStep.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegStep - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStep - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStep"; - }; - - RouteLegStep.RouteLegStepLocalizedValues = (function() { - - /** - * Properties of a RouteLegStepLocalizedValues. - * @memberof google.maps.routing.v2.RouteLegStep - * @interface IRouteLegStepLocalizedValues - * @property {google.type.ILocalizedText|null} [distance] RouteLegStepLocalizedValues distance - * @property {google.type.ILocalizedText|null} [staticDuration] RouteLegStepLocalizedValues staticDuration - */ - - /** - * Constructs a new RouteLegStepLocalizedValues. - * @memberof google.maps.routing.v2.RouteLegStep - * @classdesc Represents a RouteLegStepLocalizedValues. - * @implements IRouteLegStepLocalizedValues - * @constructor - * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues=} [properties] Properties to set - */ - function RouteLegStepLocalizedValues(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegStepLocalizedValues distance. - * @member {google.type.ILocalizedText|null|undefined} distance - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @instance - */ - RouteLegStepLocalizedValues.prototype.distance = null; - - /** - * RouteLegStepLocalizedValues staticDuration. - * @member {google.type.ILocalizedText|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @instance - */ - RouteLegStepLocalizedValues.prototype.staticDuration = null; - - /** - * Creates a new RouteLegStepLocalizedValues instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues instance - */ - RouteLegStepLocalizedValues.create = function create(properties) { - return new RouteLegStepLocalizedValues(properties); - }; - - /** - * Encodes the specified RouteLegStepLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues} message RouteLegStepLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepLocalizedValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteLegStepLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStep.IRouteLegStepLocalizedValues} message RouteLegStepLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepLocalizedValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 3: { - message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegStepLocalizedValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepLocalizedValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegStepLocalizedValues message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegStepLocalizedValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distance != null && message.hasOwnProperty("distance")) { - var error = $root.google.type.LocalizedText.verify(message.distance); - if (error) - return "distance." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.type.LocalizedText.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - return null; - }; - - /** - * Creates a RouteLegStepLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} RouteLegStepLocalizedValues - */ - RouteLegStepLocalizedValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues(); - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.distance: object expected"); - message.distance = $root.google.type.LocalizedText.fromObject(object.distance); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues.staticDuration: object expected"); - message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); - } - return message; - }; - - /** - * Creates a plain object from a RouteLegStepLocalizedValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues} message RouteLegStepLocalizedValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegStepLocalizedValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.distance = null; - object.staticDuration = null; - } - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); - return object; - }; - - /** - * Converts this RouteLegStepLocalizedValues to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @instance - * @returns {Object.} JSON object - */ - RouteLegStepLocalizedValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegStepLocalizedValues - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegStepLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues"; - }; - - return RouteLegStepLocalizedValues; - })(); - - return RouteLegStep; - })(); - - v2.RouteLegStepTransitDetails = (function() { - - /** - * Properties of a RouteLegStepTransitDetails. - * @memberof google.maps.routing.v2 - * @interface IRouteLegStepTransitDetails - * @property {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null} [stopDetails] RouteLegStepTransitDetails stopDetails - * @property {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null} [localizedValues] RouteLegStepTransitDetails localizedValues - * @property {string|null} [headsign] RouteLegStepTransitDetails headsign - * @property {google.protobuf.IDuration|null} [headway] RouteLegStepTransitDetails headway - * @property {google.maps.routing.v2.ITransitLine|null} [transitLine] RouteLegStepTransitDetails transitLine - * @property {number|null} [stopCount] RouteLegStepTransitDetails stopCount - * @property {string|null} [tripShortText] RouteLegStepTransitDetails tripShortText - */ - - /** - * Constructs a new RouteLegStepTransitDetails. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteLegStepTransitDetails. - * @implements IRouteLegStepTransitDetails - * @constructor - * @param {google.maps.routing.v2.IRouteLegStepTransitDetails=} [properties] Properties to set - */ - function RouteLegStepTransitDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteLegStepTransitDetails stopDetails. - * @member {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails|null|undefined} stopDetails - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.stopDetails = null; - - /** - * RouteLegStepTransitDetails localizedValues. - * @member {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues|null|undefined} localizedValues - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.localizedValues = null; - - /** - * RouteLegStepTransitDetails headsign. - * @member {string} headsign - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.headsign = ""; - - /** - * RouteLegStepTransitDetails headway. - * @member {google.protobuf.IDuration|null|undefined} headway - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.headway = null; - - /** - * RouteLegStepTransitDetails transitLine. - * @member {google.maps.routing.v2.ITransitLine|null|undefined} transitLine - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.transitLine = null; - - /** - * RouteLegStepTransitDetails stopCount. - * @member {number} stopCount - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.stopCount = 0; - - /** - * RouteLegStepTransitDetails tripShortText. - * @member {string} tripShortText - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - */ - RouteLegStepTransitDetails.prototype.tripShortText = ""; - - /** - * Creates a new RouteLegStepTransitDetails instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {google.maps.routing.v2.IRouteLegStepTransitDetails=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails instance - */ - RouteLegStepTransitDetails.create = function create(properties) { - return new RouteLegStepTransitDetails(properties); - }; - - /** - * Encodes the specified RouteLegStepTransitDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {google.maps.routing.v2.IRouteLegStepTransitDetails} message RouteLegStepTransitDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepTransitDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stopDetails != null && Object.hasOwnProperty.call(message, "stopDetails")) - $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.encode(message.stopDetails, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) - $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.encode(message.localizedValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.headsign != null && Object.hasOwnProperty.call(message, "headsign")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.headsign); - if (message.headway != null && Object.hasOwnProperty.call(message, "headway")) - $root.google.protobuf.Duration.encode(message.headway, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.transitLine != null && Object.hasOwnProperty.call(message, "transitLine")) - $root.google.maps.routing.v2.TransitLine.encode(message.transitLine, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.stopCount != null && Object.hasOwnProperty.call(message, "stopCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.stopCount); - if (message.tripShortText != null && Object.hasOwnProperty.call(message, "tripShortText")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.tripShortText); - return writer; - }; - - /** - * Encodes the specified RouteLegStepTransitDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {google.maps.routing.v2.IRouteLegStepTransitDetails} message RouteLegStepTransitDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteLegStepTransitDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepTransitDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.decode(reader, reader.uint32()); - break; - } - case 2: { - message.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.decode(reader, reader.uint32()); - break; - } - case 3: { - message.headsign = reader.string(); - break; - } - case 4: { - message.headway = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.transitLine = $root.google.maps.routing.v2.TransitLine.decode(reader, reader.uint32()); - break; - } - case 6: { - message.stopCount = reader.int32(); - break; - } - case 7: { - message.tripShortText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteLegStepTransitDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteLegStepTransitDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteLegStepTransitDetails message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteLegStepTransitDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stopDetails != null && message.hasOwnProperty("stopDetails")) { - var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify(message.stopDetails); - if (error) - return "stopDetails." + error; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { - var error = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify(message.localizedValues); - if (error) - return "localizedValues." + error; - } - if (message.headsign != null && message.hasOwnProperty("headsign")) - if (!$util.isString(message.headsign)) - return "headsign: string expected"; - if (message.headway != null && message.hasOwnProperty("headway")) { - var error = $root.google.protobuf.Duration.verify(message.headway); - if (error) - return "headway." + error; - } - if (message.transitLine != null && message.hasOwnProperty("transitLine")) { - var error = $root.google.maps.routing.v2.TransitLine.verify(message.transitLine); - if (error) - return "transitLine." + error; - } - if (message.stopCount != null && message.hasOwnProperty("stopCount")) - if (!$util.isInteger(message.stopCount)) - return "stopCount: integer expected"; - if (message.tripShortText != null && message.hasOwnProperty("tripShortText")) - if (!$util.isString(message.tripShortText)) - return "tripShortText: string expected"; - return null; - }; - - /** - * Creates a RouteLegStepTransitDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails} RouteLegStepTransitDetails - */ - RouteLegStepTransitDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails(); - if (object.stopDetails != null) { - if (typeof object.stopDetails !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.stopDetails: object expected"); - message.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.fromObject(object.stopDetails); - } - if (object.localizedValues != null) { - if (typeof object.localizedValues !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.localizedValues: object expected"); - message.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.fromObject(object.localizedValues); - } - if (object.headsign != null) - message.headsign = String(object.headsign); - if (object.headway != null) { - if (typeof object.headway !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.headway: object expected"); - message.headway = $root.google.protobuf.Duration.fromObject(object.headway); - } - if (object.transitLine != null) { - if (typeof object.transitLine !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.transitLine: object expected"); - message.transitLine = $root.google.maps.routing.v2.TransitLine.fromObject(object.transitLine); - } - if (object.stopCount != null) - message.stopCount = object.stopCount | 0; - if (object.tripShortText != null) - message.tripShortText = String(object.tripShortText); - return message; - }; - - /** - * Creates a plain object from a RouteLegStepTransitDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails} message RouteLegStepTransitDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteLegStepTransitDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stopDetails = null; - object.localizedValues = null; - object.headsign = ""; - object.headway = null; - object.transitLine = null; - object.stopCount = 0; - object.tripShortText = ""; - } - if (message.stopDetails != null && message.hasOwnProperty("stopDetails")) - object.stopDetails = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.toObject(message.stopDetails, options); - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) - object.localizedValues = $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.toObject(message.localizedValues, options); - if (message.headsign != null && message.hasOwnProperty("headsign")) - object.headsign = message.headsign; - if (message.headway != null && message.hasOwnProperty("headway")) - object.headway = $root.google.protobuf.Duration.toObject(message.headway, options); - if (message.transitLine != null && message.hasOwnProperty("transitLine")) - object.transitLine = $root.google.maps.routing.v2.TransitLine.toObject(message.transitLine, options); - if (message.stopCount != null && message.hasOwnProperty("stopCount")) - object.stopCount = message.stopCount; - if (message.tripShortText != null && message.hasOwnProperty("tripShortText")) - object.tripShortText = message.tripShortText; - return object; - }; - - /** - * Converts this RouteLegStepTransitDetails to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @instance - * @returns {Object.} JSON object - */ - RouteLegStepTransitDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteLegStepTransitDetails - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteLegStepTransitDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails"; - }; - - RouteLegStepTransitDetails.TransitStopDetails = (function() { - - /** - * Properties of a TransitStopDetails. - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @interface ITransitStopDetails - * @property {google.maps.routing.v2.ITransitStop|null} [arrivalStop] TransitStopDetails arrivalStop - * @property {google.protobuf.ITimestamp|null} [arrivalTime] TransitStopDetails arrivalTime - * @property {google.maps.routing.v2.ITransitStop|null} [departureStop] TransitStopDetails departureStop - * @property {google.protobuf.ITimestamp|null} [departureTime] TransitStopDetails departureTime - */ - - /** - * Constructs a new TransitStopDetails. - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @classdesc Represents a TransitStopDetails. - * @implements ITransitStopDetails - * @constructor - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails=} [properties] Properties to set - */ - function TransitStopDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitStopDetails arrivalStop. - * @member {google.maps.routing.v2.ITransitStop|null|undefined} arrivalStop - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @instance - */ - TransitStopDetails.prototype.arrivalStop = null; - - /** - * TransitStopDetails arrivalTime. - * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @instance - */ - TransitStopDetails.prototype.arrivalTime = null; - - /** - * TransitStopDetails departureStop. - * @member {google.maps.routing.v2.ITransitStop|null|undefined} departureStop - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @instance - */ - TransitStopDetails.prototype.departureStop = null; - - /** - * TransitStopDetails departureTime. - * @member {google.protobuf.ITimestamp|null|undefined} departureTime - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @instance - */ - TransitStopDetails.prototype.departureTime = null; - - /** - * Creates a new TransitStopDetails instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails instance - */ - TransitStopDetails.create = function create(properties) { - return new TransitStopDetails(properties); - }; - - /** - * Encodes the specified TransitStopDetails message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails} message TransitStopDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitStopDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.arrivalStop != null && Object.hasOwnProperty.call(message, "arrivalStop")) - $root.google.maps.routing.v2.TransitStop.encode(message.arrivalStop, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) - $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.departureStop != null && Object.hasOwnProperty.call(message, "departureStop")) - $root.google.maps.routing.v2.TransitStop.encode(message.departureStop, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) - $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitStopDetails message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitStopDetails} message TransitStopDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitStopDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitStopDetails message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitStopDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.arrivalStop = $root.google.maps.routing.v2.TransitStop.decode(reader, reader.uint32()); - break; - } - case 2: { - message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.departureStop = $root.google.maps.routing.v2.TransitStop.decode(reader, reader.uint32()); - break; - } - case 4: { - message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitStopDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitStopDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitStopDetails message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitStopDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.arrivalStop != null && message.hasOwnProperty("arrivalStop")) { - var error = $root.google.maps.routing.v2.TransitStop.verify(message.arrivalStop); - if (error) - return "arrivalStop." + error; - } - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); - if (error) - return "arrivalTime." + error; - } - if (message.departureStop != null && message.hasOwnProperty("departureStop")) { - var error = $root.google.maps.routing.v2.TransitStop.verify(message.departureStop); - if (error) - return "departureStop." + error; - } - if (message.departureTime != null && message.hasOwnProperty("departureTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.departureTime); - if (error) - return "departureTime." + error; - } - return null; - }; - - /** - * Creates a TransitStopDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} TransitStopDetails - */ - TransitStopDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails(); - if (object.arrivalStop != null) { - if (typeof object.arrivalStop !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.arrivalStop: object expected"); - message.arrivalStop = $root.google.maps.routing.v2.TransitStop.fromObject(object.arrivalStop); - } - if (object.arrivalTime != null) { - if (typeof object.arrivalTime !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.arrivalTime: object expected"); - message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); - } - if (object.departureStop != null) { - if (typeof object.departureStop !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.departureStop: object expected"); - message.departureStop = $root.google.maps.routing.v2.TransitStop.fromObject(object.departureStop); - } - if (object.departureTime != null) { - if (typeof object.departureTime !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails.departureTime: object expected"); - message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); - } - return message; - }; - - /** - * Creates a plain object from a TransitStopDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails} message TransitStopDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitStopDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.arrivalStop = null; - object.arrivalTime = null; - object.departureStop = null; - object.departureTime = null; - } - if (message.arrivalStop != null && message.hasOwnProperty("arrivalStop")) - object.arrivalStop = $root.google.maps.routing.v2.TransitStop.toObject(message.arrivalStop, options); - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) - object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); - if (message.departureStop != null && message.hasOwnProperty("departureStop")) - object.departureStop = $root.google.maps.routing.v2.TransitStop.toObject(message.departureStop, options); - if (message.departureTime != null && message.hasOwnProperty("departureTime")) - object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); - return object; - }; - - /** - * Converts this TransitStopDetails to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @instance - * @returns {Object.} JSON object - */ - TransitStopDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitStopDetails - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitStopDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails"; - }; - - return TransitStopDetails; - })(); - - RouteLegStepTransitDetails.TransitDetailsLocalizedValues = (function() { - - /** - * Properties of a TransitDetailsLocalizedValues. - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @interface ITransitDetailsLocalizedValues - * @property {google.maps.routing.v2.ILocalizedTime|null} [arrivalTime] TransitDetailsLocalizedValues arrivalTime - * @property {google.maps.routing.v2.ILocalizedTime|null} [departureTime] TransitDetailsLocalizedValues departureTime - */ - - /** - * Constructs a new TransitDetailsLocalizedValues. - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails - * @classdesc Represents a TransitDetailsLocalizedValues. - * @implements ITransitDetailsLocalizedValues - * @constructor - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues=} [properties] Properties to set - */ - function TransitDetailsLocalizedValues(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitDetailsLocalizedValues arrivalTime. - * @member {google.maps.routing.v2.ILocalizedTime|null|undefined} arrivalTime - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @instance - */ - TransitDetailsLocalizedValues.prototype.arrivalTime = null; - - /** - * TransitDetailsLocalizedValues departureTime. - * @member {google.maps.routing.v2.ILocalizedTime|null|undefined} departureTime - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @instance - */ - TransitDetailsLocalizedValues.prototype.departureTime = null; - - /** - * Creates a new TransitDetailsLocalizedValues instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues instance - */ - TransitDetailsLocalizedValues.create = function create(properties) { - return new TransitDetailsLocalizedValues(properties); - }; - - /** - * Encodes the specified TransitDetailsLocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues} message TransitDetailsLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitDetailsLocalizedValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) - $root.google.maps.routing.v2.LocalizedTime.encode(message.arrivalTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) - $root.google.maps.routing.v2.LocalizedTime.encode(message.departureTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitDetailsLocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.ITransitDetailsLocalizedValues} message TransitDetailsLocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitDetailsLocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitDetailsLocalizedValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.decode(reader, reader.uint32()); - break; - } - case 2: { - message.departureTime = $root.google.maps.routing.v2.LocalizedTime.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitDetailsLocalizedValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitDetailsLocalizedValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitDetailsLocalizedValues message. - * @function verify - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitDetailsLocalizedValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { - var error = $root.google.maps.routing.v2.LocalizedTime.verify(message.arrivalTime); - if (error) - return "arrivalTime." + error; - } - if (message.departureTime != null && message.hasOwnProperty("departureTime")) { - var error = $root.google.maps.routing.v2.LocalizedTime.verify(message.departureTime); - if (error) - return "departureTime." + error; - } - return null; - }; - - /** - * Creates a TransitDetailsLocalizedValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} TransitDetailsLocalizedValues - */ - TransitDetailsLocalizedValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues) - return object; - var message = new $root.google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues(); - if (object.arrivalTime != null) { - if (typeof object.arrivalTime !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.arrivalTime: object expected"); - message.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.fromObject(object.arrivalTime); - } - if (object.departureTime != null) { - if (typeof object.departureTime !== "object") - throw TypeError(".google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues.departureTime: object expected"); - message.departureTime = $root.google.maps.routing.v2.LocalizedTime.fromObject(object.departureTime); - } - return message; - }; - - /** - * Creates a plain object from a TransitDetailsLocalizedValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues} message TransitDetailsLocalizedValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitDetailsLocalizedValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.arrivalTime = null; - object.departureTime = null; - } - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) - object.arrivalTime = $root.google.maps.routing.v2.LocalizedTime.toObject(message.arrivalTime, options); - if (message.departureTime != null && message.hasOwnProperty("departureTime")) - object.departureTime = $root.google.maps.routing.v2.LocalizedTime.toObject(message.departureTime, options); - return object; - }; - - /** - * Converts this TransitDetailsLocalizedValues to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @instance - * @returns {Object.} JSON object - */ - TransitDetailsLocalizedValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitDetailsLocalizedValues - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitDetailsLocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues"; - }; - - return TransitDetailsLocalizedValues; - })(); - - return RouteLegStepTransitDetails; - })(); - - /** - * RouteLabel enum. - * @name google.maps.routing.v2.RouteLabel - * @enum {number} - * @property {number} ROUTE_LABEL_UNSPECIFIED=0 ROUTE_LABEL_UNSPECIFIED value - * @property {number} DEFAULT_ROUTE=1 DEFAULT_ROUTE value - * @property {number} DEFAULT_ROUTE_ALTERNATE=2 DEFAULT_ROUTE_ALTERNATE value - * @property {number} FUEL_EFFICIENT=3 FUEL_EFFICIENT value - * @property {number} SHORTER_DISTANCE=4 SHORTER_DISTANCE value - */ - v2.RouteLabel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROUTE_LABEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT_ROUTE"] = 1; - values[valuesById[2] = "DEFAULT_ROUTE_ALTERNATE"] = 2; - values[valuesById[3] = "FUEL_EFFICIENT"] = 3; - values[valuesById[4] = "SHORTER_DISTANCE"] = 4; - return values; - })(); - - /** - * RouteTravelMode enum. - * @name google.maps.routing.v2.RouteTravelMode - * @enum {number} - * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value - * @property {number} DRIVE=1 DRIVE value - * @property {number} BICYCLE=2 BICYCLE value - * @property {number} WALK=3 WALK value - * @property {number} TWO_WHEELER=4 TWO_WHEELER value - * @property {number} TRANSIT=7 TRANSIT value - */ - v2.RouteTravelMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DRIVE"] = 1; - values[valuesById[2] = "BICYCLE"] = 2; - values[valuesById[3] = "WALK"] = 3; - values[valuesById[4] = "TWO_WHEELER"] = 4; - values[valuesById[7] = "TRANSIT"] = 7; - return values; - })(); - - v2.SpeedReadingInterval = (function() { - - /** - * Properties of a SpeedReadingInterval. - * @memberof google.maps.routing.v2 - * @interface ISpeedReadingInterval - * @property {number|null} [startPolylinePointIndex] SpeedReadingInterval startPolylinePointIndex - * @property {number|null} [endPolylinePointIndex] SpeedReadingInterval endPolylinePointIndex - * @property {google.maps.routing.v2.SpeedReadingInterval.Speed|null} [speed] SpeedReadingInterval speed - */ - - /** - * Constructs a new SpeedReadingInterval. - * @memberof google.maps.routing.v2 - * @classdesc Represents a SpeedReadingInterval. - * @implements ISpeedReadingInterval - * @constructor - * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set - */ - function SpeedReadingInterval(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpeedReadingInterval startPolylinePointIndex. - * @member {number|null|undefined} startPolylinePointIndex - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @instance - */ - SpeedReadingInterval.prototype.startPolylinePointIndex = null; - - /** - * SpeedReadingInterval endPolylinePointIndex. - * @member {number|null|undefined} endPolylinePointIndex - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @instance - */ - SpeedReadingInterval.prototype.endPolylinePointIndex = null; - - /** - * SpeedReadingInterval speed. - * @member {google.maps.routing.v2.SpeedReadingInterval.Speed|null|undefined} speed - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @instance - */ - SpeedReadingInterval.prototype.speed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpeedReadingInterval.prototype, "_startPolylinePointIndex", { - get: $util.oneOfGetter($oneOfFields = ["startPolylinePointIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SpeedReadingInterval.prototype, "_endPolylinePointIndex", { - get: $util.oneOfGetter($oneOfFields = ["endPolylinePointIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SpeedReadingInterval speedType. - * @member {"speed"|undefined} speedType - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @instance - */ - Object.defineProperty(SpeedReadingInterval.prototype, "speedType", { - get: $util.oneOfGetter($oneOfFields = ["speed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SpeedReadingInterval instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set - * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval instance - */ - SpeedReadingInterval.create = function create(properties) { - return new SpeedReadingInterval(properties); - }; - - /** - * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeedReadingInterval.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startPolylinePointIndex != null && Object.hasOwnProperty.call(message, "startPolylinePointIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startPolylinePointIndex); - if (message.endPolylinePointIndex != null && Object.hasOwnProperty.call(message, "endPolylinePointIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endPolylinePointIndex); - if (message.speed != null && Object.hasOwnProperty.call(message, "speed")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speed); - return writer; - }; - - /** - * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeedReadingInterval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpeedReadingInterval message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeedReadingInterval.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.SpeedReadingInterval(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startPolylinePointIndex = reader.int32(); - break; - } - case 2: { - message.endPolylinePointIndex = reader.int32(); - break; - } - case 3: { - message.speed = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeedReadingInterval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpeedReadingInterval message. - * @function verify - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpeedReadingInterval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { - properties._startPolylinePointIndex = 1; - if (!$util.isInteger(message.startPolylinePointIndex)) - return "startPolylinePointIndex: integer expected"; - } - if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { - properties._endPolylinePointIndex = 1; - if (!$util.isInteger(message.endPolylinePointIndex)) - return "endPolylinePointIndex: integer expected"; - } - if (message.speed != null && message.hasOwnProperty("speed")) { - properties.speedType = 1; - switch (message.speed) { - default: - return "speed: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval - */ - SpeedReadingInterval.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.SpeedReadingInterval) - return object; - var message = new $root.google.maps.routing.v2.SpeedReadingInterval(); - if (object.startPolylinePointIndex != null) - message.startPolylinePointIndex = object.startPolylinePointIndex | 0; - if (object.endPolylinePointIndex != null) - message.endPolylinePointIndex = object.endPolylinePointIndex | 0; - switch (object.speed) { - default: - if (typeof object.speed === "number") { - message.speed = object.speed; - break; - } - break; - case "SPEED_UNSPECIFIED": - case 0: - message.speed = 0; - break; - case "NORMAL": - case 1: - message.speed = 1; - break; - case "SLOW": - case 2: - message.speed = 2; - break; - case "TRAFFIC_JAM": - case 3: - message.speed = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {google.maps.routing.v2.SpeedReadingInterval} message SpeedReadingInterval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpeedReadingInterval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { - object.startPolylinePointIndex = message.startPolylinePointIndex; - if (options.oneofs) - object._startPolylinePointIndex = "startPolylinePointIndex"; - } - if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { - object.endPolylinePointIndex = message.endPolylinePointIndex; - if (options.oneofs) - object._endPolylinePointIndex = "endPolylinePointIndex"; - } - if (message.speed != null && message.hasOwnProperty("speed")) { - object.speed = options.enums === String ? $root.google.maps.routing.v2.SpeedReadingInterval.Speed[message.speed] === undefined ? message.speed : $root.google.maps.routing.v2.SpeedReadingInterval.Speed[message.speed] : message.speed; - if (options.oneofs) - object.speedType = "speed"; - } - return object; - }; - - /** - * Converts this SpeedReadingInterval to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @instance - * @returns {Object.} JSON object - */ - SpeedReadingInterval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpeedReadingInterval - * @function getTypeUrl - * @memberof google.maps.routing.v2.SpeedReadingInterval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpeedReadingInterval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.SpeedReadingInterval"; - }; - - /** - * Speed enum. - * @name google.maps.routing.v2.SpeedReadingInterval.Speed - * @enum {number} - * @property {number} SPEED_UNSPECIFIED=0 SPEED_UNSPECIFIED value - * @property {number} NORMAL=1 NORMAL value - * @property {number} SLOW=2 SLOW value - * @property {number} TRAFFIC_JAM=3 TRAFFIC_JAM value - */ - SpeedReadingInterval.Speed = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPEED_UNSPECIFIED"] = 0; - values[valuesById[1] = "NORMAL"] = 1; - values[valuesById[2] = "SLOW"] = 2; - values[valuesById[3] = "TRAFFIC_JAM"] = 3; - return values; - })(); - - return SpeedReadingInterval; - })(); - - v2.TollInfo = (function() { - - /** - * Properties of a TollInfo. - * @memberof google.maps.routing.v2 - * @interface ITollInfo - * @property {Array.|null} [estimatedPrice] TollInfo estimatedPrice - */ - - /** - * Constructs a new TollInfo. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TollInfo. - * @implements ITollInfo - * @constructor - * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set - */ - function TollInfo(properties) { - this.estimatedPrice = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TollInfo estimatedPrice. - * @member {Array.} estimatedPrice - * @memberof google.maps.routing.v2.TollInfo - * @instance - */ - TollInfo.prototype.estimatedPrice = $util.emptyArray; - - /** - * Creates a new TollInfo instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set - * @returns {google.maps.routing.v2.TollInfo} TollInfo instance - */ - TollInfo.create = function create(properties) { - return new TollInfo(properties); - }; - - /** - * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TollInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.estimatedPrice != null && message.estimatedPrice.length) - for (var i = 0; i < message.estimatedPrice.length; ++i) - $root.google.type.Money.encode(message.estimatedPrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TollInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TollInfo message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TollInfo} TollInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TollInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TollInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.estimatedPrice && message.estimatedPrice.length)) - message.estimatedPrice = []; - message.estimatedPrice.push($root.google.type.Money.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TollInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TollInfo} TollInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TollInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TollInfo message. - * @function verify - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TollInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.estimatedPrice != null && message.hasOwnProperty("estimatedPrice")) { - if (!Array.isArray(message.estimatedPrice)) - return "estimatedPrice: array expected"; - for (var i = 0; i < message.estimatedPrice.length; ++i) { - var error = $root.google.type.Money.verify(message.estimatedPrice[i]); - if (error) - return "estimatedPrice." + error; - } - } - return null; - }; - - /** - * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TollInfo} TollInfo - */ - TollInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TollInfo) - return object; - var message = new $root.google.maps.routing.v2.TollInfo(); - if (object.estimatedPrice) { - if (!Array.isArray(object.estimatedPrice)) - throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: array expected"); - message.estimatedPrice = []; - for (var i = 0; i < object.estimatedPrice.length; ++i) { - if (typeof object.estimatedPrice[i] !== "object") - throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: object expected"); - message.estimatedPrice[i] = $root.google.type.Money.fromObject(object.estimatedPrice[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TollInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {google.maps.routing.v2.TollInfo} message TollInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TollInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.estimatedPrice = []; - if (message.estimatedPrice && message.estimatedPrice.length) { - object.estimatedPrice = []; - for (var j = 0; j < message.estimatedPrice.length; ++j) - object.estimatedPrice[j] = $root.google.type.Money.toObject(message.estimatedPrice[j], options); - } - return object; - }; - - /** - * Converts this TollInfo to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TollInfo - * @instance - * @returns {Object.} JSON object - */ - TollInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TollInfo - * @function getTypeUrl - * @memberof google.maps.routing.v2.TollInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TollInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TollInfo"; - }; - - return TollInfo; - })(); - - v2.TransitAgency = (function() { - - /** - * Properties of a TransitAgency. - * @memberof google.maps.routing.v2 - * @interface ITransitAgency - * @property {string|null} [name] TransitAgency name - * @property {string|null} [phoneNumber] TransitAgency phoneNumber - * @property {string|null} [uri] TransitAgency uri - */ - - /** - * Constructs a new TransitAgency. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TransitAgency. - * @implements ITransitAgency - * @constructor - * @param {google.maps.routing.v2.ITransitAgency=} [properties] Properties to set - */ - function TransitAgency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitAgency name. - * @member {string} name - * @memberof google.maps.routing.v2.TransitAgency - * @instance - */ - TransitAgency.prototype.name = ""; - - /** - * TransitAgency phoneNumber. - * @member {string} phoneNumber - * @memberof google.maps.routing.v2.TransitAgency - * @instance - */ - TransitAgency.prototype.phoneNumber = ""; - - /** - * TransitAgency uri. - * @member {string} uri - * @memberof google.maps.routing.v2.TransitAgency - * @instance - */ - TransitAgency.prototype.uri = ""; - - /** - * Creates a new TransitAgency instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {google.maps.routing.v2.ITransitAgency=} [properties] Properties to set - * @returns {google.maps.routing.v2.TransitAgency} TransitAgency instance - */ - TransitAgency.create = function create(properties) { - return new TransitAgency(properties); - }; - - /** - * Encodes the specified TransitAgency message. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {google.maps.routing.v2.ITransitAgency} message TransitAgency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitAgency.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.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); - return writer; - }; - - /** - * Encodes the specified TransitAgency message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitAgency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {google.maps.routing.v2.ITransitAgency} message TransitAgency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitAgency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitAgency message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TransitAgency} TransitAgency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitAgency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitAgency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.phoneNumber = reader.string(); - break; - } - case 3: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitAgency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TransitAgency} TransitAgency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitAgency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitAgency message. - * @function verify - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitAgency.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.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a TransitAgency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TransitAgency} TransitAgency - */ - TransitAgency.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TransitAgency) - return object; - var message = new $root.google.maps.routing.v2.TransitAgency(); - if (object.name != null) - message.name = String(object.name); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a TransitAgency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {google.maps.routing.v2.TransitAgency} message TransitAgency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitAgency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.phoneNumber = ""; - object.uri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this TransitAgency to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TransitAgency - * @instance - * @returns {Object.} JSON object - */ - TransitAgency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitAgency - * @function getTypeUrl - * @memberof google.maps.routing.v2.TransitAgency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitAgency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TransitAgency"; - }; - - return TransitAgency; - })(); - - v2.TransitLine = (function() { - - /** - * Properties of a TransitLine. - * @memberof google.maps.routing.v2 - * @interface ITransitLine - * @property {Array.|null} [agencies] TransitLine agencies - * @property {string|null} [name] TransitLine name - * @property {string|null} [uri] TransitLine uri - * @property {string|null} [color] TransitLine color - * @property {string|null} [iconUri] TransitLine iconUri - * @property {string|null} [nameShort] TransitLine nameShort - * @property {string|null} [textColor] TransitLine textColor - * @property {google.maps.routing.v2.ITransitVehicle|null} [vehicle] TransitLine vehicle - */ - - /** - * Constructs a new TransitLine. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TransitLine. - * @implements ITransitLine - * @constructor - * @param {google.maps.routing.v2.ITransitLine=} [properties] Properties to set - */ - function TransitLine(properties) { - this.agencies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitLine agencies. - * @member {Array.} agencies - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.agencies = $util.emptyArray; - - /** - * TransitLine name. - * @member {string} name - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.name = ""; - - /** - * TransitLine uri. - * @member {string} uri - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.uri = ""; - - /** - * TransitLine color. - * @member {string} color - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.color = ""; - - /** - * TransitLine iconUri. - * @member {string} iconUri - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.iconUri = ""; - - /** - * TransitLine nameShort. - * @member {string} nameShort - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.nameShort = ""; - - /** - * TransitLine textColor. - * @member {string} textColor - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.textColor = ""; - - /** - * TransitLine vehicle. - * @member {google.maps.routing.v2.ITransitVehicle|null|undefined} vehicle - * @memberof google.maps.routing.v2.TransitLine - * @instance - */ - TransitLine.prototype.vehicle = null; - - /** - * Creates a new TransitLine instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {google.maps.routing.v2.ITransitLine=} [properties] Properties to set - * @returns {google.maps.routing.v2.TransitLine} TransitLine instance - */ - TransitLine.create = function create(properties) { - return new TransitLine(properties); - }; - - /** - * Encodes the specified TransitLine message. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {google.maps.routing.v2.ITransitLine} message TransitLine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitLine.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agencies != null && message.agencies.length) - for (var i = 0; i < message.agencies.length; ++i) - $root.google.maps.routing.v2.TransitAgency.encode(message.agencies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); - if (message.color != null && Object.hasOwnProperty.call(message, "color")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.color); - if (message.iconUri != null && Object.hasOwnProperty.call(message, "iconUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.iconUri); - if (message.nameShort != null && Object.hasOwnProperty.call(message, "nameShort")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.nameShort); - if (message.textColor != null && Object.hasOwnProperty.call(message, "textColor")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.textColor); - if (message.vehicle != null && Object.hasOwnProperty.call(message, "vehicle")) - $root.google.maps.routing.v2.TransitVehicle.encode(message.vehicle, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitLine message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitLine.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {google.maps.routing.v2.ITransitLine} message TransitLine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitLine.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitLine message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TransitLine} TransitLine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitLine.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitLine(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.agencies && message.agencies.length)) - message.agencies = []; - message.agencies.push($root.google.maps.routing.v2.TransitAgency.decode(reader, reader.uint32())); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.uri = reader.string(); - break; - } - case 4: { - message.color = reader.string(); - break; - } - case 5: { - message.iconUri = reader.string(); - break; - } - case 6: { - message.nameShort = reader.string(); - break; - } - case 7: { - message.textColor = reader.string(); - break; - } - case 8: { - message.vehicle = $root.google.maps.routing.v2.TransitVehicle.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitLine message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TransitLine} TransitLine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitLine.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitLine message. - * @function verify - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitLine.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agencies != null && message.hasOwnProperty("agencies")) { - if (!Array.isArray(message.agencies)) - return "agencies: array expected"; - for (var i = 0; i < message.agencies.length; ++i) { - var error = $root.google.maps.routing.v2.TransitAgency.verify(message.agencies[i]); - if (error) - return "agencies." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.color != null && message.hasOwnProperty("color")) - if (!$util.isString(message.color)) - return "color: string expected"; - if (message.iconUri != null && message.hasOwnProperty("iconUri")) - if (!$util.isString(message.iconUri)) - return "iconUri: string expected"; - if (message.nameShort != null && message.hasOwnProperty("nameShort")) - if (!$util.isString(message.nameShort)) - return "nameShort: string expected"; - if (message.textColor != null && message.hasOwnProperty("textColor")) - if (!$util.isString(message.textColor)) - return "textColor: string expected"; - if (message.vehicle != null && message.hasOwnProperty("vehicle")) { - var error = $root.google.maps.routing.v2.TransitVehicle.verify(message.vehicle); - if (error) - return "vehicle." + error; - } - return null; - }; - - /** - * Creates a TransitLine message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TransitLine} TransitLine - */ - TransitLine.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TransitLine) - return object; - var message = new $root.google.maps.routing.v2.TransitLine(); - if (object.agencies) { - if (!Array.isArray(object.agencies)) - throw TypeError(".google.maps.routing.v2.TransitLine.agencies: array expected"); - message.agencies = []; - for (var i = 0; i < object.agencies.length; ++i) { - if (typeof object.agencies[i] !== "object") - throw TypeError(".google.maps.routing.v2.TransitLine.agencies: object expected"); - message.agencies[i] = $root.google.maps.routing.v2.TransitAgency.fromObject(object.agencies[i]); - } - } - if (object.name != null) - message.name = String(object.name); - if (object.uri != null) - message.uri = String(object.uri); - if (object.color != null) - message.color = String(object.color); - if (object.iconUri != null) - message.iconUri = String(object.iconUri); - if (object.nameShort != null) - message.nameShort = String(object.nameShort); - if (object.textColor != null) - message.textColor = String(object.textColor); - if (object.vehicle != null) { - if (typeof object.vehicle !== "object") - throw TypeError(".google.maps.routing.v2.TransitLine.vehicle: object expected"); - message.vehicle = $root.google.maps.routing.v2.TransitVehicle.fromObject(object.vehicle); - } - return message; - }; - - /** - * Creates a plain object from a TransitLine message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {google.maps.routing.v2.TransitLine} message TransitLine - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitLine.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.agencies = []; - if (options.defaults) { - object.name = ""; - object.uri = ""; - object.color = ""; - object.iconUri = ""; - object.nameShort = ""; - object.textColor = ""; - object.vehicle = null; - } - if (message.agencies && message.agencies.length) { - object.agencies = []; - for (var j = 0; j < message.agencies.length; ++j) - object.agencies[j] = $root.google.maps.routing.v2.TransitAgency.toObject(message.agencies[j], options); - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.color != null && message.hasOwnProperty("color")) - object.color = message.color; - if (message.iconUri != null && message.hasOwnProperty("iconUri")) - object.iconUri = message.iconUri; - if (message.nameShort != null && message.hasOwnProperty("nameShort")) - object.nameShort = message.nameShort; - if (message.textColor != null && message.hasOwnProperty("textColor")) - object.textColor = message.textColor; - if (message.vehicle != null && message.hasOwnProperty("vehicle")) - object.vehicle = $root.google.maps.routing.v2.TransitVehicle.toObject(message.vehicle, options); - return object; - }; - - /** - * Converts this TransitLine to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TransitLine - * @instance - * @returns {Object.} JSON object - */ - TransitLine.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitLine - * @function getTypeUrl - * @memberof google.maps.routing.v2.TransitLine - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitLine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TransitLine"; - }; - - return TransitLine; - })(); - - v2.TransitStop = (function() { - - /** - * Properties of a TransitStop. - * @memberof google.maps.routing.v2 - * @interface ITransitStop - * @property {string|null} [name] TransitStop name - * @property {google.maps.routing.v2.ILocation|null} [location] TransitStop location - */ - - /** - * Constructs a new TransitStop. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TransitStop. - * @implements ITransitStop - * @constructor - * @param {google.maps.routing.v2.ITransitStop=} [properties] Properties to set - */ - function TransitStop(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitStop name. - * @member {string} name - * @memberof google.maps.routing.v2.TransitStop - * @instance - */ - TransitStop.prototype.name = ""; - - /** - * TransitStop location. - * @member {google.maps.routing.v2.ILocation|null|undefined} location - * @memberof google.maps.routing.v2.TransitStop - * @instance - */ - TransitStop.prototype.location = null; - - /** - * Creates a new TransitStop instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {google.maps.routing.v2.ITransitStop=} [properties] Properties to set - * @returns {google.maps.routing.v2.TransitStop} TransitStop instance - */ - TransitStop.create = function create(properties) { - return new TransitStop(properties); - }; - - /** - * Encodes the specified TransitStop message. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {google.maps.routing.v2.ITransitStop} message TransitStop message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitStop.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.google.maps.routing.v2.Location.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitStop message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitStop.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {google.maps.routing.v2.ITransitStop} message TransitStop message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitStop.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitStop message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TransitStop} TransitStop - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitStop.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitStop(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.location = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitStop message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TransitStop} TransitStop - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitStop.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitStop message. - * @function verify - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitStop.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.location != null && message.hasOwnProperty("location")) { - var error = $root.google.maps.routing.v2.Location.verify(message.location); - if (error) - return "location." + error; - } - return null; - }; - - /** - * Creates a TransitStop message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TransitStop} TransitStop - */ - TransitStop.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TransitStop) - return object; - var message = new $root.google.maps.routing.v2.TransitStop(); - if (object.name != null) - message.name = String(object.name); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.maps.routing.v2.TransitStop.location: object expected"); - message.location = $root.google.maps.routing.v2.Location.fromObject(object.location); - } - return message; - }; - - /** - * Creates a plain object from a TransitStop message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {google.maps.routing.v2.TransitStop} message TransitStop - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitStop.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.location = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.location != null && message.hasOwnProperty("location")) - object.location = $root.google.maps.routing.v2.Location.toObject(message.location, options); - return object; - }; - - /** - * Converts this TransitStop to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TransitStop - * @instance - * @returns {Object.} JSON object - */ - TransitStop.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitStop - * @function getTypeUrl - * @memberof google.maps.routing.v2.TransitStop - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitStop.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TransitStop"; - }; - - return TransitStop; - })(); - - v2.TransitVehicle = (function() { - - /** - * Properties of a TransitVehicle. - * @memberof google.maps.routing.v2 - * @interface ITransitVehicle - * @property {google.type.ILocalizedText|null} [name] TransitVehicle name - * @property {google.maps.routing.v2.TransitVehicle.TransitVehicleType|null} [type] TransitVehicle type - * @property {string|null} [iconUri] TransitVehicle iconUri - * @property {string|null} [localIconUri] TransitVehicle localIconUri - */ - - /** - * Constructs a new TransitVehicle. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TransitVehicle. - * @implements ITransitVehicle - * @constructor - * @param {google.maps.routing.v2.ITransitVehicle=} [properties] Properties to set - */ - function TransitVehicle(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitVehicle name. - * @member {google.type.ILocalizedText|null|undefined} name - * @memberof google.maps.routing.v2.TransitVehicle - * @instance - */ - TransitVehicle.prototype.name = null; - - /** - * TransitVehicle type. - * @member {google.maps.routing.v2.TransitVehicle.TransitVehicleType} type - * @memberof google.maps.routing.v2.TransitVehicle - * @instance - */ - TransitVehicle.prototype.type = 0; - - /** - * TransitVehicle iconUri. - * @member {string} iconUri - * @memberof google.maps.routing.v2.TransitVehicle - * @instance - */ - TransitVehicle.prototype.iconUri = ""; - - /** - * TransitVehicle localIconUri. - * @member {string} localIconUri - * @memberof google.maps.routing.v2.TransitVehicle - * @instance - */ - TransitVehicle.prototype.localIconUri = ""; - - /** - * Creates a new TransitVehicle instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {google.maps.routing.v2.ITransitVehicle=} [properties] Properties to set - * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle instance - */ - TransitVehicle.create = function create(properties) { - return new TransitVehicle(properties); - }; - - /** - * Encodes the specified TransitVehicle message. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {google.maps.routing.v2.ITransitVehicle} message TransitVehicle message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitVehicle.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - $root.google.type.LocalizedText.encode(message.name, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.iconUri != null && Object.hasOwnProperty.call(message, "iconUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.iconUri); - if (message.localIconUri != null && Object.hasOwnProperty.call(message, "localIconUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.localIconUri); - return writer; - }; - - /** - * Encodes the specified TransitVehicle message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitVehicle.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {google.maps.routing.v2.ITransitVehicle} message TransitVehicle message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitVehicle.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitVehicle message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitVehicle.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitVehicle(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.iconUri = reader.string(); - break; - } - case 4: { - message.localIconUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitVehicle message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitVehicle.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitVehicle message. - * @function verify - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitVehicle.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - var error = $root.google.type.LocalizedText.verify(message.name); - if (error) - return "name." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - 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.iconUri != null && message.hasOwnProperty("iconUri")) - if (!$util.isString(message.iconUri)) - return "iconUri: string expected"; - if (message.localIconUri != null && message.hasOwnProperty("localIconUri")) - if (!$util.isString(message.localIconUri)) - return "localIconUri: string expected"; - return null; - }; - - /** - * Creates a TransitVehicle message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TransitVehicle} TransitVehicle - */ - TransitVehicle.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TransitVehicle) - return object; - var message = new $root.google.maps.routing.v2.TransitVehicle(); - if (object.name != null) { - if (typeof object.name !== "object") - throw TypeError(".google.maps.routing.v2.TransitVehicle.name: object expected"); - message.name = $root.google.type.LocalizedText.fromObject(object.name); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TRANSIT_VEHICLE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "BUS": - case 1: - message.type = 1; - break; - case "CABLE_CAR": - case 2: - message.type = 2; - break; - case "COMMUTER_TRAIN": - case 3: - message.type = 3; - break; - case "FERRY": - case 4: - message.type = 4; - break; - case "FUNICULAR": - case 5: - message.type = 5; - break; - case "GONDOLA_LIFT": - case 6: - message.type = 6; - break; - case "HEAVY_RAIL": - case 7: - message.type = 7; - break; - case "HIGH_SPEED_TRAIN": - case 8: - message.type = 8; - break; - case "INTERCITY_BUS": - case 9: - message.type = 9; - break; - case "LONG_DISTANCE_TRAIN": - case 10: - message.type = 10; - break; - case "METRO_RAIL": - case 11: - message.type = 11; - break; - case "MONORAIL": - case 12: - message.type = 12; - break; - case "OTHER": - case 13: - message.type = 13; - break; - case "RAIL": - case 14: - message.type = 14; - break; - case "SHARE_TAXI": - case 15: - message.type = 15; - break; - case "SUBWAY": - case 16: - message.type = 16; - break; - case "TRAM": - case 17: - message.type = 17; - break; - case "TROLLEYBUS": - case 18: - message.type = 18; - break; - } - if (object.iconUri != null) - message.iconUri = String(object.iconUri); - if (object.localIconUri != null) - message.localIconUri = String(object.localIconUri); - return message; - }; - - /** - * Creates a plain object from a TransitVehicle message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {google.maps.routing.v2.TransitVehicle} message TransitVehicle - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitVehicle.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = null; - object.type = options.enums === String ? "TRANSIT_VEHICLE_TYPE_UNSPECIFIED" : 0; - object.iconUri = ""; - object.localIconUri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = $root.google.type.LocalizedText.toObject(message.name, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.maps.routing.v2.TransitVehicle.TransitVehicleType[message.type] === undefined ? message.type : $root.google.maps.routing.v2.TransitVehicle.TransitVehicleType[message.type] : message.type; - if (message.iconUri != null && message.hasOwnProperty("iconUri")) - object.iconUri = message.iconUri; - if (message.localIconUri != null && message.hasOwnProperty("localIconUri")) - object.localIconUri = message.localIconUri; - return object; - }; - - /** - * Converts this TransitVehicle to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TransitVehicle - * @instance - * @returns {Object.} JSON object - */ - TransitVehicle.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitVehicle - * @function getTypeUrl - * @memberof google.maps.routing.v2.TransitVehicle - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitVehicle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TransitVehicle"; - }; - - /** - * TransitVehicleType enum. - * @name google.maps.routing.v2.TransitVehicle.TransitVehicleType - * @enum {number} - * @property {number} TRANSIT_VEHICLE_TYPE_UNSPECIFIED=0 TRANSIT_VEHICLE_TYPE_UNSPECIFIED value - * @property {number} BUS=1 BUS value - * @property {number} CABLE_CAR=2 CABLE_CAR value - * @property {number} COMMUTER_TRAIN=3 COMMUTER_TRAIN value - * @property {number} FERRY=4 FERRY value - * @property {number} FUNICULAR=5 FUNICULAR value - * @property {number} GONDOLA_LIFT=6 GONDOLA_LIFT value - * @property {number} HEAVY_RAIL=7 HEAVY_RAIL value - * @property {number} HIGH_SPEED_TRAIN=8 HIGH_SPEED_TRAIN value - * @property {number} INTERCITY_BUS=9 INTERCITY_BUS value - * @property {number} LONG_DISTANCE_TRAIN=10 LONG_DISTANCE_TRAIN value - * @property {number} METRO_RAIL=11 METRO_RAIL value - * @property {number} MONORAIL=12 MONORAIL value - * @property {number} OTHER=13 OTHER value - * @property {number} RAIL=14 RAIL value - * @property {number} SHARE_TAXI=15 SHARE_TAXI value - * @property {number} SUBWAY=16 SUBWAY value - * @property {number} TRAM=17 TRAM value - * @property {number} TROLLEYBUS=18 TROLLEYBUS value - */ - TransitVehicle.TransitVehicleType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRANSIT_VEHICLE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BUS"] = 1; - values[valuesById[2] = "CABLE_CAR"] = 2; - values[valuesById[3] = "COMMUTER_TRAIN"] = 3; - values[valuesById[4] = "FERRY"] = 4; - values[valuesById[5] = "FUNICULAR"] = 5; - values[valuesById[6] = "GONDOLA_LIFT"] = 6; - values[valuesById[7] = "HEAVY_RAIL"] = 7; - values[valuesById[8] = "HIGH_SPEED_TRAIN"] = 8; - values[valuesById[9] = "INTERCITY_BUS"] = 9; - values[valuesById[10] = "LONG_DISTANCE_TRAIN"] = 10; - values[valuesById[11] = "METRO_RAIL"] = 11; - values[valuesById[12] = "MONORAIL"] = 12; - values[valuesById[13] = "OTHER"] = 13; - values[valuesById[14] = "RAIL"] = 14; - values[valuesById[15] = "SHARE_TAXI"] = 15; - values[valuesById[16] = "SUBWAY"] = 16; - values[valuesById[17] = "TRAM"] = 17; - values[valuesById[18] = "TROLLEYBUS"] = 18; - return values; - })(); - - return TransitVehicle; - })(); - - v2.RouteModifiers = (function() { - - /** - * Properties of a RouteModifiers. - * @memberof google.maps.routing.v2 - * @interface IRouteModifiers - * @property {boolean|null} [avoidTolls] RouteModifiers avoidTolls - * @property {boolean|null} [avoidHighways] RouteModifiers avoidHighways - * @property {boolean|null} [avoidFerries] RouteModifiers avoidFerries - * @property {boolean|null} [avoidIndoor] RouteModifiers avoidIndoor - * @property {google.maps.routing.v2.IVehicleInfo|null} [vehicleInfo] RouteModifiers vehicleInfo - * @property {Array.|null} [tollPasses] RouteModifiers tollPasses - */ - - /** - * Constructs a new RouteModifiers. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteModifiers. - * @implements IRouteModifiers - * @constructor - * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set - */ - function RouteModifiers(properties) { - this.tollPasses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteModifiers avoidTolls. - * @member {boolean} avoidTolls - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.avoidTolls = false; - - /** - * RouteModifiers avoidHighways. - * @member {boolean} avoidHighways - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.avoidHighways = false; - - /** - * RouteModifiers avoidFerries. - * @member {boolean} avoidFerries - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.avoidFerries = false; - - /** - * RouteModifiers avoidIndoor. - * @member {boolean} avoidIndoor - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.avoidIndoor = false; - - /** - * RouteModifiers vehicleInfo. - * @member {google.maps.routing.v2.IVehicleInfo|null|undefined} vehicleInfo - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.vehicleInfo = null; - - /** - * RouteModifiers tollPasses. - * @member {Array.} tollPasses - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - */ - RouteModifiers.prototype.tollPasses = $util.emptyArray; - - /** - * Creates a new RouteModifiers instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers instance - */ - RouteModifiers.create = function create(properties) { - return new RouteModifiers(properties); - }; - - /** - * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteModifiers.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.avoidTolls != null && Object.hasOwnProperty.call(message, "avoidTolls")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.avoidTolls); - if (message.avoidHighways != null && Object.hasOwnProperty.call(message, "avoidHighways")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.avoidHighways); - if (message.avoidFerries != null && Object.hasOwnProperty.call(message, "avoidFerries")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.avoidFerries); - if (message.avoidIndoor != null && Object.hasOwnProperty.call(message, "avoidIndoor")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.avoidIndoor); - if (message.vehicleInfo != null && Object.hasOwnProperty.call(message, "vehicleInfo")) - $root.google.maps.routing.v2.VehicleInfo.encode(message.vehicleInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.tollPasses != null && message.tollPasses.length) { - writer.uint32(/* id 6, wireType 2 =*/50).fork(); - for (var i = 0; i < message.tollPasses.length; ++i) - writer.int32(message.tollPasses[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteModifiers.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteModifiers message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteModifiers.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteModifiers(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.avoidTolls = reader.bool(); - break; - } - case 2: { - message.avoidHighways = reader.bool(); - break; - } - case 3: { - message.avoidFerries = reader.bool(); - break; - } - case 4: { - message.avoidIndoor = reader.bool(); - break; - } - case 5: { - message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.tollPasses && message.tollPasses.length)) - message.tollPasses = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.tollPasses.push(reader.int32()); - } else - message.tollPasses.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteModifiers.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteModifiers message. - * @function verify - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteModifiers.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) - if (typeof message.avoidTolls !== "boolean") - return "avoidTolls: boolean expected"; - if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) - if (typeof message.avoidHighways !== "boolean") - return "avoidHighways: boolean expected"; - if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) - if (typeof message.avoidFerries !== "boolean") - return "avoidFerries: boolean expected"; - if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) - if (typeof message.avoidIndoor !== "boolean") - return "avoidIndoor: boolean expected"; - if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) { - var error = $root.google.maps.routing.v2.VehicleInfo.verify(message.vehicleInfo); - if (error) - return "vehicleInfo." + error; - } - if (message.tollPasses != null && message.hasOwnProperty("tollPasses")) { - if (!Array.isArray(message.tollPasses)) - return "tollPasses: array expected"; - for (var i = 0; i < message.tollPasses.length; ++i) - switch (message.tollPasses[i]) { - default: - return "tollPasses: enum value[] expected"; - case 0: - case 82: - case 83: - case 2: - case 3: - case 81: - case 7: - case 8: - case 88: - case 9: - case 10: - case 11: - case 84: - case 85: - case 18: - case 19: - case 20: - case 16: - case 78: - case 79: - case 98: - case 99: - case 90: - case 91: - case 93: - case 89: - case 12: - case 13: - case 92: - case 14: - case 21: - case 22: - case 4: - case 86: - case 23: - case 24: - case 25: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 73: - case 72: - case 26: - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 6: - case 34: - case 35: - case 36: - case 94: - case 37: - case 38: - case 95: - case 39: - case 40: - case 41: - case 42: - case 87: - case 43: - case 80: - case 75: - case 74: - case 76: - case 77: - case 44: - case 45: - case 46: - case 47: - case 97: - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 96: - case 55: - case 56: - case 57: - case 58: - case 59: - case 60: - case 61: - case 17: - case 1: - case 62: - case 63: - case 100: - case 64: - break; - } - } - return null; - }; - - /** - * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers - */ - RouteModifiers.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteModifiers) - return object; - var message = new $root.google.maps.routing.v2.RouteModifiers(); - if (object.avoidTolls != null) - message.avoidTolls = Boolean(object.avoidTolls); - if (object.avoidHighways != null) - message.avoidHighways = Boolean(object.avoidHighways); - if (object.avoidFerries != null) - message.avoidFerries = Boolean(object.avoidFerries); - if (object.avoidIndoor != null) - message.avoidIndoor = Boolean(object.avoidIndoor); - if (object.vehicleInfo != null) { - if (typeof object.vehicleInfo !== "object") - throw TypeError(".google.maps.routing.v2.RouteModifiers.vehicleInfo: object expected"); - message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.fromObject(object.vehicleInfo); - } - if (object.tollPasses) { - if (!Array.isArray(object.tollPasses)) - throw TypeError(".google.maps.routing.v2.RouteModifiers.tollPasses: array expected"); - message.tollPasses = []; - for (var i = 0; i < object.tollPasses.length; ++i) - switch (object.tollPasses[i]) { - default: - if (typeof object.tollPasses[i] === "number") { - message.tollPasses[i] = object.tollPasses[i]; - break; - } - case "TOLL_PASS_UNSPECIFIED": - case 0: - message.tollPasses[i] = 0; - break; - case "AU_ETOLL_TAG": - case 82: - message.tollPasses[i] = 82; - break; - case "AU_EWAY_TAG": - case 83: - message.tollPasses[i] = 83; - break; - case "AU_LINKT": - case 2: - message.tollPasses[i] = 2; - break; - case "AR_TELEPASE": - case 3: - message.tollPasses[i] = 3; - break; - case "BR_AUTO_EXPRESO": - case 81: - message.tollPasses[i] = 81; - break; - case "BR_CONECTCAR": - case 7: - message.tollPasses[i] = 7; - break; - case "BR_MOVE_MAIS": - case 8: - message.tollPasses[i] = 8; - break; - case "BR_PASSA_RAPIDO": - case 88: - message.tollPasses[i] = 88; - break; - case "BR_SEM_PARAR": - case 9: - message.tollPasses[i] = 9; - break; - case "BR_TAGGY": - case 10: - message.tollPasses[i] = 10; - break; - case "BR_VELOE": - case 11: - message.tollPasses[i] = 11; - break; - case "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": - case 84: - message.tollPasses[i] = 84; - break; - case "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": - case 85: - message.tollPasses[i] = 85; - break; - case "CA_US_BLUE_WATER_EDGE_PASS": - case 18: - message.tollPasses[i] = 18; - break; - case "CA_US_CONNEXION": - case 19: - message.tollPasses[i] = 19; - break; - case "CA_US_NEXUS_CARD": - case 20: - message.tollPasses[i] = 20; - break; - case "ID_E_TOLL": - case 16: - message.tollPasses[i] = 16; - break; - case "IN_FASTAG": - case 78: - message.tollPasses[i] = 78; - break; - case "IN_LOCAL_HP_PLATE_EXEMPT": - case 79: - message.tollPasses[i] = 79; - break; - case "JP_ETC": - case 98: - message.tollPasses[i] = 98; - break; - case "JP_ETC2": - case 99: - message.tollPasses[i] = 99; - break; - case "MX_IAVE": - case 90: - message.tollPasses[i] = 90; - break; - case "MX_PASE": - case 91: - message.tollPasses[i] = 91; - break; - case "MX_QUICKPASS": - case 93: - message.tollPasses[i] = 93; - break; - case "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": - case 89: - message.tollPasses[i] = 89; - break; - case "MX_TAG_IAVE": - case 12: - message.tollPasses[i] = 12; - break; - case "MX_TAG_TELEVIA": - case 13: - message.tollPasses[i] = 13; - break; - case "MX_TELEVIA": - case 92: - message.tollPasses[i] = 92; - break; - case "MX_VIAPASS": - case 14: - message.tollPasses[i] = 14; - break; - case "US_AL_FREEDOM_PASS": - case 21: - message.tollPasses[i] = 21; - break; - case "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": - case 22: - message.tollPasses[i] = 22; - break; - case "US_CA_FASTRAK": - case 4: - message.tollPasses[i] = 4; - break; - case "US_CA_FASTRAK_CAV_STICKER": - case 86: - message.tollPasses[i] = 86; - break; - case "US_CO_EXPRESSTOLL": - case 23: - message.tollPasses[i] = 23; - break; - case "US_CO_GO_PASS": - case 24: - message.tollPasses[i] = 24; - break; - case "US_DE_EZPASSDE": - case 25: - message.tollPasses[i] = 25; - break; - case "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": - case 65: - message.tollPasses[i] = 65; - break; - case "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": - case 66: - message.tollPasses[i] = 66; - break; - case "US_FL_EPASS": - case 67: - message.tollPasses[i] = 67; - break; - case "US_FL_GIBA_TOLL_PASS": - case 68: - message.tollPasses[i] = 68; - break; - case "US_FL_LEEWAY": - case 69: - message.tollPasses[i] = 69; - break; - case "US_FL_SUNPASS": - case 70: - message.tollPasses[i] = 70; - break; - case "US_FL_SUNPASS_PRO": - case 71: - message.tollPasses[i] = 71; - break; - case "US_IL_EZPASSIL": - case 73: - message.tollPasses[i] = 73; - break; - case "US_IL_IPASS": - case 72: - message.tollPasses[i] = 72; - break; - case "US_IN_EZPASSIN": - case 26: - message.tollPasses[i] = 26; - break; - case "US_KS_BESTPASS_HORIZON": - case 27: - message.tollPasses[i] = 27; - break; - case "US_KS_KTAG": - case 28: - message.tollPasses[i] = 28; - break; - case "US_KS_NATIONALPASS": - case 29: - message.tollPasses[i] = 29; - break; - case "US_KS_PREPASS_ELITEPASS": - case 30: - message.tollPasses[i] = 30; - break; - case "US_KY_RIVERLINK": - case 31: - message.tollPasses[i] = 31; - break; - case "US_LA_GEAUXPASS": - case 32: - message.tollPasses[i] = 32; - break; - case "US_LA_TOLL_TAG": - case 33: - message.tollPasses[i] = 33; - break; - case "US_MA_EZPASSMA": - case 6: - message.tollPasses[i] = 6; - break; - case "US_MD_EZPASSMD": - case 34: - message.tollPasses[i] = 34; - break; - case "US_ME_EZPASSME": - case 35: - message.tollPasses[i] = 35; - break; - case "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": - case 36: - message.tollPasses[i] = 36; - break; - case "US_MI_BCPASS": - case 94: - message.tollPasses[i] = 94; - break; - case "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": - case 37: - message.tollPasses[i] = 37; - break; - case "US_MI_IQ_PROX_CARD": - case 38: - message.tollPasses[i] = 38; - break; - case "US_MI_IQ_TAG": - case 95: - message.tollPasses[i] = 95; - break; - case "US_MI_MACKINAC_BRIDGE_MAC_PASS": - case 39: - message.tollPasses[i] = 39; - break; - case "US_MI_NEXPRESS_TOLL": - case 40: - message.tollPasses[i] = 40; - break; - case "US_MN_EZPASSMN": - case 41: - message.tollPasses[i] = 41; - break; - case "US_NC_EZPASSNC": - case 42: - message.tollPasses[i] = 42; - break; - case "US_NC_PEACH_PASS": - case 87: - message.tollPasses[i] = 87; - break; - case "US_NC_QUICK_PASS": - case 43: - message.tollPasses[i] = 43; - break; - case "US_NH_EZPASSNH": - case 80: - message.tollPasses[i] = 80; - break; - case "US_NJ_DOWNBEACH_EXPRESS_PASS": - case 75: - message.tollPasses[i] = 75; - break; - case "US_NJ_EZPASSNJ": - case 74: - message.tollPasses[i] = 74; - break; - case "US_NY_EXPRESSPASS": - case 76: - message.tollPasses[i] = 76; - break; - case "US_NY_EZPASSNY": - case 77: - message.tollPasses[i] = 77; - break; - case "US_OH_EZPASSOH": - case 44: - message.tollPasses[i] = 44; - break; - case "US_PA_EZPASSPA": - case 45: - message.tollPasses[i] = 45; - break; - case "US_RI_EZPASSRI": - case 46: - message.tollPasses[i] = 46; - break; - case "US_SC_PALPASS": - case 47: - message.tollPasses[i] = 47; - break; - case "US_TX_AVI_TAG": - case 97: - message.tollPasses[i] = 97; - break; - case "US_TX_BANCPASS": - case 48: - message.tollPasses[i] = 48; - break; - case "US_TX_DEL_RIO_PASS": - case 49: - message.tollPasses[i] = 49; - break; - case "US_TX_EFAST_PASS": - case 50: - message.tollPasses[i] = 50; - break; - case "US_TX_EAGLE_PASS_EXPRESS_CARD": - case 51: - message.tollPasses[i] = 51; - break; - case "US_TX_EPTOLL": - case 52: - message.tollPasses[i] = 52; - break; - case "US_TX_EZ_CROSS": - case 53: - message.tollPasses[i] = 53; - break; - case "US_TX_EZTAG": - case 54: - message.tollPasses[i] = 54; - break; - case "US_TX_FUEGO_TAG": - case 96: - message.tollPasses[i] = 96; - break; - case "US_TX_LAREDO_TRADE_TAG": - case 55: - message.tollPasses[i] = 55; - break; - case "US_TX_PLUSPASS": - case 56: - message.tollPasses[i] = 56; - break; - case "US_TX_TOLLTAG": - case 57: - message.tollPasses[i] = 57; - break; - case "US_TX_TXTAG": - case 58: - message.tollPasses[i] = 58; - break; - case "US_TX_XPRESS_CARD": - case 59: - message.tollPasses[i] = 59; - break; - case "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": - case 60: - message.tollPasses[i] = 60; - break; - case "US_VA_EZPASSVA": - case 61: - message.tollPasses[i] = 61; - break; - case "US_WA_BREEZEBY": - case 17: - message.tollPasses[i] = 17; - break; - case "US_WA_GOOD_TO_GO": - case 1: - message.tollPasses[i] = 1; - break; - case "US_WV_EZPASSWV": - case 62: - message.tollPasses[i] = 62; - break; - case "US_WV_MEMORIAL_BRIDGE_TICKETS": - case 63: - message.tollPasses[i] = 63; - break; - case "US_WV_MOV_PASS": - case 100: - message.tollPasses[i] = 100; - break; - case "US_WV_NEWELL_TOLL_BRIDGE_TICKET": - case 64: - message.tollPasses[i] = 64; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {google.maps.routing.v2.RouteModifiers} message RouteModifiers - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteModifiers.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tollPasses = []; - if (options.defaults) { - object.avoidTolls = false; - object.avoidHighways = false; - object.avoidFerries = false; - object.avoidIndoor = false; - object.vehicleInfo = null; - } - if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) - object.avoidTolls = message.avoidTolls; - if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) - object.avoidHighways = message.avoidHighways; - if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) - object.avoidFerries = message.avoidFerries; - if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) - object.avoidIndoor = message.avoidIndoor; - if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) - object.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.toObject(message.vehicleInfo, options); - if (message.tollPasses && message.tollPasses.length) { - object.tollPasses = []; - for (var j = 0; j < message.tollPasses.length; ++j) - object.tollPasses[j] = options.enums === String ? $root.google.maps.routing.v2.TollPass[message.tollPasses[j]] === undefined ? message.tollPasses[j] : $root.google.maps.routing.v2.TollPass[message.tollPasses[j]] : message.tollPasses[j]; - } - return object; - }; - - /** - * Converts this RouteModifiers to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteModifiers - * @instance - * @returns {Object.} JSON object - */ - RouteModifiers.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteModifiers - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteModifiers - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteModifiers"; - }; - - return RouteModifiers; - })(); - - /** - * TollPass enum. - * @name google.maps.routing.v2.TollPass - * @enum {number} - * @property {number} TOLL_PASS_UNSPECIFIED=0 TOLL_PASS_UNSPECIFIED value - * @property {number} AU_ETOLL_TAG=82 AU_ETOLL_TAG value - * @property {number} AU_EWAY_TAG=83 AU_EWAY_TAG value - * @property {number} AU_LINKT=2 AU_LINKT value - * @property {number} AR_TELEPASE=3 AR_TELEPASE value - * @property {number} BR_AUTO_EXPRESO=81 BR_AUTO_EXPRESO value - * @property {number} BR_CONECTCAR=7 BR_CONECTCAR value - * @property {number} BR_MOVE_MAIS=8 BR_MOVE_MAIS value - * @property {number} BR_PASSA_RAPIDO=88 BR_PASSA_RAPIDO value - * @property {number} BR_SEM_PARAR=9 BR_SEM_PARAR value - * @property {number} BR_TAGGY=10 BR_TAGGY value - * @property {number} BR_VELOE=11 BR_VELOE value - * @property {number} CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD=84 CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD value - * @property {number} CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD=85 CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD value - * @property {number} CA_US_BLUE_WATER_EDGE_PASS=18 CA_US_BLUE_WATER_EDGE_PASS value - * @property {number} CA_US_CONNEXION=19 CA_US_CONNEXION value - * @property {number} CA_US_NEXUS_CARD=20 CA_US_NEXUS_CARD value - * @property {number} ID_E_TOLL=16 ID_E_TOLL value - * @property {number} IN_FASTAG=78 IN_FASTAG value - * @property {number} IN_LOCAL_HP_PLATE_EXEMPT=79 IN_LOCAL_HP_PLATE_EXEMPT value - * @property {number} JP_ETC=98 JP_ETC value - * @property {number} JP_ETC2=99 JP_ETC2 value - * @property {number} MX_IAVE=90 MX_IAVE value - * @property {number} MX_PASE=91 MX_PASE value - * @property {number} MX_QUICKPASS=93 MX_QUICKPASS value - * @property {number} MX_SISTEMA_TELEPEAJE_CHIHUAHUA=89 MX_SISTEMA_TELEPEAJE_CHIHUAHUA value - * @property {number} MX_TAG_IAVE=12 MX_TAG_IAVE value - * @property {number} MX_TAG_TELEVIA=13 MX_TAG_TELEVIA value - * @property {number} MX_TELEVIA=92 MX_TELEVIA value - * @property {number} MX_VIAPASS=14 MX_VIAPASS value - * @property {number} US_AL_FREEDOM_PASS=21 US_AL_FREEDOM_PASS value - * @property {number} US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS=22 US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS value - * @property {number} US_CA_FASTRAK=4 US_CA_FASTRAK value - * @property {number} US_CA_FASTRAK_CAV_STICKER=86 US_CA_FASTRAK_CAV_STICKER value - * @property {number} US_CO_EXPRESSTOLL=23 US_CO_EXPRESSTOLL value - * @property {number} US_CO_GO_PASS=24 US_CO_GO_PASS value - * @property {number} US_DE_EZPASSDE=25 US_DE_EZPASSDE value - * @property {number} US_FL_BOB_SIKES_TOLL_BRIDGE_PASS=65 US_FL_BOB_SIKES_TOLL_BRIDGE_PASS value - * @property {number} US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD=66 US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD value - * @property {number} US_FL_EPASS=67 US_FL_EPASS value - * @property {number} US_FL_GIBA_TOLL_PASS=68 US_FL_GIBA_TOLL_PASS value - * @property {number} US_FL_LEEWAY=69 US_FL_LEEWAY value - * @property {number} US_FL_SUNPASS=70 US_FL_SUNPASS value - * @property {number} US_FL_SUNPASS_PRO=71 US_FL_SUNPASS_PRO value - * @property {number} US_IL_EZPASSIL=73 US_IL_EZPASSIL value - * @property {number} US_IL_IPASS=72 US_IL_IPASS value - * @property {number} US_IN_EZPASSIN=26 US_IN_EZPASSIN value - * @property {number} US_KS_BESTPASS_HORIZON=27 US_KS_BESTPASS_HORIZON value - * @property {number} US_KS_KTAG=28 US_KS_KTAG value - * @property {number} US_KS_NATIONALPASS=29 US_KS_NATIONALPASS value - * @property {number} US_KS_PREPASS_ELITEPASS=30 US_KS_PREPASS_ELITEPASS value - * @property {number} US_KY_RIVERLINK=31 US_KY_RIVERLINK value - * @property {number} US_LA_GEAUXPASS=32 US_LA_GEAUXPASS value - * @property {number} US_LA_TOLL_TAG=33 US_LA_TOLL_TAG value - * @property {number} US_MA_EZPASSMA=6 US_MA_EZPASSMA value - * @property {number} US_MD_EZPASSMD=34 US_MD_EZPASSMD value - * @property {number} US_ME_EZPASSME=35 US_ME_EZPASSME value - * @property {number} US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD=36 US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD value - * @property {number} US_MI_BCPASS=94 US_MI_BCPASS value - * @property {number} US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG=37 US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG value - * @property {number} US_MI_IQ_PROX_CARD=38 US_MI_IQ_PROX_CARD value - * @property {number} US_MI_IQ_TAG=95 US_MI_IQ_TAG value - * @property {number} US_MI_MACKINAC_BRIDGE_MAC_PASS=39 US_MI_MACKINAC_BRIDGE_MAC_PASS value - * @property {number} US_MI_NEXPRESS_TOLL=40 US_MI_NEXPRESS_TOLL value - * @property {number} US_MN_EZPASSMN=41 US_MN_EZPASSMN value - * @property {number} US_NC_EZPASSNC=42 US_NC_EZPASSNC value - * @property {number} US_NC_PEACH_PASS=87 US_NC_PEACH_PASS value - * @property {number} US_NC_QUICK_PASS=43 US_NC_QUICK_PASS value - * @property {number} US_NH_EZPASSNH=80 US_NH_EZPASSNH value - * @property {number} US_NJ_DOWNBEACH_EXPRESS_PASS=75 US_NJ_DOWNBEACH_EXPRESS_PASS value - * @property {number} US_NJ_EZPASSNJ=74 US_NJ_EZPASSNJ value - * @property {number} US_NY_EXPRESSPASS=76 US_NY_EXPRESSPASS value - * @property {number} US_NY_EZPASSNY=77 US_NY_EZPASSNY value - * @property {number} US_OH_EZPASSOH=44 US_OH_EZPASSOH value - * @property {number} US_PA_EZPASSPA=45 US_PA_EZPASSPA value - * @property {number} US_RI_EZPASSRI=46 US_RI_EZPASSRI value - * @property {number} US_SC_PALPASS=47 US_SC_PALPASS value - * @property {number} US_TX_AVI_TAG=97 US_TX_AVI_TAG value - * @property {number} US_TX_BANCPASS=48 US_TX_BANCPASS value - * @property {number} US_TX_DEL_RIO_PASS=49 US_TX_DEL_RIO_PASS value - * @property {number} US_TX_EFAST_PASS=50 US_TX_EFAST_PASS value - * @property {number} US_TX_EAGLE_PASS_EXPRESS_CARD=51 US_TX_EAGLE_PASS_EXPRESS_CARD value - * @property {number} US_TX_EPTOLL=52 US_TX_EPTOLL value - * @property {number} US_TX_EZ_CROSS=53 US_TX_EZ_CROSS value - * @property {number} US_TX_EZTAG=54 US_TX_EZTAG value - * @property {number} US_TX_FUEGO_TAG=96 US_TX_FUEGO_TAG value - * @property {number} US_TX_LAREDO_TRADE_TAG=55 US_TX_LAREDO_TRADE_TAG value - * @property {number} US_TX_PLUSPASS=56 US_TX_PLUSPASS value - * @property {number} US_TX_TOLLTAG=57 US_TX_TOLLTAG value - * @property {number} US_TX_TXTAG=58 US_TX_TXTAG value - * @property {number} US_TX_XPRESS_CARD=59 US_TX_XPRESS_CARD value - * @property {number} US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD=60 US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD value - * @property {number} US_VA_EZPASSVA=61 US_VA_EZPASSVA value - * @property {number} US_WA_BREEZEBY=17 US_WA_BREEZEBY value - * @property {number} US_WA_GOOD_TO_GO=1 US_WA_GOOD_TO_GO value - * @property {number} US_WV_EZPASSWV=62 US_WV_EZPASSWV value - * @property {number} US_WV_MEMORIAL_BRIDGE_TICKETS=63 US_WV_MEMORIAL_BRIDGE_TICKETS value - * @property {number} US_WV_MOV_PASS=100 US_WV_MOV_PASS value - * @property {number} US_WV_NEWELL_TOLL_BRIDGE_TICKET=64 US_WV_NEWELL_TOLL_BRIDGE_TICKET value - */ - v2.TollPass = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOLL_PASS_UNSPECIFIED"] = 0; - values[valuesById[82] = "AU_ETOLL_TAG"] = 82; - values[valuesById[83] = "AU_EWAY_TAG"] = 83; - values[valuesById[2] = "AU_LINKT"] = 2; - values[valuesById[3] = "AR_TELEPASE"] = 3; - values[valuesById[81] = "BR_AUTO_EXPRESO"] = 81; - values[valuesById[7] = "BR_CONECTCAR"] = 7; - values[valuesById[8] = "BR_MOVE_MAIS"] = 8; - values[valuesById[88] = "BR_PASSA_RAPIDO"] = 88; - values[valuesById[9] = "BR_SEM_PARAR"] = 9; - values[valuesById[10] = "BR_TAGGY"] = 10; - values[valuesById[11] = "BR_VELOE"] = 11; - values[valuesById[84] = "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD"] = 84; - values[valuesById[85] = "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD"] = 85; - values[valuesById[18] = "CA_US_BLUE_WATER_EDGE_PASS"] = 18; - values[valuesById[19] = "CA_US_CONNEXION"] = 19; - values[valuesById[20] = "CA_US_NEXUS_CARD"] = 20; - values[valuesById[16] = "ID_E_TOLL"] = 16; - values[valuesById[78] = "IN_FASTAG"] = 78; - values[valuesById[79] = "IN_LOCAL_HP_PLATE_EXEMPT"] = 79; - values[valuesById[98] = "JP_ETC"] = 98; - values[valuesById[99] = "JP_ETC2"] = 99; - values[valuesById[90] = "MX_IAVE"] = 90; - values[valuesById[91] = "MX_PASE"] = 91; - values[valuesById[93] = "MX_QUICKPASS"] = 93; - values[valuesById[89] = "MX_SISTEMA_TELEPEAJE_CHIHUAHUA"] = 89; - values[valuesById[12] = "MX_TAG_IAVE"] = 12; - values[valuesById[13] = "MX_TAG_TELEVIA"] = 13; - values[valuesById[92] = "MX_TELEVIA"] = 92; - values[valuesById[14] = "MX_VIAPASS"] = 14; - values[valuesById[21] = "US_AL_FREEDOM_PASS"] = 21; - values[valuesById[22] = "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS"] = 22; - values[valuesById[4] = "US_CA_FASTRAK"] = 4; - values[valuesById[86] = "US_CA_FASTRAK_CAV_STICKER"] = 86; - values[valuesById[23] = "US_CO_EXPRESSTOLL"] = 23; - values[valuesById[24] = "US_CO_GO_PASS"] = 24; - values[valuesById[25] = "US_DE_EZPASSDE"] = 25; - values[valuesById[65] = "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS"] = 65; - values[valuesById[66] = "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD"] = 66; - values[valuesById[67] = "US_FL_EPASS"] = 67; - values[valuesById[68] = "US_FL_GIBA_TOLL_PASS"] = 68; - values[valuesById[69] = "US_FL_LEEWAY"] = 69; - values[valuesById[70] = "US_FL_SUNPASS"] = 70; - values[valuesById[71] = "US_FL_SUNPASS_PRO"] = 71; - values[valuesById[73] = "US_IL_EZPASSIL"] = 73; - values[valuesById[72] = "US_IL_IPASS"] = 72; - values[valuesById[26] = "US_IN_EZPASSIN"] = 26; - values[valuesById[27] = "US_KS_BESTPASS_HORIZON"] = 27; - values[valuesById[28] = "US_KS_KTAG"] = 28; - values[valuesById[29] = "US_KS_NATIONALPASS"] = 29; - values[valuesById[30] = "US_KS_PREPASS_ELITEPASS"] = 30; - values[valuesById[31] = "US_KY_RIVERLINK"] = 31; - values[valuesById[32] = "US_LA_GEAUXPASS"] = 32; - values[valuesById[33] = "US_LA_TOLL_TAG"] = 33; - values[valuesById[6] = "US_MA_EZPASSMA"] = 6; - values[valuesById[34] = "US_MD_EZPASSMD"] = 34; - values[valuesById[35] = "US_ME_EZPASSME"] = 35; - values[valuesById[36] = "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD"] = 36; - values[valuesById[94] = "US_MI_BCPASS"] = 94; - values[valuesById[37] = "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG"] = 37; - values[valuesById[38] = "US_MI_IQ_PROX_CARD"] = 38; - values[valuesById[95] = "US_MI_IQ_TAG"] = 95; - values[valuesById[39] = "US_MI_MACKINAC_BRIDGE_MAC_PASS"] = 39; - values[valuesById[40] = "US_MI_NEXPRESS_TOLL"] = 40; - values[valuesById[41] = "US_MN_EZPASSMN"] = 41; - values[valuesById[42] = "US_NC_EZPASSNC"] = 42; - values[valuesById[87] = "US_NC_PEACH_PASS"] = 87; - values[valuesById[43] = "US_NC_QUICK_PASS"] = 43; - values[valuesById[80] = "US_NH_EZPASSNH"] = 80; - values[valuesById[75] = "US_NJ_DOWNBEACH_EXPRESS_PASS"] = 75; - values[valuesById[74] = "US_NJ_EZPASSNJ"] = 74; - values[valuesById[76] = "US_NY_EXPRESSPASS"] = 76; - values[valuesById[77] = "US_NY_EZPASSNY"] = 77; - values[valuesById[44] = "US_OH_EZPASSOH"] = 44; - values[valuesById[45] = "US_PA_EZPASSPA"] = 45; - values[valuesById[46] = "US_RI_EZPASSRI"] = 46; - values[valuesById[47] = "US_SC_PALPASS"] = 47; - values[valuesById[97] = "US_TX_AVI_TAG"] = 97; - values[valuesById[48] = "US_TX_BANCPASS"] = 48; - values[valuesById[49] = "US_TX_DEL_RIO_PASS"] = 49; - values[valuesById[50] = "US_TX_EFAST_PASS"] = 50; - values[valuesById[51] = "US_TX_EAGLE_PASS_EXPRESS_CARD"] = 51; - values[valuesById[52] = "US_TX_EPTOLL"] = 52; - values[valuesById[53] = "US_TX_EZ_CROSS"] = 53; - values[valuesById[54] = "US_TX_EZTAG"] = 54; - values[valuesById[96] = "US_TX_FUEGO_TAG"] = 96; - values[valuesById[55] = "US_TX_LAREDO_TRADE_TAG"] = 55; - values[valuesById[56] = "US_TX_PLUSPASS"] = 56; - values[valuesById[57] = "US_TX_TOLLTAG"] = 57; - values[valuesById[58] = "US_TX_TXTAG"] = 58; - values[valuesById[59] = "US_TX_XPRESS_CARD"] = 59; - values[valuesById[60] = "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD"] = 60; - values[valuesById[61] = "US_VA_EZPASSVA"] = 61; - values[valuesById[17] = "US_WA_BREEZEBY"] = 17; - values[valuesById[1] = "US_WA_GOOD_TO_GO"] = 1; - values[valuesById[62] = "US_WV_EZPASSWV"] = 62; - values[valuesById[63] = "US_WV_MEMORIAL_BRIDGE_TICKETS"] = 63; - values[valuesById[100] = "US_WV_MOV_PASS"] = 100; - values[valuesById[64] = "US_WV_NEWELL_TOLL_BRIDGE_TICKET"] = 64; - return values; - })(); - - v2.VehicleInfo = (function() { - - /** - * Properties of a VehicleInfo. - * @memberof google.maps.routing.v2 - * @interface IVehicleInfo - * @property {google.maps.routing.v2.VehicleEmissionType|null} [emissionType] VehicleInfo emissionType - */ - - /** - * Constructs a new VehicleInfo. - * @memberof google.maps.routing.v2 - * @classdesc Represents a VehicleInfo. - * @implements IVehicleInfo - * @constructor - * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set - */ - function VehicleInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VehicleInfo emissionType. - * @member {google.maps.routing.v2.VehicleEmissionType} emissionType - * @memberof google.maps.routing.v2.VehicleInfo - * @instance - */ - VehicleInfo.prototype.emissionType = 0; - - /** - * Creates a new VehicleInfo instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set - * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo instance - */ - VehicleInfo.create = function create(properties) { - return new VehicleInfo(properties); - }; - - /** - * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VehicleInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.emissionType != null && Object.hasOwnProperty.call(message, "emissionType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.emissionType); - return writer; - }; - - /** - * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VehicleInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VehicleInfo message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VehicleInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.VehicleInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.emissionType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VehicleInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VehicleInfo message. - * @function verify - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VehicleInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.emissionType != null && message.hasOwnProperty("emissionType")) - switch (message.emissionType) { - default: - return "emissionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo - */ - VehicleInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.VehicleInfo) - return object; - var message = new $root.google.maps.routing.v2.VehicleInfo(); - switch (object.emissionType) { - default: - if (typeof object.emissionType === "number") { - message.emissionType = object.emissionType; - break; - } - break; - case "VEHICLE_EMISSION_TYPE_UNSPECIFIED": - case 0: - message.emissionType = 0; - break; - case "GASOLINE": - case 1: - message.emissionType = 1; - break; - case "ELECTRIC": - case 2: - message.emissionType = 2; - break; - case "HYBRID": - case 3: - message.emissionType = 3; - break; - case "DIESEL": - case 4: - message.emissionType = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {google.maps.routing.v2.VehicleInfo} message VehicleInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VehicleInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.emissionType = options.enums === String ? "VEHICLE_EMISSION_TYPE_UNSPECIFIED" : 0; - if (message.emissionType != null && message.hasOwnProperty("emissionType")) - object.emissionType = options.enums === String ? $root.google.maps.routing.v2.VehicleEmissionType[message.emissionType] === undefined ? message.emissionType : $root.google.maps.routing.v2.VehicleEmissionType[message.emissionType] : message.emissionType; - return object; - }; - - /** - * Converts this VehicleInfo to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.VehicleInfo - * @instance - * @returns {Object.} JSON object - */ - VehicleInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VehicleInfo - * @function getTypeUrl - * @memberof google.maps.routing.v2.VehicleInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VehicleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.VehicleInfo"; - }; - - return VehicleInfo; - })(); - - /** - * VehicleEmissionType enum. - * @name google.maps.routing.v2.VehicleEmissionType - * @enum {number} - * @property {number} VEHICLE_EMISSION_TYPE_UNSPECIFIED=0 VEHICLE_EMISSION_TYPE_UNSPECIFIED value - * @property {number} GASOLINE=1 GASOLINE value - * @property {number} ELECTRIC=2 ELECTRIC value - * @property {number} HYBRID=3 HYBRID value - * @property {number} DIESEL=4 DIESEL value - */ - v2.VehicleEmissionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VEHICLE_EMISSION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GASOLINE"] = 1; - values[valuesById[2] = "ELECTRIC"] = 2; - values[valuesById[3] = "HYBRID"] = 3; - values[valuesById[4] = "DIESEL"] = 4; - return values; - })(); - - v2.Routes = (function() { - - /** - * Constructs a new Routes service. - * @memberof google.maps.routing.v2 - * @classdesc Represents a Routes - * @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 Routes(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Routes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Routes; - - /** - * Creates new Routes service using the specified rpc implementation. - * @function create - * @memberof google.maps.routing.v2.Routes - * @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 {Routes} RPC service. Useful where requests and/or responses are streamed. - */ - Routes.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. - * @memberof google.maps.routing.v2.Routes - * @typedef ComputeRoutesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.maps.routing.v2.ComputeRoutesResponse} [response] ComputeRoutesResponse - */ - - /** - * Calls ComputeRoutes. - * @function computeRoutes - * @memberof google.maps.routing.v2.Routes - * @instance - * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object - * @param {google.maps.routing.v2.Routes.ComputeRoutesCallback} callback Node-style callback called with the error, if any, and ComputeRoutesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Routes.prototype.computeRoutes = function computeRoutes(request, callback) { - return this.rpcCall(computeRoutes, $root.google.maps.routing.v2.ComputeRoutesRequest, $root.google.maps.routing.v2.ComputeRoutesResponse, request, callback); - }, "name", { value: "ComputeRoutes" }); - - /** - * Calls ComputeRoutes. - * @function computeRoutes - * @memberof google.maps.routing.v2.Routes - * @instance - * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. - * @memberof google.maps.routing.v2.Routes - * @typedef ComputeRouteMatrixCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.maps.routing.v2.RouteMatrixElement} [response] RouteMatrixElement - */ - - /** - * Calls ComputeRouteMatrix. - * @function computeRouteMatrix - * @memberof google.maps.routing.v2.Routes - * @instance - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object - * @param {google.maps.routing.v2.Routes.ComputeRouteMatrixCallback} callback Node-style callback called with the error, if any, and RouteMatrixElement - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Routes.prototype.computeRouteMatrix = function computeRouteMatrix(request, callback) { - return this.rpcCall(computeRouteMatrix, $root.google.maps.routing.v2.ComputeRouteMatrixRequest, $root.google.maps.routing.v2.RouteMatrixElement, request, callback); - }, "name", { value: "ComputeRouteMatrix" }); - - /** - * Calls ComputeRouteMatrix. - * @function computeRouteMatrix - * @memberof google.maps.routing.v2.Routes - * @instance - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Routes; - })(); - - v2.ComputeRoutesRequest = (function() { - - /** - * Properties of a ComputeRoutesRequest. - * @memberof google.maps.routing.v2 - * @interface IComputeRoutesRequest - * @property {google.maps.routing.v2.IWaypoint|null} [origin] ComputeRoutesRequest origin - * @property {google.maps.routing.v2.IWaypoint|null} [destination] ComputeRoutesRequest destination - * @property {Array.|null} [intermediates] ComputeRoutesRequest intermediates - * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRoutesRequest travelMode - * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRoutesRequest routingPreference - * @property {google.maps.routing.v2.PolylineQuality|null} [polylineQuality] ComputeRoutesRequest polylineQuality - * @property {google.maps.routing.v2.PolylineEncoding|null} [polylineEncoding] ComputeRoutesRequest polylineEncoding - * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRoutesRequest departureTime - * @property {google.protobuf.ITimestamp|null} [arrivalTime] ComputeRoutesRequest arrivalTime - * @property {boolean|null} [computeAlternativeRoutes] ComputeRoutesRequest computeAlternativeRoutes - * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] ComputeRoutesRequest routeModifiers - * @property {string|null} [languageCode] ComputeRoutesRequest languageCode - * @property {string|null} [regionCode] ComputeRoutesRequest regionCode - * @property {google.maps.routing.v2.Units|null} [units] ComputeRoutesRequest units - * @property {boolean|null} [optimizeWaypointOrder] ComputeRoutesRequest optimizeWaypointOrder - * @property {Array.|null} [requestedReferenceRoutes] ComputeRoutesRequest requestedReferenceRoutes - * @property {Array.|null} [extraComputations] ComputeRoutesRequest extraComputations - * @property {google.maps.routing.v2.TrafficModel|null} [trafficModel] ComputeRoutesRequest trafficModel - * @property {google.maps.routing.v2.ITransitPreferences|null} [transitPreferences] ComputeRoutesRequest transitPreferences - */ - - /** - * Constructs a new ComputeRoutesRequest. - * @memberof google.maps.routing.v2 - * @classdesc Represents a ComputeRoutesRequest. - * @implements IComputeRoutesRequest - * @constructor - * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set - */ - function ComputeRoutesRequest(properties) { - this.intermediates = []; - this.requestedReferenceRoutes = []; - this.extraComputations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeRoutesRequest origin. - * @member {google.maps.routing.v2.IWaypoint|null|undefined} origin - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.origin = null; - - /** - * ComputeRoutesRequest destination. - * @member {google.maps.routing.v2.IWaypoint|null|undefined} destination - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.destination = null; - - /** - * ComputeRoutesRequest intermediates. - * @member {Array.} intermediates - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.intermediates = $util.emptyArray; - - /** - * ComputeRoutesRequest travelMode. - * @member {google.maps.routing.v2.RouteTravelMode} travelMode - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.travelMode = 0; - - /** - * ComputeRoutesRequest routingPreference. - * @member {google.maps.routing.v2.RoutingPreference} routingPreference - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.routingPreference = 0; - - /** - * ComputeRoutesRequest polylineQuality. - * @member {google.maps.routing.v2.PolylineQuality} polylineQuality - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.polylineQuality = 0; - - /** - * ComputeRoutesRequest polylineEncoding. - * @member {google.maps.routing.v2.PolylineEncoding} polylineEncoding - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.polylineEncoding = 0; - - /** - * ComputeRoutesRequest departureTime. - * @member {google.protobuf.ITimestamp|null|undefined} departureTime - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.departureTime = null; - - /** - * ComputeRoutesRequest arrivalTime. - * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.arrivalTime = null; - - /** - * ComputeRoutesRequest computeAlternativeRoutes. - * @member {boolean} computeAlternativeRoutes - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.computeAlternativeRoutes = false; - - /** - * ComputeRoutesRequest routeModifiers. - * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.routeModifiers = null; - - /** - * ComputeRoutesRequest languageCode. - * @member {string} languageCode - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.languageCode = ""; - - /** - * ComputeRoutesRequest regionCode. - * @member {string} regionCode - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.regionCode = ""; - - /** - * ComputeRoutesRequest units. - * @member {google.maps.routing.v2.Units} units - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.units = 0; - - /** - * ComputeRoutesRequest optimizeWaypointOrder. - * @member {boolean} optimizeWaypointOrder - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.optimizeWaypointOrder = false; - - /** - * ComputeRoutesRequest requestedReferenceRoutes. - * @member {Array.} requestedReferenceRoutes - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.requestedReferenceRoutes = $util.emptyArray; - - /** - * ComputeRoutesRequest extraComputations. - * @member {Array.} extraComputations - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.extraComputations = $util.emptyArray; - - /** - * ComputeRoutesRequest trafficModel. - * @member {google.maps.routing.v2.TrafficModel} trafficModel - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.trafficModel = 0; - - /** - * ComputeRoutesRequest transitPreferences. - * @member {google.maps.routing.v2.ITransitPreferences|null|undefined} transitPreferences - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - */ - ComputeRoutesRequest.prototype.transitPreferences = null; - - /** - * Creates a new ComputeRoutesRequest instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set - * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest instance - */ - ComputeRoutesRequest.create = function create(properties) { - return new ComputeRoutesRequest(properties); - }; - - /** - * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRoutesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) - $root.google.maps.routing.v2.Waypoint.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - $root.google.maps.routing.v2.Waypoint.encode(message.destination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.intermediates != null && message.intermediates.length) - for (var i = 0; i < message.intermediates.length; ++i) - $root.google.maps.routing.v2.Waypoint.encode(message.intermediates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.travelMode); - if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.routingPreference); - if (message.polylineQuality != null && Object.hasOwnProperty.call(message, "polylineQuality")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.polylineQuality); - if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) - $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.computeAlternativeRoutes != null && Object.hasOwnProperty.call(message, "computeAlternativeRoutes")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeAlternativeRoutes); - if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) - $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); - if (message.units != null && Object.hasOwnProperty.call(message, "units")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.units); - if (message.polylineEncoding != null && Object.hasOwnProperty.call(message, "polylineEncoding")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.polylineEncoding); - if (message.optimizeWaypointOrder != null && Object.hasOwnProperty.call(message, "optimizeWaypointOrder")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.optimizeWaypointOrder); - if (message.requestedReferenceRoutes != null && message.requestedReferenceRoutes.length) { - writer.uint32(/* id 14, wireType 2 =*/114).fork(); - for (var i = 0; i < message.requestedReferenceRoutes.length; ++i) - writer.int32(message.requestedReferenceRoutes[i]); - writer.ldelim(); - } - if (message.extraComputations != null && message.extraComputations.length) { - writer.uint32(/* id 15, wireType 2 =*/122).fork(); - for (var i = 0; i < message.extraComputations.length; ++i) - writer.int32(message.extraComputations[i]); - writer.ldelim(); - } - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.regionCode); - if (message.trafficModel != null && Object.hasOwnProperty.call(message, "trafficModel")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.trafficModel); - if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) - $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.transitPreferences != null && Object.hasOwnProperty.call(message, "transitPreferences")) - $root.google.maps.routing.v2.TransitPreferences.encode(message.transitPreferences, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeRoutesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRoutesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.origin = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); - break; - } - case 2: { - message.destination = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.intermediates && message.intermediates.length)) - message.intermediates = []; - message.intermediates.push($root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32())); - break; - } - case 4: { - message.travelMode = reader.int32(); - break; - } - case 5: { - message.routingPreference = reader.int32(); - break; - } - case 6: { - message.polylineQuality = reader.int32(); - break; - } - case 12: { - message.polylineEncoding = reader.int32(); - break; - } - case 7: { - message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 19: { - message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.computeAlternativeRoutes = reader.bool(); - break; - } - case 9: { - message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); - break; - } - case 10: { - message.languageCode = reader.string(); - break; - } - case 16: { - message.regionCode = reader.string(); - break; - } - case 11: { - message.units = reader.int32(); - break; - } - case 13: { - message.optimizeWaypointOrder = reader.bool(); - break; - } - case 14: { - if (!(message.requestedReferenceRoutes && message.requestedReferenceRoutes.length)) - message.requestedReferenceRoutes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.requestedReferenceRoutes.push(reader.int32()); - } else - message.requestedReferenceRoutes.push(reader.int32()); - break; - } - case 15: { - if (!(message.extraComputations && message.extraComputations.length)) - message.extraComputations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.extraComputations.push(reader.int32()); - } else - message.extraComputations.push(reader.int32()); - break; - } - case 18: { - message.trafficModel = reader.int32(); - break; - } - case 20: { - message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRoutesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeRoutesRequest message. - * @function verify - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeRoutesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.origin != null && message.hasOwnProperty("origin")) { - var error = $root.google.maps.routing.v2.Waypoint.verify(message.origin); - if (error) - return "origin." + error; - } - if (message.destination != null && message.hasOwnProperty("destination")) { - var error = $root.google.maps.routing.v2.Waypoint.verify(message.destination); - if (error) - return "destination." + error; - } - if (message.intermediates != null && message.hasOwnProperty("intermediates")) { - if (!Array.isArray(message.intermediates)) - return "intermediates: array expected"; - for (var i = 0; i < message.intermediates.length; ++i) { - var error = $root.google.maps.routing.v2.Waypoint.verify(message.intermediates[i]); - if (error) - return "intermediates." + error; - } - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - switch (message.travelMode) { - default: - return "travelMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 7: - break; - } - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - switch (message.routingPreference) { - default: - return "routingPreference: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) - switch (message.polylineQuality) { - default: - return "polylineQuality: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) - switch (message.polylineEncoding) { - default: - return "polylineEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.departureTime != null && message.hasOwnProperty("departureTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.departureTime); - if (error) - return "departureTime." + error; - } - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); - if (error) - return "arrivalTime." + error; - } - if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) - if (typeof message.computeAlternativeRoutes !== "boolean") - return "computeAlternativeRoutes: boolean expected"; - if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { - var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); - if (error) - return "routeModifiers." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.units != null && message.hasOwnProperty("units")) - switch (message.units) { - default: - return "units: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.optimizeWaypointOrder != null && message.hasOwnProperty("optimizeWaypointOrder")) - if (typeof message.optimizeWaypointOrder !== "boolean") - return "optimizeWaypointOrder: boolean expected"; - if (message.requestedReferenceRoutes != null && message.hasOwnProperty("requestedReferenceRoutes")) { - if (!Array.isArray(message.requestedReferenceRoutes)) - return "requestedReferenceRoutes: array expected"; - for (var i = 0; i < message.requestedReferenceRoutes.length; ++i) - switch (message.requestedReferenceRoutes[i]) { - default: - return "requestedReferenceRoutes: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.extraComputations != null && message.hasOwnProperty("extraComputations")) { - if (!Array.isArray(message.extraComputations)) - return "extraComputations: array expected"; - for (var i = 0; i < message.extraComputations.length; ++i) - switch (message.extraComputations[i]) { - default: - return "extraComputations: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 7: - case 8: - break; - } - } - if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) - switch (message.trafficModel) { - default: - return "trafficModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) { - var error = $root.google.maps.routing.v2.TransitPreferences.verify(message.transitPreferences); - if (error) - return "transitPreferences." + error; - } - return null; - }; - - /** - * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest - */ - ComputeRoutesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.ComputeRoutesRequest) - return object; - var message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); - if (object.origin != null) { - if (typeof object.origin !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.origin: object expected"); - message.origin = $root.google.maps.routing.v2.Waypoint.fromObject(object.origin); - } - if (object.destination != null) { - if (typeof object.destination !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.destination: object expected"); - message.destination = $root.google.maps.routing.v2.Waypoint.fromObject(object.destination); - } - if (object.intermediates) { - if (!Array.isArray(object.intermediates)) - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: array expected"); - message.intermediates = []; - for (var i = 0; i < object.intermediates.length; ++i) { - if (typeof object.intermediates[i] !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: object expected"); - message.intermediates[i] = $root.google.maps.routing.v2.Waypoint.fromObject(object.intermediates[i]); - } - } - 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 "DRIVE": - case 1: - message.travelMode = 1; - break; - case "BICYCLE": - case 2: - message.travelMode = 2; - break; - case "WALK": - case 3: - message.travelMode = 3; - break; - case "TWO_WHEELER": - case 4: - message.travelMode = 4; - break; - case "TRANSIT": - case 7: - message.travelMode = 7; - break; - } - switch (object.routingPreference) { - default: - if (typeof object.routingPreference === "number") { - message.routingPreference = object.routingPreference; - break; - } - break; - case "ROUTING_PREFERENCE_UNSPECIFIED": - case 0: - message.routingPreference = 0; - break; - case "TRAFFIC_UNAWARE": - case 1: - message.routingPreference = 1; - break; - case "TRAFFIC_AWARE": - case 2: - message.routingPreference = 2; - break; - case "TRAFFIC_AWARE_OPTIMAL": - case 3: - message.routingPreference = 3; - break; - } - switch (object.polylineQuality) { - default: - if (typeof object.polylineQuality === "number") { - message.polylineQuality = object.polylineQuality; - break; - } - break; - case "POLYLINE_QUALITY_UNSPECIFIED": - case 0: - message.polylineQuality = 0; - break; - case "HIGH_QUALITY": - case 1: - message.polylineQuality = 1; - break; - case "OVERVIEW": - case 2: - message.polylineQuality = 2; - break; - } - switch (object.polylineEncoding) { - default: - if (typeof object.polylineEncoding === "number") { - message.polylineEncoding = object.polylineEncoding; - break; - } - break; - case "POLYLINE_ENCODING_UNSPECIFIED": - case 0: - message.polylineEncoding = 0; - break; - case "ENCODED_POLYLINE": - case 1: - message.polylineEncoding = 1; - break; - case "GEO_JSON_LINESTRING": - case 2: - message.polylineEncoding = 2; - break; - } - if (object.departureTime != null) { - if (typeof object.departureTime !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.departureTime: object expected"); - message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); - } - if (object.arrivalTime != null) { - if (typeof object.arrivalTime !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.arrivalTime: object expected"); - message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); - } - if (object.computeAlternativeRoutes != null) - message.computeAlternativeRoutes = Boolean(object.computeAlternativeRoutes); - if (object.routeModifiers != null) { - if (typeof object.routeModifiers !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.routeModifiers: object expected"); - message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.units) { - default: - if (typeof object.units === "number") { - message.units = object.units; - break; - } - break; - case "UNITS_UNSPECIFIED": - case 0: - message.units = 0; - break; - case "METRIC": - case 1: - message.units = 1; - break; - case "IMPERIAL": - case 2: - message.units = 2; - break; - } - if (object.optimizeWaypointOrder != null) - message.optimizeWaypointOrder = Boolean(object.optimizeWaypointOrder); - if (object.requestedReferenceRoutes) { - if (!Array.isArray(object.requestedReferenceRoutes)) - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.requestedReferenceRoutes: array expected"); - message.requestedReferenceRoutes = []; - for (var i = 0; i < object.requestedReferenceRoutes.length; ++i) - switch (object.requestedReferenceRoutes[i]) { - default: - if (typeof object.requestedReferenceRoutes[i] === "number") { - message.requestedReferenceRoutes[i] = object.requestedReferenceRoutes[i]; - break; - } - case "REFERENCE_ROUTE_UNSPECIFIED": - case 0: - message.requestedReferenceRoutes[i] = 0; - break; - case "FUEL_EFFICIENT": - case 1: - message.requestedReferenceRoutes[i] = 1; - break; - case "SHORTER_DISTANCE": - case 2: - message.requestedReferenceRoutes[i] = 2; - break; - } - } - if (object.extraComputations) { - if (!Array.isArray(object.extraComputations)) - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.extraComputations: array expected"); - message.extraComputations = []; - for (var i = 0; i < object.extraComputations.length; ++i) - switch (object.extraComputations[i]) { - default: - if (typeof object.extraComputations[i] === "number") { - message.extraComputations[i] = object.extraComputations[i]; - break; - } - case "EXTRA_COMPUTATION_UNSPECIFIED": - case 0: - message.extraComputations[i] = 0; - break; - case "TOLLS": - case 1: - message.extraComputations[i] = 1; - break; - case "FUEL_CONSUMPTION": - case 2: - message.extraComputations[i] = 2; - break; - case "TRAFFIC_ON_POLYLINE": - case 3: - message.extraComputations[i] = 3; - break; - case "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": - case 4: - message.extraComputations[i] = 4; - break; - case "FLYOVER_INFO_ON_POLYLINE": - case 7: - message.extraComputations[i] = 7; - break; - case "NARROW_ROAD_INFO_ON_POLYLINE": - case 8: - message.extraComputations[i] = 8; - break; - } - } - switch (object.trafficModel) { - default: - if (typeof object.trafficModel === "number") { - message.trafficModel = object.trafficModel; - break; - } - break; - case "TRAFFIC_MODEL_UNSPECIFIED": - case 0: - message.trafficModel = 0; - break; - case "BEST_GUESS": - case 1: - message.trafficModel = 1; - break; - case "PESSIMISTIC": - case 2: - message.trafficModel = 2; - break; - case "OPTIMISTIC": - case 3: - message.trafficModel = 3; - break; - } - if (object.transitPreferences != null) { - if (typeof object.transitPreferences !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.transitPreferences: object expected"); - message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.fromObject(object.transitPreferences); - } - return message; - }; - - /** - * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {google.maps.routing.v2.ComputeRoutesRequest} message ComputeRoutesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeRoutesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.intermediates = []; - object.requestedReferenceRoutes = []; - object.extraComputations = []; - } - if (options.defaults) { - object.origin = null; - object.destination = null; - object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; - object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; - object.polylineQuality = options.enums === String ? "POLYLINE_QUALITY_UNSPECIFIED" : 0; - object.departureTime = null; - object.computeAlternativeRoutes = false; - object.routeModifiers = null; - object.languageCode = ""; - object.units = options.enums === String ? "UNITS_UNSPECIFIED" : 0; - object.polylineEncoding = options.enums === String ? "POLYLINE_ENCODING_UNSPECIFIED" : 0; - object.optimizeWaypointOrder = false; - object.regionCode = ""; - object.trafficModel = options.enums === String ? "TRAFFIC_MODEL_UNSPECIFIED" : 0; - object.arrivalTime = null; - object.transitPreferences = null; - } - if (message.origin != null && message.hasOwnProperty("origin")) - object.origin = $root.google.maps.routing.v2.Waypoint.toObject(message.origin, options); - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = $root.google.maps.routing.v2.Waypoint.toObject(message.destination, options); - if (message.intermediates && message.intermediates.length) { - object.intermediates = []; - for (var j = 0; j < message.intermediates.length; ++j) - object.intermediates[j] = $root.google.maps.routing.v2.Waypoint.toObject(message.intermediates[j], options); - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; - if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) - object.polylineQuality = options.enums === String ? $root.google.maps.routing.v2.PolylineQuality[message.polylineQuality] === undefined ? message.polylineQuality : $root.google.maps.routing.v2.PolylineQuality[message.polylineQuality] : message.polylineQuality; - if (message.departureTime != null && message.hasOwnProperty("departureTime")) - object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); - if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) - object.computeAlternativeRoutes = message.computeAlternativeRoutes; - if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) - object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.units != null && message.hasOwnProperty("units")) - object.units = options.enums === String ? $root.google.maps.routing.v2.Units[message.units] === undefined ? message.units : $root.google.maps.routing.v2.Units[message.units] : message.units; - if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) - object.polylineEncoding = options.enums === String ? $root.google.maps.routing.v2.PolylineEncoding[message.polylineEncoding] === undefined ? message.polylineEncoding : $root.google.maps.routing.v2.PolylineEncoding[message.polylineEncoding] : message.polylineEncoding; - if (message.optimizeWaypointOrder != null && message.hasOwnProperty("optimizeWaypointOrder")) - object.optimizeWaypointOrder = message.optimizeWaypointOrder; - if (message.requestedReferenceRoutes && message.requestedReferenceRoutes.length) { - object.requestedReferenceRoutes = []; - for (var j = 0; j < message.requestedReferenceRoutes.length; ++j) - object.requestedReferenceRoutes[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[message.requestedReferenceRoutes[j]] === undefined ? message.requestedReferenceRoutes[j] : $root.google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute[message.requestedReferenceRoutes[j]] : message.requestedReferenceRoutes[j]; - } - if (message.extraComputations && message.extraComputations.length) { - object.extraComputations = []; - for (var j = 0; j < message.extraComputations.length; ++j) - object.extraComputations[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[message.extraComputations[j]] === undefined ? message.extraComputations[j] : $root.google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation[message.extraComputations[j]] : message.extraComputations[j]; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) - object.trafficModel = options.enums === String ? $root.google.maps.routing.v2.TrafficModel[message.trafficModel] === undefined ? message.trafficModel : $root.google.maps.routing.v2.TrafficModel[message.trafficModel] : message.trafficModel; - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) - object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); - if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) - object.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.toObject(message.transitPreferences, options); - return object; - }; - - /** - * Converts this ComputeRoutesRequest to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @instance - * @returns {Object.} JSON object - */ - ComputeRoutesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeRoutesRequest - * @function getTypeUrl - * @memberof google.maps.routing.v2.ComputeRoutesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesRequest"; - }; - - /** - * ReferenceRoute enum. - * @name google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute - * @enum {number} - * @property {number} REFERENCE_ROUTE_UNSPECIFIED=0 REFERENCE_ROUTE_UNSPECIFIED value - * @property {number} FUEL_EFFICIENT=1 FUEL_EFFICIENT value - * @property {number} SHORTER_DISTANCE=2 SHORTER_DISTANCE value - */ - ComputeRoutesRequest.ReferenceRoute = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REFERENCE_ROUTE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FUEL_EFFICIENT"] = 1; - values[valuesById[2] = "SHORTER_DISTANCE"] = 2; - return values; - })(); - - /** - * ExtraComputation enum. - * @name google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation - * @enum {number} - * @property {number} EXTRA_COMPUTATION_UNSPECIFIED=0 EXTRA_COMPUTATION_UNSPECIFIED value - * @property {number} TOLLS=1 TOLLS value - * @property {number} FUEL_CONSUMPTION=2 FUEL_CONSUMPTION value - * @property {number} TRAFFIC_ON_POLYLINE=3 TRAFFIC_ON_POLYLINE value - * @property {number} HTML_FORMATTED_NAVIGATION_INSTRUCTIONS=4 HTML_FORMATTED_NAVIGATION_INSTRUCTIONS value - * @property {number} FLYOVER_INFO_ON_POLYLINE=7 FLYOVER_INFO_ON_POLYLINE value - * @property {number} NARROW_ROAD_INFO_ON_POLYLINE=8 NARROW_ROAD_INFO_ON_POLYLINE value - */ - ComputeRoutesRequest.ExtraComputation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXTRA_COMPUTATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "TOLLS"] = 1; - values[valuesById[2] = "FUEL_CONSUMPTION"] = 2; - values[valuesById[3] = "TRAFFIC_ON_POLYLINE"] = 3; - values[valuesById[4] = "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS"] = 4; - values[valuesById[7] = "FLYOVER_INFO_ON_POLYLINE"] = 7; - values[valuesById[8] = "NARROW_ROAD_INFO_ON_POLYLINE"] = 8; - return values; - })(); - - return ComputeRoutesRequest; - })(); - - v2.ComputeRoutesResponse = (function() { - - /** - * Properties of a ComputeRoutesResponse. - * @memberof google.maps.routing.v2 - * @interface IComputeRoutesResponse - * @property {Array.|null} [routes] ComputeRoutesResponse routes - * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] ComputeRoutesResponse fallbackInfo - * @property {google.maps.routing.v2.IGeocodingResults|null} [geocodingResults] ComputeRoutesResponse geocodingResults - */ - - /** - * Constructs a new ComputeRoutesResponse. - * @memberof google.maps.routing.v2 - * @classdesc Represents a ComputeRoutesResponse. - * @implements IComputeRoutesResponse - * @constructor - * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set - */ - function ComputeRoutesResponse(properties) { - this.routes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeRoutesResponse routes. - * @member {Array.} routes - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @instance - */ - ComputeRoutesResponse.prototype.routes = $util.emptyArray; - - /** - * ComputeRoutesResponse fallbackInfo. - * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @instance - */ - ComputeRoutesResponse.prototype.fallbackInfo = null; - - /** - * ComputeRoutesResponse geocodingResults. - * @member {google.maps.routing.v2.IGeocodingResults|null|undefined} geocodingResults - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @instance - */ - ComputeRoutesResponse.prototype.geocodingResults = null; - - /** - * Creates a new ComputeRoutesResponse instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set - * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse instance - */ - ComputeRoutesResponse.create = function create(properties) { - return new ComputeRoutesResponse(properties); - }; - - /** - * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRoutesResponse.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.routing.v2.Route.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) - $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.geocodingResults != null && Object.hasOwnProperty.call(message, "geocodingResults")) - $root.google.maps.routing.v2.GeocodingResults.encode(message.geocodingResults, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeRoutesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRoutesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.routes && message.routes.length)) - message.routes = []; - message.routes.push($root.google.maps.routing.v2.Route.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); - break; - } - case 3: { - message.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRoutesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeRoutesResponse message. - * @function verify - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeRoutesResponse.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.routing.v2.Route.verify(message.routes[i]); - if (error) - return "routes." + error; - } - } - if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { - var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); - if (error) - return "fallbackInfo." + error; - } - if (message.geocodingResults != null && message.hasOwnProperty("geocodingResults")) { - var error = $root.google.maps.routing.v2.GeocodingResults.verify(message.geocodingResults); - if (error) - return "geocodingResults." + error; - } - return null; - }; - - /** - * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse - */ - ComputeRoutesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.ComputeRoutesResponse) - return object; - var message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); - if (object.routes) { - if (!Array.isArray(object.routes)) - throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: array expected"); - message.routes = []; - for (var i = 0; i < object.routes.length; ++i) { - if (typeof object.routes[i] !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: object expected"); - message.routes[i] = $root.google.maps.routing.v2.Route.fromObject(object.routes[i]); - } - } - if (object.fallbackInfo != null) { - if (typeof object.fallbackInfo !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.fallbackInfo: object expected"); - message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); - } - if (object.geocodingResults != null) { - if (typeof object.geocodingResults !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.geocodingResults: object expected"); - message.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.fromObject(object.geocodingResults); - } - return message; - }; - - /** - * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {google.maps.routing.v2.ComputeRoutesResponse} message ComputeRoutesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeRoutesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.routes = []; - if (options.defaults) { - object.fallbackInfo = null; - object.geocodingResults = null; - } - if (message.routes && message.routes.length) { - object.routes = []; - for (var j = 0; j < message.routes.length; ++j) - object.routes[j] = $root.google.maps.routing.v2.Route.toObject(message.routes[j], options); - } - if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) - object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); - if (message.geocodingResults != null && message.hasOwnProperty("geocodingResults")) - object.geocodingResults = $root.google.maps.routing.v2.GeocodingResults.toObject(message.geocodingResults, options); - return object; - }; - - /** - * Converts this ComputeRoutesResponse to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @instance - * @returns {Object.} JSON object - */ - ComputeRoutesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeRoutesResponse - * @function getTypeUrl - * @memberof google.maps.routing.v2.ComputeRoutesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesResponse"; - }; - - return ComputeRoutesResponse; - })(); - - v2.ComputeRouteMatrixRequest = (function() { - - /** - * Properties of a ComputeRouteMatrixRequest. - * @memberof google.maps.routing.v2 - * @interface IComputeRouteMatrixRequest - * @property {Array.|null} [origins] ComputeRouteMatrixRequest origins - * @property {Array.|null} [destinations] ComputeRouteMatrixRequest destinations - * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRouteMatrixRequest travelMode - * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRouteMatrixRequest routingPreference - * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRouteMatrixRequest departureTime - * @property {google.protobuf.ITimestamp|null} [arrivalTime] ComputeRouteMatrixRequest arrivalTime - * @property {string|null} [languageCode] ComputeRouteMatrixRequest languageCode - * @property {string|null} [regionCode] ComputeRouteMatrixRequest regionCode - * @property {google.maps.routing.v2.Units|null} [units] ComputeRouteMatrixRequest units - * @property {Array.|null} [extraComputations] ComputeRouteMatrixRequest extraComputations - * @property {google.maps.routing.v2.TrafficModel|null} [trafficModel] ComputeRouteMatrixRequest trafficModel - * @property {google.maps.routing.v2.ITransitPreferences|null} [transitPreferences] ComputeRouteMatrixRequest transitPreferences - */ - - /** - * Constructs a new ComputeRouteMatrixRequest. - * @memberof google.maps.routing.v2 - * @classdesc Represents a ComputeRouteMatrixRequest. - * @implements IComputeRouteMatrixRequest - * @constructor - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set - */ - function ComputeRouteMatrixRequest(properties) { - this.origins = []; - this.destinations = []; - this.extraComputations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeRouteMatrixRequest origins. - * @member {Array.} origins - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.origins = $util.emptyArray; - - /** - * ComputeRouteMatrixRequest destinations. - * @member {Array.} destinations - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.destinations = $util.emptyArray; - - /** - * ComputeRouteMatrixRequest travelMode. - * @member {google.maps.routing.v2.RouteTravelMode} travelMode - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.travelMode = 0; - - /** - * ComputeRouteMatrixRequest routingPreference. - * @member {google.maps.routing.v2.RoutingPreference} routingPreference - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.routingPreference = 0; - - /** - * ComputeRouteMatrixRequest departureTime. - * @member {google.protobuf.ITimestamp|null|undefined} departureTime - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.departureTime = null; - - /** - * ComputeRouteMatrixRequest arrivalTime. - * @member {google.protobuf.ITimestamp|null|undefined} arrivalTime - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.arrivalTime = null; - - /** - * ComputeRouteMatrixRequest languageCode. - * @member {string} languageCode - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.languageCode = ""; - - /** - * ComputeRouteMatrixRequest regionCode. - * @member {string} regionCode - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.regionCode = ""; - - /** - * ComputeRouteMatrixRequest units. - * @member {google.maps.routing.v2.Units} units - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.units = 0; - - /** - * ComputeRouteMatrixRequest extraComputations. - * @member {Array.} extraComputations - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.extraComputations = $util.emptyArray; - - /** - * ComputeRouteMatrixRequest trafficModel. - * @member {google.maps.routing.v2.TrafficModel} trafficModel - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.trafficModel = 0; - - /** - * ComputeRouteMatrixRequest transitPreferences. - * @member {google.maps.routing.v2.ITransitPreferences|null|undefined} transitPreferences - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - */ - ComputeRouteMatrixRequest.prototype.transitPreferences = null; - - /** - * Creates a new ComputeRouteMatrixRequest instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set - * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest instance - */ - ComputeRouteMatrixRequest.create = function create(properties) { - return new ComputeRouteMatrixRequest(properties); - }; - - /** - * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRouteMatrixRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.origins != null && message.origins.length) - for (var i = 0; i < message.origins.length; ++i) - $root.google.maps.routing.v2.RouteMatrixOrigin.encode(message.origins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.destinations != null && message.destinations.length) - for (var i = 0; i < message.destinations.length; ++i) - $root.google.maps.routing.v2.RouteMatrixDestination.encode(message.destinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.travelMode); - if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.routingPreference); - if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) - $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); - if (message.units != null && Object.hasOwnProperty.call(message, "units")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.units); - if (message.extraComputations != null && message.extraComputations.length) { - writer.uint32(/* id 8, wireType 2 =*/66).fork(); - for (var i = 0; i < message.extraComputations.length; ++i) - writer.int32(message.extraComputations[i]); - writer.ldelim(); - } - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.regionCode); - if (message.trafficModel != null && Object.hasOwnProperty.call(message, "trafficModel")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.trafficModel); - if (message.arrivalTime != null && Object.hasOwnProperty.call(message, "arrivalTime")) - $root.google.protobuf.Timestamp.encode(message.arrivalTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.transitPreferences != null && Object.hasOwnProperty.call(message, "transitPreferences")) - $root.google.maps.routing.v2.TransitPreferences.encode(message.transitPreferences, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeRouteMatrixRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRouteMatrixRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.origins && message.origins.length)) - message.origins = []; - message.origins.push($root.google.maps.routing.v2.RouteMatrixOrigin.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - message.destinations.push($root.google.maps.routing.v2.RouteMatrixDestination.decode(reader, reader.uint32())); - break; - } - case 3: { - message.travelMode = reader.int32(); - break; - } - case 4: { - message.routingPreference = reader.int32(); - break; - } - case 5: { - message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.arrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.languageCode = reader.string(); - break; - } - case 9: { - message.regionCode = reader.string(); - break; - } - case 7: { - message.units = reader.int32(); - break; - } - case 8: { - if (!(message.extraComputations && message.extraComputations.length)) - message.extraComputations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.extraComputations.push(reader.int32()); - } else - message.extraComputations.push(reader.int32()); - break; - } - case 10: { - message.trafficModel = reader.int32(); - break; - } - case 12: { - message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeRouteMatrixRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeRouteMatrixRequest message. - * @function verify - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeRouteMatrixRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.origins != null && message.hasOwnProperty("origins")) { - if (!Array.isArray(message.origins)) - return "origins: array expected"; - for (var i = 0; i < message.origins.length; ++i) { - var error = $root.google.maps.routing.v2.RouteMatrixOrigin.verify(message.origins[i]); - if (error) - return "origins." + error; - } - } - 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) { - var error = $root.google.maps.routing.v2.RouteMatrixDestination.verify(message.destinations[i]); - if (error) - return "destinations." + error; - } - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - switch (message.travelMode) { - default: - return "travelMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 7: - break; - } - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - switch (message.routingPreference) { - default: - return "routingPreference: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.departureTime != null && message.hasOwnProperty("departureTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.departureTime); - if (error) - return "departureTime." + error; - } - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.arrivalTime); - if (error) - return "arrivalTime." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.units != null && message.hasOwnProperty("units")) - switch (message.units) { - default: - return "units: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.extraComputations != null && message.hasOwnProperty("extraComputations")) { - if (!Array.isArray(message.extraComputations)) - return "extraComputations: array expected"; - for (var i = 0; i < message.extraComputations.length; ++i) - switch (message.extraComputations[i]) { - default: - return "extraComputations: enum value[] expected"; - case 0: - case 1: - break; - } - } - if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) - switch (message.trafficModel) { - default: - return "trafficModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) { - var error = $root.google.maps.routing.v2.TransitPreferences.verify(message.transitPreferences); - if (error) - return "transitPreferences." + error; - } - return null; - }; - - /** - * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest - */ - ComputeRouteMatrixRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.ComputeRouteMatrixRequest) - return object; - var message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); - if (object.origins) { - if (!Array.isArray(object.origins)) - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: array expected"); - message.origins = []; - for (var i = 0; i < object.origins.length; ++i) { - if (typeof object.origins[i] !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: object expected"); - message.origins[i] = $root.google.maps.routing.v2.RouteMatrixOrigin.fromObject(object.origins[i]); - } - } - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) { - if (typeof object.destinations[i] !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: object expected"); - message.destinations[i] = $root.google.maps.routing.v2.RouteMatrixDestination.fromObject(object.destinations[i]); - } - } - 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 "DRIVE": - case 1: - message.travelMode = 1; - break; - case "BICYCLE": - case 2: - message.travelMode = 2; - break; - case "WALK": - case 3: - message.travelMode = 3; - break; - case "TWO_WHEELER": - case 4: - message.travelMode = 4; - break; - case "TRANSIT": - case 7: - message.travelMode = 7; - break; - } - switch (object.routingPreference) { - default: - if (typeof object.routingPreference === "number") { - message.routingPreference = object.routingPreference; - break; - } - break; - case "ROUTING_PREFERENCE_UNSPECIFIED": - case 0: - message.routingPreference = 0; - break; - case "TRAFFIC_UNAWARE": - case 1: - message.routingPreference = 1; - break; - case "TRAFFIC_AWARE": - case 2: - message.routingPreference = 2; - break; - case "TRAFFIC_AWARE_OPTIMAL": - case 3: - message.routingPreference = 3; - break; - } - if (object.departureTime != null) { - if (typeof object.departureTime !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.departureTime: object expected"); - message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); - } - if (object.arrivalTime != null) { - if (typeof object.arrivalTime !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.arrivalTime: object expected"); - message.arrivalTime = $root.google.protobuf.Timestamp.fromObject(object.arrivalTime); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.units) { - default: - if (typeof object.units === "number") { - message.units = object.units; - break; - } - break; - case "UNITS_UNSPECIFIED": - case 0: - message.units = 0; - break; - case "METRIC": - case 1: - message.units = 1; - break; - case "IMPERIAL": - case 2: - message.units = 2; - break; - } - if (object.extraComputations) { - if (!Array.isArray(object.extraComputations)) - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.extraComputations: array expected"); - message.extraComputations = []; - for (var i = 0; i < object.extraComputations.length; ++i) - switch (object.extraComputations[i]) { - default: - if (typeof object.extraComputations[i] === "number") { - message.extraComputations[i] = object.extraComputations[i]; - break; - } - case "EXTRA_COMPUTATION_UNSPECIFIED": - case 0: - message.extraComputations[i] = 0; - break; - case "TOLLS": - case 1: - message.extraComputations[i] = 1; - break; - } - } - switch (object.trafficModel) { - default: - if (typeof object.trafficModel === "number") { - message.trafficModel = object.trafficModel; - break; - } - break; - case "TRAFFIC_MODEL_UNSPECIFIED": - case 0: - message.trafficModel = 0; - break; - case "BEST_GUESS": - case 1: - message.trafficModel = 1; - break; - case "PESSIMISTIC": - case 2: - message.trafficModel = 2; - break; - case "OPTIMISTIC": - case 3: - message.trafficModel = 3; - break; - } - if (object.transitPreferences != null) { - if (typeof object.transitPreferences !== "object") - throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.transitPreferences: object expected"); - message.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.fromObject(object.transitPreferences); - } - return message; - }; - - /** - * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {google.maps.routing.v2.ComputeRouteMatrixRequest} message ComputeRouteMatrixRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeRouteMatrixRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.origins = []; - object.destinations = []; - object.extraComputations = []; - } - if (options.defaults) { - object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; - object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; - object.departureTime = null; - object.languageCode = ""; - object.units = options.enums === String ? "UNITS_UNSPECIFIED" : 0; - object.regionCode = ""; - object.trafficModel = options.enums === String ? "TRAFFIC_MODEL_UNSPECIFIED" : 0; - object.arrivalTime = null; - object.transitPreferences = null; - } - if (message.origins && message.origins.length) { - object.origins = []; - for (var j = 0; j < message.origins.length; ++j) - object.origins[j] = $root.google.maps.routing.v2.RouteMatrixOrigin.toObject(message.origins[j], options); - } - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = $root.google.maps.routing.v2.RouteMatrixDestination.toObject(message.destinations[j], options); - } - if (message.travelMode != null && message.hasOwnProperty("travelMode")) - object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; - if (message.departureTime != null && message.hasOwnProperty("departureTime")) - object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.units != null && message.hasOwnProperty("units")) - object.units = options.enums === String ? $root.google.maps.routing.v2.Units[message.units] === undefined ? message.units : $root.google.maps.routing.v2.Units[message.units] : message.units; - if (message.extraComputations && message.extraComputations.length) { - object.extraComputations = []; - for (var j = 0; j < message.extraComputations.length; ++j) - object.extraComputations[j] = options.enums === String ? $root.google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[message.extraComputations[j]] === undefined ? message.extraComputations[j] : $root.google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation[message.extraComputations[j]] : message.extraComputations[j]; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.trafficModel != null && message.hasOwnProperty("trafficModel")) - object.trafficModel = options.enums === String ? $root.google.maps.routing.v2.TrafficModel[message.trafficModel] === undefined ? message.trafficModel : $root.google.maps.routing.v2.TrafficModel[message.trafficModel] : message.trafficModel; - if (message.arrivalTime != null && message.hasOwnProperty("arrivalTime")) - object.arrivalTime = $root.google.protobuf.Timestamp.toObject(message.arrivalTime, options); - if (message.transitPreferences != null && message.hasOwnProperty("transitPreferences")) - object.transitPreferences = $root.google.maps.routing.v2.TransitPreferences.toObject(message.transitPreferences, options); - return object; - }; - - /** - * Converts this ComputeRouteMatrixRequest to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @instance - * @returns {Object.} JSON object - */ - ComputeRouteMatrixRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeRouteMatrixRequest - * @function getTypeUrl - * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeRouteMatrixRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.ComputeRouteMatrixRequest"; - }; - - /** - * ExtraComputation enum. - * @name google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation - * @enum {number} - * @property {number} EXTRA_COMPUTATION_UNSPECIFIED=0 EXTRA_COMPUTATION_UNSPECIFIED value - * @property {number} TOLLS=1 TOLLS value - */ - ComputeRouteMatrixRequest.ExtraComputation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXTRA_COMPUTATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "TOLLS"] = 1; - return values; - })(); - - return ComputeRouteMatrixRequest; - })(); - - v2.RouteMatrixOrigin = (function() { - - /** - * Properties of a RouteMatrixOrigin. - * @memberof google.maps.routing.v2 - * @interface IRouteMatrixOrigin - * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixOrigin waypoint - * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] RouteMatrixOrigin routeModifiers - */ - - /** - * Constructs a new RouteMatrixOrigin. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteMatrixOrigin. - * @implements IRouteMatrixOrigin - * @constructor - * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set - */ - function RouteMatrixOrigin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteMatrixOrigin waypoint. - * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @instance - */ - RouteMatrixOrigin.prototype.waypoint = null; - - /** - * RouteMatrixOrigin routeModifiers. - * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @instance - */ - RouteMatrixOrigin.prototype.routeModifiers = null; - - /** - * Creates a new RouteMatrixOrigin instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin instance - */ - RouteMatrixOrigin.create = function create(properties) { - return new RouteMatrixOrigin(properties); - }; - - /** - * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixOrigin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) - $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) - $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixOrigin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteMatrixOrigin message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixOrigin.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); - break; - } - case 2: { - message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixOrigin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteMatrixOrigin message. - * @function verify - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteMatrixOrigin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.waypoint != null && message.hasOwnProperty("waypoint")) { - var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); - if (error) - return "waypoint." + error; - } - if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { - var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); - if (error) - return "routeModifiers." + error; - } - return null; - }; - - /** - * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin - */ - RouteMatrixOrigin.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteMatrixOrigin) - return object; - var message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); - if (object.waypoint != null) { - if (typeof object.waypoint !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.waypoint: object expected"); - message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); - } - if (object.routeModifiers != null) { - if (typeof object.routeModifiers !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.routeModifiers: object expected"); - message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); - } - return message; - }; - - /** - * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {google.maps.routing.v2.RouteMatrixOrigin} message RouteMatrixOrigin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteMatrixOrigin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.waypoint = null; - object.routeModifiers = null; - } - if (message.waypoint != null && message.hasOwnProperty("waypoint")) - object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); - if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) - object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); - return object; - }; - - /** - * Converts this RouteMatrixOrigin to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @instance - * @returns {Object.} JSON object - */ - RouteMatrixOrigin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteMatrixOrigin - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteMatrixOrigin - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteMatrixOrigin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixOrigin"; - }; - - return RouteMatrixOrigin; - })(); - - v2.RouteMatrixDestination = (function() { - - /** - * Properties of a RouteMatrixDestination. - * @memberof google.maps.routing.v2 - * @interface IRouteMatrixDestination - * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixDestination waypoint - */ - - /** - * Constructs a new RouteMatrixDestination. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteMatrixDestination. - * @implements IRouteMatrixDestination - * @constructor - * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set - */ - function RouteMatrixDestination(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteMatrixDestination waypoint. - * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @instance - */ - RouteMatrixDestination.prototype.waypoint = null; - - /** - * Creates a new RouteMatrixDestination instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination instance - */ - RouteMatrixDestination.create = function create(properties) { - return new RouteMatrixDestination(properties); - }; - - /** - * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) - $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteMatrixDestination message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixDestination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteMatrixDestination message. - * @function verify - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteMatrixDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.waypoint != null && message.hasOwnProperty("waypoint")) { - var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); - if (error) - return "waypoint." + error; - } - return null; - }; - - /** - * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination - */ - RouteMatrixDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteMatrixDestination) - return object; - var message = new $root.google.maps.routing.v2.RouteMatrixDestination(); - if (object.waypoint != null) { - if (typeof object.waypoint !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixDestination.waypoint: object expected"); - message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); - } - return message; - }; - - /** - * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {google.maps.routing.v2.RouteMatrixDestination} message RouteMatrixDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteMatrixDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.waypoint = null; - if (message.waypoint != null && message.hasOwnProperty("waypoint")) - object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); - return object; - }; - - /** - * Converts this RouteMatrixDestination to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @instance - * @returns {Object.} JSON object - */ - RouteMatrixDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteMatrixDestination - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteMatrixDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteMatrixDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixDestination"; - }; - - return RouteMatrixDestination; - })(); - - v2.RouteMatrixElement = (function() { - - /** - * Properties of a RouteMatrixElement. - * @memberof google.maps.routing.v2 - * @interface IRouteMatrixElement - * @property {number|null} [originIndex] RouteMatrixElement originIndex - * @property {number|null} [destinationIndex] RouteMatrixElement destinationIndex - * @property {google.rpc.IStatus|null} [status] RouteMatrixElement status - * @property {google.maps.routing.v2.RouteMatrixElementCondition|null} [condition] RouteMatrixElement condition - * @property {number|null} [distanceMeters] RouteMatrixElement distanceMeters - * @property {google.protobuf.IDuration|null} [duration] RouteMatrixElement duration - * @property {google.protobuf.IDuration|null} [staticDuration] RouteMatrixElement staticDuration - * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] RouteMatrixElement travelAdvisory - * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] RouteMatrixElement fallbackInfo - * @property {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null} [localizedValues] RouteMatrixElement localizedValues - */ - - /** - * Constructs a new RouteMatrixElement. - * @memberof google.maps.routing.v2 - * @classdesc Represents a RouteMatrixElement. - * @implements IRouteMatrixElement - * @constructor - * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set - */ - function RouteMatrixElement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RouteMatrixElement originIndex. - * @member {number|null|undefined} originIndex - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.originIndex = null; - - /** - * RouteMatrixElement destinationIndex. - * @member {number|null|undefined} destinationIndex - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.destinationIndex = null; - - /** - * RouteMatrixElement status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.status = null; - - /** - * RouteMatrixElement condition. - * @member {google.maps.routing.v2.RouteMatrixElementCondition} condition - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.condition = 0; - - /** - * RouteMatrixElement distanceMeters. - * @member {number} distanceMeters - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.distanceMeters = 0; - - /** - * RouteMatrixElement duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.duration = null; - - /** - * RouteMatrixElement staticDuration. - * @member {google.protobuf.IDuration|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.staticDuration = null; - - /** - * RouteMatrixElement travelAdvisory. - * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.travelAdvisory = null; - - /** - * RouteMatrixElement fallbackInfo. - * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.fallbackInfo = null; - - /** - * RouteMatrixElement localizedValues. - * @member {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues|null|undefined} localizedValues - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - */ - RouteMatrixElement.prototype.localizedValues = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RouteMatrixElement.prototype, "_originIndex", { - get: $util.oneOfGetter($oneOfFields = ["originIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RouteMatrixElement.prototype, "_destinationIndex", { - get: $util.oneOfGetter($oneOfFields = ["destinationIndex"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RouteMatrixElement instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement instance - */ - RouteMatrixElement.create = function create(properties) { - return new RouteMatrixElement(properties); - }; - - /** - * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixElement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.originIndex != null && Object.hasOwnProperty.call(message, "originIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.originIndex); - if (message.destinationIndex != null && Object.hasOwnProperty.call(message, "destinationIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.destinationIndex); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.distanceMeters); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) - $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) - $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.condition); - if (message.localizedValues != null && Object.hasOwnProperty.call(message, "localizedValues")) - $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.encode(message.localizedValues, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RouteMatrixElement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RouteMatrixElement message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixElement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixElement(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.originIndex = reader.int32(); - break; - } - case 2: { - message.destinationIndex = reader.int32(); - break; - } - case 3: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 9: { - message.condition = reader.int32(); - break; - } - case 4: { - message.distanceMeters = reader.int32(); - break; - } - case 5: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 7: { - message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); - break; - } - case 8: { - message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); - break; - } - case 10: { - message.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RouteMatrixElement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RouteMatrixElement message. - * @function verify - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RouteMatrixElement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.originIndex != null && message.hasOwnProperty("originIndex")) { - properties._originIndex = 1; - if (!$util.isInteger(message.originIndex)) - return "originIndex: integer expected"; - } - if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { - properties._destinationIndex = 1; - if (!$util.isInteger(message.destinationIndex)) - return "destinationIndex: integer expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.condition != null && message.hasOwnProperty("condition")) - switch (message.condition) { - default: - return "condition: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - if (!$util.isInteger(message.distanceMeters)) - return "distanceMeters: integer expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.protobuf.Duration.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { - var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); - if (error) - return "travelAdvisory." + error; - } - if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { - var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); - if (error) - return "fallbackInfo." + error; - } - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) { - var error = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify(message.localizedValues); - if (error) - return "localizedValues." + error; - } - return null; - }; - - /** - * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement - */ - RouteMatrixElement.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteMatrixElement) - return object; - var message = new $root.google.maps.routing.v2.RouteMatrixElement(); - if (object.originIndex != null) - message.originIndex = object.originIndex | 0; - if (object.destinationIndex != null) - message.destinationIndex = object.destinationIndex | 0; - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - switch (object.condition) { - default: - if (typeof object.condition === "number") { - message.condition = object.condition; - break; - } - break; - case "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": - case 0: - message.condition = 0; - break; - case "ROUTE_EXISTS": - case 1: - message.condition = 1; - break; - case "ROUTE_NOT_FOUND": - case 2: - message.condition = 2; - break; - } - if (object.distanceMeters != null) - message.distanceMeters = object.distanceMeters | 0; - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.staticDuration: object expected"); - message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); - } - if (object.travelAdvisory != null) { - if (typeof object.travelAdvisory !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.travelAdvisory: object expected"); - message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); - } - if (object.fallbackInfo != null) { - if (typeof object.fallbackInfo !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.fallbackInfo: object expected"); - message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); - } - if (object.localizedValues != null) { - if (typeof object.localizedValues !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.localizedValues: object expected"); - message.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.fromObject(object.localizedValues); - } - return message; - }; - - /** - * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {google.maps.routing.v2.RouteMatrixElement} message RouteMatrixElement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouteMatrixElement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = null; - object.distanceMeters = 0; - object.duration = null; - object.staticDuration = null; - object.travelAdvisory = null; - object.fallbackInfo = null; - object.condition = options.enums === String ? "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED" : 0; - object.localizedValues = null; - } - if (message.originIndex != null && message.hasOwnProperty("originIndex")) { - object.originIndex = message.originIndex; - if (options.oneofs) - object._originIndex = "originIndex"; - } - if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { - object.destinationIndex = message.destinationIndex; - if (options.oneofs) - object._destinationIndex = "destinationIndex"; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) - object.distanceMeters = message.distanceMeters; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); - if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) - object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); - if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) - object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.maps.routing.v2.RouteMatrixElementCondition[message.condition] === undefined ? message.condition : $root.google.maps.routing.v2.RouteMatrixElementCondition[message.condition] : message.condition; - if (message.localizedValues != null && message.hasOwnProperty("localizedValues")) - object.localizedValues = $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues.toObject(message.localizedValues, options); - return object; - }; - - /** - * Converts this RouteMatrixElement to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteMatrixElement - * @instance - * @returns {Object.} JSON object - */ - RouteMatrixElement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RouteMatrixElement - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteMatrixElement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouteMatrixElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixElement"; - }; - - RouteMatrixElement.LocalizedValues = (function() { - - /** - * Properties of a LocalizedValues. - * @memberof google.maps.routing.v2.RouteMatrixElement - * @interface ILocalizedValues - * @property {google.type.ILocalizedText|null} [distance] LocalizedValues distance - * @property {google.type.ILocalizedText|null} [duration] LocalizedValues duration - * @property {google.type.ILocalizedText|null} [staticDuration] LocalizedValues staticDuration - * @property {google.type.ILocalizedText|null} [transitFare] LocalizedValues transitFare - */ - - /** - * Constructs a new LocalizedValues. - * @memberof google.maps.routing.v2.RouteMatrixElement - * @classdesc Represents a LocalizedValues. - * @implements ILocalizedValues - * @constructor - * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues=} [properties] Properties to set - */ - function LocalizedValues(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocalizedValues distance. - * @member {google.type.ILocalizedText|null|undefined} distance - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @instance - */ - LocalizedValues.prototype.distance = null; - - /** - * LocalizedValues duration. - * @member {google.type.ILocalizedText|null|undefined} duration - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @instance - */ - LocalizedValues.prototype.duration = null; - - /** - * LocalizedValues staticDuration. - * @member {google.type.ILocalizedText|null|undefined} staticDuration - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @instance - */ - LocalizedValues.prototype.staticDuration = null; - - /** - * LocalizedValues transitFare. - * @member {google.type.ILocalizedText|null|undefined} transitFare - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @instance - */ - LocalizedValues.prototype.transitFare = null; - - /** - * Creates a new LocalizedValues instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues=} [properties] Properties to set - * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues instance - */ - LocalizedValues.create = function create(properties) { - return new LocalizedValues(properties); - }; - - /** - * Encodes the specified LocalizedValues message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues} message LocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) - $root.google.type.LocalizedText.encode(message.distance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.type.LocalizedText.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) - $root.google.type.LocalizedText.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.transitFare != null && Object.hasOwnProperty.call(message, "transitFare")) - $root.google.type.LocalizedText.encode(message.transitFare, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LocalizedValues message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.LocalizedValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {google.maps.routing.v2.RouteMatrixElement.ILocalizedValues} message LocalizedValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalizedValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocalizedValues message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedValues.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.distance = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 2: { - message.duration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 3: { - message.staticDuration = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - case 4: { - message.transitFare = $root.google.type.LocalizedText.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocalizedValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalizedValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocalizedValues message. - * @function verify - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocalizedValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.distance != null && message.hasOwnProperty("distance")) { - var error = $root.google.type.LocalizedText.verify(message.distance); - if (error) - return "distance." + error; - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.type.LocalizedText.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { - var error = $root.google.type.LocalizedText.verify(message.staticDuration); - if (error) - return "staticDuration." + error; - } - if (message.transitFare != null && message.hasOwnProperty("transitFare")) { - var error = $root.google.type.LocalizedText.verify(message.transitFare); - if (error) - return "transitFare." + error; - } - return null; - }; - - /** - * Creates a LocalizedValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} LocalizedValues - */ - LocalizedValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues) - return object; - var message = new $root.google.maps.routing.v2.RouteMatrixElement.LocalizedValues(); - if (object.distance != null) { - if (typeof object.distance !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.distance: object expected"); - message.distance = $root.google.type.LocalizedText.fromObject(object.distance); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.duration: object expected"); - message.duration = $root.google.type.LocalizedText.fromObject(object.duration); - } - if (object.staticDuration != null) { - if (typeof object.staticDuration !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.staticDuration: object expected"); - message.staticDuration = $root.google.type.LocalizedText.fromObject(object.staticDuration); - } - if (object.transitFare != null) { - if (typeof object.transitFare !== "object") - throw TypeError(".google.maps.routing.v2.RouteMatrixElement.LocalizedValues.transitFare: object expected"); - message.transitFare = $root.google.type.LocalizedText.fromObject(object.transitFare); - } - return message; - }; - - /** - * Creates a plain object from a LocalizedValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {google.maps.routing.v2.RouteMatrixElement.LocalizedValues} message LocalizedValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocalizedValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.distance = null; - object.duration = null; - object.staticDuration = null; - object.transitFare = null; - } - if (message.distance != null && message.hasOwnProperty("distance")) - object.distance = $root.google.type.LocalizedText.toObject(message.distance, options); - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.type.LocalizedText.toObject(message.duration, options); - if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) - object.staticDuration = $root.google.type.LocalizedText.toObject(message.staticDuration, options); - if (message.transitFare != null && message.hasOwnProperty("transitFare")) - object.transitFare = $root.google.type.LocalizedText.toObject(message.transitFare, options); - return object; - }; - - /** - * Converts this LocalizedValues to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @instance - * @returns {Object.} JSON object - */ - LocalizedValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocalizedValues - * @function getTypeUrl - * @memberof google.maps.routing.v2.RouteMatrixElement.LocalizedValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocalizedValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixElement.LocalizedValues"; - }; - - return LocalizedValues; - })(); - - return RouteMatrixElement; - })(); - - /** - * RouteMatrixElementCondition enum. - * @name google.maps.routing.v2.RouteMatrixElementCondition - * @enum {number} - * @property {number} ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED=0 ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED value - * @property {number} ROUTE_EXISTS=1 ROUTE_EXISTS value - * @property {number} ROUTE_NOT_FOUND=2 ROUTE_NOT_FOUND value - */ - v2.RouteMatrixElementCondition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ROUTE_EXISTS"] = 1; - values[valuesById[2] = "ROUTE_NOT_FOUND"] = 2; - return values; - })(); - - /** - * RoutingPreference enum. - * @name google.maps.routing.v2.RoutingPreference - * @enum {number} - * @property {number} ROUTING_PREFERENCE_UNSPECIFIED=0 ROUTING_PREFERENCE_UNSPECIFIED value - * @property {number} TRAFFIC_UNAWARE=1 TRAFFIC_UNAWARE value - * @property {number} TRAFFIC_AWARE=2 TRAFFIC_AWARE value - * @property {number} TRAFFIC_AWARE_OPTIMAL=3 TRAFFIC_AWARE_OPTIMAL value - */ - v2.RoutingPreference = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROUTING_PREFERENCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRAFFIC_UNAWARE"] = 1; - values[valuesById[2] = "TRAFFIC_AWARE"] = 2; - values[valuesById[3] = "TRAFFIC_AWARE_OPTIMAL"] = 3; - return values; - })(); - - /** - * TrafficModel enum. - * @name google.maps.routing.v2.TrafficModel - * @enum {number} - * @property {number} TRAFFIC_MODEL_UNSPECIFIED=0 TRAFFIC_MODEL_UNSPECIFIED value - * @property {number} BEST_GUESS=1 BEST_GUESS value - * @property {number} PESSIMISTIC=2 PESSIMISTIC value - * @property {number} OPTIMISTIC=3 OPTIMISTIC value - */ - v2.TrafficModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAFFIC_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "BEST_GUESS"] = 1; - values[valuesById[2] = "PESSIMISTIC"] = 2; - values[valuesById[3] = "OPTIMISTIC"] = 3; - return values; - })(); - - v2.TransitPreferences = (function() { - - /** - * Properties of a TransitPreferences. - * @memberof google.maps.routing.v2 - * @interface ITransitPreferences - * @property {Array.|null} [allowedTravelModes] TransitPreferences allowedTravelModes - * @property {google.maps.routing.v2.TransitPreferences.TransitRoutingPreference|null} [routingPreference] TransitPreferences routingPreference - */ - - /** - * Constructs a new TransitPreferences. - * @memberof google.maps.routing.v2 - * @classdesc Represents a TransitPreferences. - * @implements ITransitPreferences - * @constructor - * @param {google.maps.routing.v2.ITransitPreferences=} [properties] Properties to set - */ - function TransitPreferences(properties) { - this.allowedTravelModes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransitPreferences allowedTravelModes. - * @member {Array.} allowedTravelModes - * @memberof google.maps.routing.v2.TransitPreferences - * @instance - */ - TransitPreferences.prototype.allowedTravelModes = $util.emptyArray; - - /** - * TransitPreferences routingPreference. - * @member {google.maps.routing.v2.TransitPreferences.TransitRoutingPreference} routingPreference - * @memberof google.maps.routing.v2.TransitPreferences - * @instance - */ - TransitPreferences.prototype.routingPreference = 0; - - /** - * Creates a new TransitPreferences instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {google.maps.routing.v2.ITransitPreferences=} [properties] Properties to set - * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences instance - */ - TransitPreferences.create = function create(properties) { - return new TransitPreferences(properties); - }; - - /** - * Encodes the specified TransitPreferences message. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {google.maps.routing.v2.ITransitPreferences} message TransitPreferences message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitPreferences.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedTravelModes != null && message.allowedTravelModes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.allowedTravelModes.length; ++i) - writer.int32(message.allowedTravelModes[i]); - writer.ldelim(); - } - if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.routingPreference); - return writer; - }; - - /** - * Encodes the specified TransitPreferences message, length delimited. Does not implicitly {@link google.maps.routing.v2.TransitPreferences.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {google.maps.routing.v2.ITransitPreferences} message TransitPreferences message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitPreferences.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitPreferences message from the specified reader or buffer. - * @function decode - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitPreferences.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TransitPreferences(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedTravelModes && message.allowedTravelModes.length)) - message.allowedTravelModes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.allowedTravelModes.push(reader.int32()); - } else - message.allowedTravelModes.push(reader.int32()); - break; - } - case 2: { - message.routingPreference = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitPreferences message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitPreferences.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitPreferences message. - * @function verify - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitPreferences.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedTravelModes != null && message.hasOwnProperty("allowedTravelModes")) { - if (!Array.isArray(message.allowedTravelModes)) - return "allowedTravelModes: array expected"; - for (var i = 0; i < message.allowedTravelModes.length; ++i) - switch (message.allowedTravelModes[i]) { - default: - return "allowedTravelModes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - switch (message.routingPreference) { - default: - return "routingPreference: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TransitPreferences message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.TransitPreferences} TransitPreferences - */ - TransitPreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.TransitPreferences) - return object; - var message = new $root.google.maps.routing.v2.TransitPreferences(); - if (object.allowedTravelModes) { - if (!Array.isArray(object.allowedTravelModes)) - throw TypeError(".google.maps.routing.v2.TransitPreferences.allowedTravelModes: array expected"); - message.allowedTravelModes = []; - for (var i = 0; i < object.allowedTravelModes.length; ++i) - switch (object.allowedTravelModes[i]) { - default: - if (typeof object.allowedTravelModes[i] === "number") { - message.allowedTravelModes[i] = object.allowedTravelModes[i]; - break; - } - case "TRANSIT_TRAVEL_MODE_UNSPECIFIED": - case 0: - message.allowedTravelModes[i] = 0; - break; - case "BUS": - case 1: - message.allowedTravelModes[i] = 1; - break; - case "SUBWAY": - case 2: - message.allowedTravelModes[i] = 2; - break; - case "TRAIN": - case 3: - message.allowedTravelModes[i] = 3; - break; - case "LIGHT_RAIL": - case 4: - message.allowedTravelModes[i] = 4; - break; - case "RAIL": - case 5: - message.allowedTravelModes[i] = 5; - break; - } - } - switch (object.routingPreference) { - default: - if (typeof object.routingPreference === "number") { - message.routingPreference = object.routingPreference; - break; - } - break; - case "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED": - case 0: - message.routingPreference = 0; - break; - case "LESS_WALKING": - case 1: - message.routingPreference = 1; - break; - case "FEWER_TRANSFERS": - case 2: - message.routingPreference = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TransitPreferences message. Also converts values to other types if specified. - * @function toObject - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {google.maps.routing.v2.TransitPreferences} message TransitPreferences - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitPreferences.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedTravelModes = []; - if (options.defaults) - object.routingPreference = options.enums === String ? "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED" : 0; - if (message.allowedTravelModes && message.allowedTravelModes.length) { - object.allowedTravelModes = []; - for (var j = 0; j < message.allowedTravelModes.length; ++j) - object.allowedTravelModes[j] = options.enums === String ? $root.google.maps.routing.v2.TransitPreferences.TransitTravelMode[message.allowedTravelModes[j]] === undefined ? message.allowedTravelModes[j] : $root.google.maps.routing.v2.TransitPreferences.TransitTravelMode[message.allowedTravelModes[j]] : message.allowedTravelModes[j]; - } - if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) - object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.TransitPreferences.TransitRoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.routing.v2.TransitPreferences.TransitRoutingPreference[message.routingPreference] : message.routingPreference; - return object; - }; - - /** - * Converts this TransitPreferences to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.TransitPreferences - * @instance - * @returns {Object.} JSON object - */ - TransitPreferences.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitPreferences - * @function getTypeUrl - * @memberof google.maps.routing.v2.TransitPreferences - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.maps.routing.v2.TransitPreferences"; - }; - - /** - * TransitTravelMode enum. - * @name google.maps.routing.v2.TransitPreferences.TransitTravelMode - * @enum {number} - * @property {number} TRANSIT_TRAVEL_MODE_UNSPECIFIED=0 TRANSIT_TRAVEL_MODE_UNSPECIFIED value - * @property {number} BUS=1 BUS value - * @property {number} SUBWAY=2 SUBWAY value - * @property {number} TRAIN=3 TRAIN value - * @property {number} LIGHT_RAIL=4 LIGHT_RAIL value - * @property {number} RAIL=5 RAIL value - */ - TransitPreferences.TransitTravelMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRANSIT_TRAVEL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BUS"] = 1; - values[valuesById[2] = "SUBWAY"] = 2; - values[valuesById[3] = "TRAIN"] = 3; - values[valuesById[4] = "LIGHT_RAIL"] = 4; - values[valuesById[5] = "RAIL"] = 5; - return values; - })(); - - /** - * TransitRoutingPreference enum. - * @name google.maps.routing.v2.TransitPreferences.TransitRoutingPreference - * @enum {number} - * @property {number} TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED=0 TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED value - * @property {number} LESS_WALKING=1 LESS_WALKING value - * @property {number} FEWER_TRANSFERS=2 FEWER_TRANSFERS value - */ - TransitPreferences.TransitRoutingPreference = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LESS_WALKING"] = 1; - values[valuesById[2] = "FEWER_TRANSFERS"] = 2; - return values; - })(); - - return TransitPreferences; - })(); - - /** - * Units enum. - * @name google.maps.routing.v2.Units - * @enum {number} - * @property {number} UNITS_UNSPECIFIED=0 UNITS_UNSPECIFIED value - * @property {number} METRIC=1 METRIC value - * @property {number} IMPERIAL=2 IMPERIAL value - */ - v2.Units = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNITS_UNSPECIFIED"] = 0; - values[valuesById[1] = "METRIC"] = 1; - values[valuesById[2] = "IMPERIAL"] = 2; - return values; - })(); - - v2.Waypoint = (function() { - - /** - * Properties of a Waypoint. - * @memberof google.maps.routing.v2 - * @interface IWaypoint - * @property {google.maps.routing.v2.ILocation|null} [location] Waypoint location - * @property {string|null} [placeId] Waypoint placeId - * @property {string|null} [address] Waypoint address - * @property {string|null} [navigationPointToken] Waypoint navigationPointToken - * @property {boolean|null} [via] Waypoint via - * @property {boolean|null} [vehicleStopover] Waypoint vehicleStopover - * @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad - */ - - /** - * Constructs a new Waypoint. - * @memberof google.maps.routing.v2 - * @classdesc Represents a Waypoint. - * @implements IWaypoint - * @constructor - * @param {google.maps.routing.v2.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.routing.v2.ILocation|null|undefined} location - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.location = null; - - /** - * Waypoint placeId. - * @member {string|null|undefined} placeId - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.placeId = null; - - /** - * Waypoint address. - * @member {string|null|undefined} address - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.address = null; - - /** - * Waypoint navigationPointToken. - * @member {string|null|undefined} navigationPointToken - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.navigationPointToken = null; - - /** - * Waypoint via. - * @member {boolean} via - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.via = false; - - /** - * Waypoint vehicleStopover. - * @member {boolean} vehicleStopover - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.vehicleStopover = false; - - /** - * Waypoint sideOfRoad. - * @member {boolean} sideOfRoad - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Waypoint.prototype.sideOfRoad = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Waypoint locationType. - * @member {"location"|"placeId"|"address"|"navigationPointToken"|undefined} locationType - * @memberof google.maps.routing.v2.Waypoint - * @instance - */ - Object.defineProperty(Waypoint.prototype, "locationType", { - get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address", "navigationPointToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Waypoint instance using the specified properties. - * @function create - * @memberof google.maps.routing.v2.Waypoint - * @static - * @param {google.maps.routing.v2.IWaypoint=} [properties] Properties to set - * @returns {google.maps.routing.v2.Waypoint} Waypoint instance - */ - Waypoint.create = function create(properties) { - return new Waypoint(properties); - }; - - /** - * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. - * @function encode - * @memberof google.maps.routing.v2.Waypoint - * @static - * @param {google.maps.routing.v2.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.routing.v2.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.via != null && Object.hasOwnProperty.call(message, "via")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.via); - if (message.vehicleStopover != null && Object.hasOwnProperty.call(message, "vehicleStopover")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.vehicleStopover); - if (message.sideOfRoad != null && Object.hasOwnProperty.call(message, "sideOfRoad")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sideOfRoad); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.address); - if (message.navigationPointToken != null && Object.hasOwnProperty.call(message, "navigationPointToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.navigationPointToken); - return writer; - }; - - /** - * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.maps.routing.v2.Waypoint - * @static - * @param {google.maps.routing.v2.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.routing.v2.Waypoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.maps.routing.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Waypoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.location = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); - break; - } - case 2: { - message.placeId = reader.string(); - break; - } - case 7: { - message.address = reader.string(); - break; - } - case 8: { - message.navigationPointToken = reader.string(); - break; - } - case 3: { - message.via = reader.bool(); - break; - } - case 4: { - message.vehicleStopover = reader.bool(); - break; - } - case 5: { - 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.routing.v2.Waypoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.maps.routing.v2.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.routing.v2.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.routing.v2.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.address != null && message.hasOwnProperty("address")) { - if (properties.locationType === 1) - return "locationType: multiple values"; - properties.locationType = 1; - if (!$util.isString(message.address)) - return "address: string expected"; - } - if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { - if (properties.locationType === 1) - return "locationType: multiple values"; - properties.locationType = 1; - if (!$util.isString(message.navigationPointToken)) - return "navigationPointToken: string expected"; - } - if (message.via != null && message.hasOwnProperty("via")) - if (typeof message.via !== "boolean") - return "via: boolean expected"; - if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) - if (typeof message.vehicleStopover !== "boolean") - return "vehicleStopover: boolean 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.routing.v2.Waypoint - * @static - * @param {Object.} object Plain object - * @returns {google.maps.routing.v2.Waypoint} Waypoint - */ - Waypoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.maps.routing.v2.Waypoint) - return object; - var message = new $root.google.maps.routing.v2.Waypoint(); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.maps.routing.v2.Waypoint.location: object expected"); - message.location = $root.google.maps.routing.v2.Location.fromObject(object.location); - } - if (object.placeId != null) - message.placeId = String(object.placeId); - if (object.address != null) - message.address = String(object.address); - if (object.navigationPointToken != null) - message.navigationPointToken = String(object.navigationPointToken); - if (object.via != null) - message.via = Boolean(object.via); - if (object.vehicleStopover != null) - message.vehicleStopover = Boolean(object.vehicleStopover); - 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.routing.v2.Waypoint - * @static - * @param {google.maps.routing.v2.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.via = false; - object.vehicleStopover = false; - object.sideOfRoad = false; - } - if (message.location != null && message.hasOwnProperty("location")) { - object.location = $root.google.maps.routing.v2.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.via != null && message.hasOwnProperty("via")) - object.via = message.via; - if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) - object.vehicleStopover = message.vehicleStopover; - if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) - object.sideOfRoad = message.sideOfRoad; - if (message.address != null && message.hasOwnProperty("address")) { - object.address = message.address; - if (options.oneofs) - object.locationType = "address"; - } - if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { - object.navigationPointToken = message.navigationPointToken; - if (options.oneofs) - object.locationType = "navigationPointToken"; - } - return object; - }; - - /** - * Converts this Waypoint to JSON. - * @function toJSON - * @memberof google.maps.routing.v2.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.routing.v2.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.routing.v2.Waypoint"; - }; - - return Waypoint; - })(); - - return v2; - })(); - - return routing; - })(); - - return maps; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - return api; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-maps-routing/protos/protos.json b/owl-bot-staging/google-maps-routing/protos/protos.json deleted file mode 100644 index 6a7aa6dc9b6..00000000000 --- a/owl-bot-staging/google-maps-routing/protos/protos.json +++ /dev/null @@ -1,3546 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "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": { - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "geo": { - "nested": { - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/geo/type/viewport;viewport", - "java_multiple_files": true, - "java_outer_classname": "ViewportProto", - "java_package": "com.google.geo.type", - "objc_class_prefix": "GGTP" - }, - "nested": { - "Viewport": { - "fields": { - "low": { - "type": "google.type.LatLng", - "id": 1 - }, - "high": { - "type": "google.type.LatLng", - "id": 2 - } - } - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/money;money", - "java_multiple_files": true, - "java_outer_classname": "MoneyProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "LatLng": { - "fields": { - "latitude": { - "type": "double", - "id": 1 - }, - "longitude": { - "type": "double", - "id": 2 - } - } - }, - "LocalizedText": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "languageCode": { - "type": "string", - "id": 2 - } - } - }, - "Money": { - "fields": { - "currencyCode": { - "type": "string", - "id": 1 - }, - "units": { - "type": "int64", - "id": 2 - }, - "nanos": { - "type": "int32", - "id": 3 - } - } - } - } - }, - "maps": { - "nested": { - "routing": { - "nested": { - "v2": { - "options": { - "csharp_namespace": "Google.Maps.Routing.V2", - "go_package": "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb", - "java_multiple_files": true, - "java_outer_classname": "WaypointProto", - "java_package": "com.google.maps.routing.v2", - "objc_class_prefix": "GMRV2", - "php_namespace": "Google\\Maps\\Routing\\V2", - "ruby_package": "Google::Maps::Routing::V2" - }, - "nested": { - "FallbackInfo": { - "fields": { - "routingMode": { - "type": "FallbackRoutingMode", - "id": 1 - }, - "reason": { - "type": "FallbackReason", - "id": 2 - } - } - }, - "FallbackReason": { - "values": { - "FALLBACK_REASON_UNSPECIFIED": 0, - "SERVER_ERROR": 1, - "LATENCY_EXCEEDED": 2 - } - }, - "FallbackRoutingMode": { - "values": { - "FALLBACK_ROUTING_MODE_UNSPECIFIED": 0, - "FALLBACK_TRAFFIC_UNAWARE": 1, - "FALLBACK_TRAFFIC_AWARE": 2 - } - }, - "GeocodingResults": { - "fields": { - "origin": { - "type": "GeocodedWaypoint", - "id": 1 - }, - "destination": { - "type": "GeocodedWaypoint", - "id": 2 - }, - "intermediates": { - "rule": "repeated", - "type": "GeocodedWaypoint", - "id": 3 - } - } - }, - "GeocodedWaypoint": { - "oneofs": { - "_intermediateWaypointRequestIndex": { - "oneof": [ - "intermediateWaypointRequestIndex" - ] - } - }, - "fields": { - "geocoderStatus": { - "type": "google.rpc.Status", - "id": 1 - }, - "intermediateWaypointRequestIndex": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "type": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "partialMatch": { - "type": "bool", - "id": 4 - }, - "placeId": { - "type": "string", - "id": 5 - } - } - }, - "LocalizedTime": { - "fields": { - "time": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "timeZone": { - "type": "string", - "id": 2 - } - } - }, - "Location": { - "fields": { - "latLng": { - "type": "google.type.LatLng", - "id": 1 - }, - "heading": { - "type": "google.protobuf.Int32Value", - "id": 2 - } - } - }, - "Maneuver": { - "values": { - "MANEUVER_UNSPECIFIED": 0, - "TURN_SLIGHT_LEFT": 1, - "TURN_SHARP_LEFT": 2, - "UTURN_LEFT": 3, - "TURN_LEFT": 4, - "TURN_SLIGHT_RIGHT": 5, - "TURN_SHARP_RIGHT": 6, - "UTURN_RIGHT": 7, - "TURN_RIGHT": 8, - "STRAIGHT": 9, - "RAMP_LEFT": 10, - "RAMP_RIGHT": 11, - "MERGE": 12, - "FORK_LEFT": 13, - "FORK_RIGHT": 14, - "FERRY": 15, - "FERRY_TRAIN": 16, - "ROUNDABOUT_LEFT": 17, - "ROUNDABOUT_RIGHT": 18, - "DEPART": 19, - "NAME_CHANGE": 20 - } - }, - "NavigationInstruction": { - "fields": { - "maneuver": { - "type": "Maneuver", - "id": 1 - }, - "instructions": { - "type": "string", - "id": 2 - } - } - }, - "Polyline": { - "oneofs": { - "polylineType": { - "oneof": [ - "encodedPolyline", - "geoJsonLinestring" - ] - } - }, - "fields": { - "encodedPolyline": { - "type": "string", - "id": 1 - }, - "geoJsonLinestring": { - "type": "google.protobuf.Struct", - "id": 2 - } - } - }, - "PolylineQuality": { - "values": { - "POLYLINE_QUALITY_UNSPECIFIED": 0, - "HIGH_QUALITY": 1, - "OVERVIEW": 2 - } - }, - "PolylineEncoding": { - "values": { - "POLYLINE_ENCODING_UNSPECIFIED": 0, - "ENCODED_POLYLINE": 1, - "GEO_JSON_LINESTRING": 2 - } - }, - "PolylineDetails": { - "fields": { - "flyoverInfo": { - "rule": "repeated", - "type": "FlyoverInfo", - "id": 12 - }, - "narrowRoadInfo": { - "rule": "repeated", - "type": "NarrowRoadInfo", - "id": 13 - } - }, - "nested": { - "PolylinePointIndex": { - "oneofs": { - "_startIndex": { - "oneof": [ - "startIndex" - ] - }, - "_endIndex": { - "oneof": [ - "endIndex" - ] - } - }, - "fields": { - "startIndex": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "endIndex": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "RoadFeatureState": { - "values": { - "ROAD_FEATURE_STATE_UNSPECIFIED": 0, - "EXISTS": 1, - "DOES_NOT_EXIST": 2 - } - }, - "FlyoverInfo": { - "fields": { - "flyoverPresence": { - "type": "RoadFeatureState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "polylinePointIndex": { - "type": "PolylinePointIndex", - "id": 2 - } - } - }, - "NarrowRoadInfo": { - "fields": { - "narrowRoadPresence": { - "type": "RoadFeatureState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "polylinePointIndex": { - "type": "PolylinePointIndex", - "id": 2 - } - } - } - } - }, - "Route": { - "fields": { - "routeLabels": { - "rule": "repeated", - "type": "RouteLabel", - "id": 13 - }, - "legs": { - "rule": "repeated", - "type": "RouteLeg", - "id": 1 - }, - "distanceMeters": { - "type": "int32", - "id": 2 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "staticDuration": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "polyline": { - "type": "Polyline", - "id": 5 - }, - "description": { - "type": "string", - "id": 6 - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "viewport": { - "type": "google.geo.type.Viewport", - "id": 8 - }, - "travelAdvisory": { - "type": "RouteTravelAdvisory", - "id": 9 - }, - "optimizedIntermediateWaypointIndex": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "localizedValues": { - "type": "RouteLocalizedValues", - "id": 11 - }, - "routeToken": { - "type": "string", - "id": 12 - }, - "polylineDetails": { - "type": "PolylineDetails", - "id": 14 - } - }, - "nested": { - "RouteLocalizedValues": { - "fields": { - "distance": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "duration": { - "type": "google.type.LocalizedText", - "id": 2 - }, - "staticDuration": { - "type": "google.type.LocalizedText", - "id": 3 - }, - "transitFare": { - "type": "google.type.LocalizedText", - "id": 4 - } - } - } - } - }, - "RouteTravelAdvisory": { - "fields": { - "tollInfo": { - "type": "TollInfo", - "id": 2 - }, - "speedReadingIntervals": { - "rule": "repeated", - "type": "SpeedReadingInterval", - "id": 3 - }, - "fuelConsumptionMicroliters": { - "type": "int64", - "id": 5 - }, - "routeRestrictionsPartiallyIgnored": { - "type": "bool", - "id": 6 - }, - "transitFare": { - "type": "google.type.Money", - "id": 7 - } - } - }, - "RouteLegTravelAdvisory": { - "fields": { - "tollInfo": { - "type": "TollInfo", - "id": 1 - }, - "speedReadingIntervals": { - "rule": "repeated", - "type": "SpeedReadingInterval", - "id": 2 - } - } - }, - "RouteLegStepTravelAdvisory": { - "fields": { - "speedReadingIntervals": { - "rule": "repeated", - "type": "SpeedReadingInterval", - "id": 1 - } - } - }, - "RouteLeg": { - "fields": { - "distanceMeters": { - "type": "int32", - "id": 1 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 2 - }, - "staticDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "polyline": { - "type": "Polyline", - "id": 4 - }, - "startLocation": { - "type": "Location", - "id": 5 - }, - "endLocation": { - "type": "Location", - "id": 6 - }, - "steps": { - "rule": "repeated", - "type": "RouteLegStep", - "id": 7 - }, - "travelAdvisory": { - "type": "RouteLegTravelAdvisory", - "id": 8 - }, - "localizedValues": { - "type": "RouteLegLocalizedValues", - "id": 9 - }, - "stepsOverview": { - "type": "StepsOverview", - "id": 10 - } - }, - "nested": { - "RouteLegLocalizedValues": { - "fields": { - "distance": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "duration": { - "type": "google.type.LocalizedText", - "id": 2 - }, - "staticDuration": { - "type": "google.type.LocalizedText", - "id": 3 - } - } - }, - "StepsOverview": { - "fields": { - "multiModalSegments": { - "rule": "repeated", - "type": "MultiModalSegment", - "id": 1 - } - }, - "nested": { - "MultiModalSegment": { - "oneofs": { - "_stepStartIndex": { - "oneof": [ - "stepStartIndex" - ] - }, - "_stepEndIndex": { - "oneof": [ - "stepEndIndex" - ] - } - }, - "fields": { - "stepStartIndex": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "stepEndIndex": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "navigationInstruction": { - "type": "NavigationInstruction", - "id": 3 - }, - "travelMode": { - "type": "RouteTravelMode", - "id": 4 - } - } - } - } - } - } - }, - "RouteLegStep": { - "fields": { - "distanceMeters": { - "type": "int32", - "id": 1 - }, - "staticDuration": { - "type": "google.protobuf.Duration", - "id": 2 - }, - "polyline": { - "type": "Polyline", - "id": 3 - }, - "startLocation": { - "type": "Location", - "id": 4 - }, - "endLocation": { - "type": "Location", - "id": 5 - }, - "navigationInstruction": { - "type": "NavigationInstruction", - "id": 6 - }, - "travelAdvisory": { - "type": "RouteLegStepTravelAdvisory", - "id": 7 - }, - "localizedValues": { - "type": "RouteLegStepLocalizedValues", - "id": 8 - }, - "transitDetails": { - "type": "RouteLegStepTransitDetails", - "id": 9 - }, - "travelMode": { - "type": "RouteTravelMode", - "id": 10 - } - }, - "nested": { - "RouteLegStepLocalizedValues": { - "fields": { - "distance": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "staticDuration": { - "type": "google.type.LocalizedText", - "id": 3 - } - } - } - } - }, - "RouteLegStepTransitDetails": { - "fields": { - "stopDetails": { - "type": "TransitStopDetails", - "id": 1 - }, - "localizedValues": { - "type": "TransitDetailsLocalizedValues", - "id": 2 - }, - "headsign": { - "type": "string", - "id": 3 - }, - "headway": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "transitLine": { - "type": "TransitLine", - "id": 5 - }, - "stopCount": { - "type": "int32", - "id": 6 - }, - "tripShortText": { - "type": "string", - "id": 7 - } - }, - "nested": { - "TransitStopDetails": { - "fields": { - "arrivalStop": { - "type": "TransitStop", - "id": 1 - }, - "arrivalTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "departureStop": { - "type": "TransitStop", - "id": 3 - }, - "departureTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "TransitDetailsLocalizedValues": { - "fields": { - "arrivalTime": { - "type": "LocalizedTime", - "id": 1 - }, - "departureTime": { - "type": "LocalizedTime", - "id": 2 - } - } - } - } - }, - "RouteLabel": { - "values": { - "ROUTE_LABEL_UNSPECIFIED": 0, - "DEFAULT_ROUTE": 1, - "DEFAULT_ROUTE_ALTERNATE": 2, - "FUEL_EFFICIENT": 3, - "SHORTER_DISTANCE": 4 - } - }, - "RouteTravelMode": { - "values": { - "TRAVEL_MODE_UNSPECIFIED": 0, - "DRIVE": 1, - "BICYCLE": 2, - "WALK": 3, - "TWO_WHEELER": 4, - "TRANSIT": 7 - } - }, - "SpeedReadingInterval": { - "oneofs": { - "_startPolylinePointIndex": { - "oneof": [ - "startPolylinePointIndex" - ] - }, - "_endPolylinePointIndex": { - "oneof": [ - "endPolylinePointIndex" - ] - }, - "speedType": { - "oneof": [ - "speed" - ] - } - }, - "fields": { - "startPolylinePointIndex": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "endPolylinePointIndex": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "speed": { - "type": "Speed", - "id": 3 - } - }, - "nested": { - "Speed": { - "values": { - "SPEED_UNSPECIFIED": 0, - "NORMAL": 1, - "SLOW": 2, - "TRAFFIC_JAM": 3 - } - } - } - }, - "TollInfo": { - "fields": { - "estimatedPrice": { - "rule": "repeated", - "type": "google.type.Money", - "id": 1 - } - } - }, - "TransitAgency": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "phoneNumber": { - "type": "string", - "id": 2 - }, - "uri": { - "type": "string", - "id": 3 - } - } - }, - "TransitLine": { - "fields": { - "agencies": { - "rule": "repeated", - "type": "TransitAgency", - "id": 1 - }, - "name": { - "type": "string", - "id": 2 - }, - "uri": { - "type": "string", - "id": 3 - }, - "color": { - "type": "string", - "id": 4 - }, - "iconUri": { - "type": "string", - "id": 5 - }, - "nameShort": { - "type": "string", - "id": 6 - }, - "textColor": { - "type": "string", - "id": 7 - }, - "vehicle": { - "type": "TransitVehicle", - "id": 8 - } - } - }, - "TransitStop": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "location": { - "type": "Location", - "id": 2 - } - } - }, - "TransitVehicle": { - "fields": { - "name": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "type": { - "type": "TransitVehicleType", - "id": 2 - }, - "iconUri": { - "type": "string", - "id": 3 - }, - "localIconUri": { - "type": "string", - "id": 4 - } - }, - "nested": { - "TransitVehicleType": { - "values": { - "TRANSIT_VEHICLE_TYPE_UNSPECIFIED": 0, - "BUS": 1, - "CABLE_CAR": 2, - "COMMUTER_TRAIN": 3, - "FERRY": 4, - "FUNICULAR": 5, - "GONDOLA_LIFT": 6, - "HEAVY_RAIL": 7, - "HIGH_SPEED_TRAIN": 8, - "INTERCITY_BUS": 9, - "LONG_DISTANCE_TRAIN": 10, - "METRO_RAIL": 11, - "MONORAIL": 12, - "OTHER": 13, - "RAIL": 14, - "SHARE_TAXI": 15, - "SUBWAY": 16, - "TRAM": 17, - "TROLLEYBUS": 18 - } - } - } - }, - "RouteModifiers": { - "fields": { - "avoidTolls": { - "type": "bool", - "id": 1 - }, - "avoidHighways": { - "type": "bool", - "id": 2 - }, - "avoidFerries": { - "type": "bool", - "id": 3 - }, - "avoidIndoor": { - "type": "bool", - "id": 4 - }, - "vehicleInfo": { - "type": "VehicleInfo", - "id": 5 - }, - "tollPasses": { - "rule": "repeated", - "type": "TollPass", - "id": 6 - } - } - }, - "TollPass": { - "valuesOptions": { - "US_MI_IQ_PROX_CARD": { - "deprecated": true - } - }, - "values": { - "TOLL_PASS_UNSPECIFIED": 0, - "AU_ETOLL_TAG": 82, - "AU_EWAY_TAG": 83, - "AU_LINKT": 2, - "AR_TELEPASE": 3, - "BR_AUTO_EXPRESO": 81, - "BR_CONECTCAR": 7, - "BR_MOVE_MAIS": 8, - "BR_PASSA_RAPIDO": 88, - "BR_SEM_PARAR": 9, - "BR_TAGGY": 10, - "BR_VELOE": 11, - "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": 84, - "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": 85, - "CA_US_BLUE_WATER_EDGE_PASS": 18, - "CA_US_CONNEXION": 19, - "CA_US_NEXUS_CARD": 20, - "ID_E_TOLL": 16, - "IN_FASTAG": 78, - "IN_LOCAL_HP_PLATE_EXEMPT": 79, - "JP_ETC": 98, - "JP_ETC2": 99, - "MX_IAVE": 90, - "MX_PASE": 91, - "MX_QUICKPASS": 93, - "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": 89, - "MX_TAG_IAVE": 12, - "MX_TAG_TELEVIA": 13, - "MX_TELEVIA": 92, - "MX_VIAPASS": 14, - "US_AL_FREEDOM_PASS": 21, - "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": 22, - "US_CA_FASTRAK": 4, - "US_CA_FASTRAK_CAV_STICKER": 86, - "US_CO_EXPRESSTOLL": 23, - "US_CO_GO_PASS": 24, - "US_DE_EZPASSDE": 25, - "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": 65, - "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": 66, - "US_FL_EPASS": 67, - "US_FL_GIBA_TOLL_PASS": 68, - "US_FL_LEEWAY": 69, - "US_FL_SUNPASS": 70, - "US_FL_SUNPASS_PRO": 71, - "US_IL_EZPASSIL": 73, - "US_IL_IPASS": 72, - "US_IN_EZPASSIN": 26, - "US_KS_BESTPASS_HORIZON": 27, - "US_KS_KTAG": 28, - "US_KS_NATIONALPASS": 29, - "US_KS_PREPASS_ELITEPASS": 30, - "US_KY_RIVERLINK": 31, - "US_LA_GEAUXPASS": 32, - "US_LA_TOLL_TAG": 33, - "US_MA_EZPASSMA": 6, - "US_MD_EZPASSMD": 34, - "US_ME_EZPASSME": 35, - "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": 36, - "US_MI_BCPASS": 94, - "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": 37, - "US_MI_IQ_PROX_CARD": 38, - "US_MI_IQ_TAG": 95, - "US_MI_MACKINAC_BRIDGE_MAC_PASS": 39, - "US_MI_NEXPRESS_TOLL": 40, - "US_MN_EZPASSMN": 41, - "US_NC_EZPASSNC": 42, - "US_NC_PEACH_PASS": 87, - "US_NC_QUICK_PASS": 43, - "US_NH_EZPASSNH": 80, - "US_NJ_DOWNBEACH_EXPRESS_PASS": 75, - "US_NJ_EZPASSNJ": 74, - "US_NY_EXPRESSPASS": 76, - "US_NY_EZPASSNY": 77, - "US_OH_EZPASSOH": 44, - "US_PA_EZPASSPA": 45, - "US_RI_EZPASSRI": 46, - "US_SC_PALPASS": 47, - "US_TX_AVI_TAG": 97, - "US_TX_BANCPASS": 48, - "US_TX_DEL_RIO_PASS": 49, - "US_TX_EFAST_PASS": 50, - "US_TX_EAGLE_PASS_EXPRESS_CARD": 51, - "US_TX_EPTOLL": 52, - "US_TX_EZ_CROSS": 53, - "US_TX_EZTAG": 54, - "US_TX_FUEGO_TAG": 96, - "US_TX_LAREDO_TRADE_TAG": 55, - "US_TX_PLUSPASS": 56, - "US_TX_TOLLTAG": 57, - "US_TX_TXTAG": 58, - "US_TX_XPRESS_CARD": 59, - "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": 60, - "US_VA_EZPASSVA": 61, - "US_WA_BREEZEBY": 17, - "US_WA_GOOD_TO_GO": 1, - "US_WV_EZPASSWV": 62, - "US_WV_MEMORIAL_BRIDGE_TICKETS": 63, - "US_WV_MOV_PASS": 100, - "US_WV_NEWELL_TOLL_BRIDGE_TICKET": 64 - } - }, - "VehicleInfo": { - "fields": { - "emissionType": { - "type": "VehicleEmissionType", - "id": 2 - } - } - }, - "VehicleEmissionType": { - "values": { - "VEHICLE_EMISSION_TYPE_UNSPECIFIED": 0, - "GASOLINE": 1, - "ELECTRIC": 2, - "HYBRID": 3, - "DIESEL": 4 - } - }, - "Routes": { - "options": { - "(google.api.default_host)": "routes.googleapis.com" - }, - "methods": { - "ComputeRoutes": { - "requestType": "ComputeRoutesRequest", - "responseType": "ComputeRoutesResponse", - "options": { - "(google.api.http).post": "/directions/v2:computeRoutes", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/directions/v2:computeRoutes", - "body": "*" - } - } - ] - }, - "ComputeRouteMatrix": { - "requestType": "ComputeRouteMatrixRequest", - "responseType": "RouteMatrixElement", - "responseStream": true, - "options": { - "(google.api.http).post": "/distanceMatrix/v2:computeRouteMatrix", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/distanceMatrix/v2:computeRouteMatrix", - "body": "*" - } - } - ] - } - } - }, - "ComputeRoutesRequest": { - "fields": { - "origin": { - "type": "Waypoint", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "destination": { - "type": "Waypoint", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "intermediates": { - "rule": "repeated", - "type": "Waypoint", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "travelMode": { - "type": "RouteTravelMode", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingPreference": { - "type": "RoutingPreference", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "polylineQuality": { - "type": "PolylineQuality", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "polylineEncoding": { - "type": "PolylineEncoding", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "departureTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "arrivalTime": { - "type": "google.protobuf.Timestamp", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "computeAlternativeRoutes": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routeModifiers": { - "type": "RouteModifiers", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "languageCode": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "regionCode": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "units": { - "type": "Units", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "optimizeWaypointOrder": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestedReferenceRoutes": { - "rule": "repeated", - "type": "ReferenceRoute", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "extraComputations": { - "rule": "repeated", - "type": "ExtraComputation", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trafficModel": { - "type": "TrafficModel", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transitPreferences": { - "type": "TransitPreferences", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ReferenceRoute": { - "values": { - "REFERENCE_ROUTE_UNSPECIFIED": 0, - "FUEL_EFFICIENT": 1, - "SHORTER_DISTANCE": 2 - } - }, - "ExtraComputation": { - "values": { - "EXTRA_COMPUTATION_UNSPECIFIED": 0, - "TOLLS": 1, - "FUEL_CONSUMPTION": 2, - "TRAFFIC_ON_POLYLINE": 3, - "HTML_FORMATTED_NAVIGATION_INSTRUCTIONS": 4, - "FLYOVER_INFO_ON_POLYLINE": 7, - "NARROW_ROAD_INFO_ON_POLYLINE": 8 - } - } - } - }, - "ComputeRoutesResponse": { - "fields": { - "routes": { - "rule": "repeated", - "type": "Route", - "id": 1 - }, - "fallbackInfo": { - "type": "FallbackInfo", - "id": 2 - }, - "geocodingResults": { - "type": "GeocodingResults", - "id": 3 - } - } - }, - "ComputeRouteMatrixRequest": { - "fields": { - "origins": { - "rule": "repeated", - "type": "RouteMatrixOrigin", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "destinations": { - "rule": "repeated", - "type": "RouteMatrixDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "travelMode": { - "type": "RouteTravelMode", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingPreference": { - "type": "RoutingPreference", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "departureTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "arrivalTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "languageCode": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "regionCode": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "units": { - "type": "Units", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "extraComputations": { - "rule": "repeated", - "type": "ExtraComputation", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trafficModel": { - "type": "TrafficModel", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transitPreferences": { - "type": "TransitPreferences", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ExtraComputation": { - "values": { - "EXTRA_COMPUTATION_UNSPECIFIED": 0, - "TOLLS": 1 - } - } - } - }, - "RouteMatrixOrigin": { - "fields": { - "waypoint": { - "type": "Waypoint", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "routeModifiers": { - "type": "RouteModifiers", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RouteMatrixDestination": { - "fields": { - "waypoint": { - "type": "Waypoint", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RouteMatrixElement": { - "oneofs": { - "_originIndex": { - "oneof": [ - "originIndex" - ] - }, - "_destinationIndex": { - "oneof": [ - "destinationIndex" - ] - } - }, - "fields": { - "originIndex": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "destinationIndex": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "status": { - "type": "google.rpc.Status", - "id": 3 - }, - "condition": { - "type": "RouteMatrixElementCondition", - "id": 9 - }, - "distanceMeters": { - "type": "int32", - "id": 4 - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "staticDuration": { - "type": "google.protobuf.Duration", - "id": 6 - }, - "travelAdvisory": { - "type": "RouteTravelAdvisory", - "id": 7 - }, - "fallbackInfo": { - "type": "FallbackInfo", - "id": 8 - }, - "localizedValues": { - "type": "LocalizedValues", - "id": 10 - } - }, - "nested": { - "LocalizedValues": { - "fields": { - "distance": { - "type": "google.type.LocalizedText", - "id": 1 - }, - "duration": { - "type": "google.type.LocalizedText", - "id": 2 - }, - "staticDuration": { - "type": "google.type.LocalizedText", - "id": 3 - }, - "transitFare": { - "type": "google.type.LocalizedText", - "id": 4 - } - } - } - } - }, - "RouteMatrixElementCondition": { - "values": { - "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": 0, - "ROUTE_EXISTS": 1, - "ROUTE_NOT_FOUND": 2 - } - }, - "RoutingPreference": { - "values": { - "ROUTING_PREFERENCE_UNSPECIFIED": 0, - "TRAFFIC_UNAWARE": 1, - "TRAFFIC_AWARE": 2, - "TRAFFIC_AWARE_OPTIMAL": 3 - } - }, - "TrafficModel": { - "values": { - "TRAFFIC_MODEL_UNSPECIFIED": 0, - "BEST_GUESS": 1, - "PESSIMISTIC": 2, - "OPTIMISTIC": 3 - } - }, - "TransitPreferences": { - "fields": { - "allowedTravelModes": { - "rule": "repeated", - "type": "TransitTravelMode", - "id": 1 - }, - "routingPreference": { - "type": "TransitRoutingPreference", - "id": 2 - } - }, - "nested": { - "TransitTravelMode": { - "values": { - "TRANSIT_TRAVEL_MODE_UNSPECIFIED": 0, - "BUS": 1, - "SUBWAY": 2, - "TRAIN": 3, - "LIGHT_RAIL": 4, - "RAIL": 5 - } - }, - "TransitRoutingPreference": { - "values": { - "TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED": 0, - "LESS_WALKING": 1, - "FEWER_TRANSFERS": 2 - } - } - } - }, - "Units": { - "values": { - "UNITS_UNSPECIFIED": 0, - "METRIC": 1, - "IMPERIAL": 2 - } - }, - "Waypoint": { - "oneofs": { - "locationType": { - "oneof": [ - "location", - "placeId", - "address", - "navigationPointToken" - ] - } - }, - "fields": { - "location": { - "type": "Location", - "id": 1 - }, - "placeId": { - "type": "string", - "id": 2 - }, - "address": { - "type": "string", - "id": 7 - }, - "navigationPointToken": { - "type": "string", - "id": 8 - }, - "via": { - "type": "bool", - "id": 3 - }, - "vehicleStopover": { - "type": "bool", - "id": 4 - }, - "sideOfRoad": { - "type": "bool", - "id": 5 - } - } - } - } - } - } - } - } - }, - "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 - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js deleted file mode 100644 index 487027070e2..00000000000 --- a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(origins, destinations) { - // [START routes_v2_generated_Routes_ComputeRouteMatrix_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. Array of origins, which determines the rows of the response - * matrix. Several size restrictions apply to the cardinality of origins and - * destinations: - * * The sum of the number of origins + the number of destinations specified - * as either `place_id` or `address` must be no greater than 50. - * * The product of number of origins × number of destinations must be no - * greater than 625 in any case. - * * The product of the number of origins × number of destinations must be no - * greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. - * * The product of the number of origins × number of destinations must be no - * greater than 100 if travel_mode is set to `TRANSIT`. - */ - // const origins = [1,2,3,4] - /** - * Required. Array of destinations, which determines the columns of the - * response matrix. - */ - // const destinations = [1,2,3,4] - /** - * Optional. Specifies the mode of transportation. - */ - // const travelMode = {} - /** - * Optional. Specifies how to compute the route. The server attempts to use - * the selected routing preference to compute the route. If the routing - * preference results in an error or an extra long latency, an error is - * returned. You can specify this option only when the `travel_mode` is - * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - */ - // const routingPreference = {} - /** - * Optional. The departure time. If you don't set this value, then this value - * defaults to the time that you made the request. - * NOTE: You can only specify a `departure_time` in the past when - * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to - * `TRANSIT`. - */ - // const departureTime = {} - /** - * Optional. The arrival time. - * NOTE: Can only be set when - * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to - * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - * not both. - */ - // const arrivalTime = {} - /** - * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - * information, see Unicode Locale - * Identifier (http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - * See Language - * Support (https://developers.google.com/maps/faq#languagesupport) - * for the list of supported languages. When you don't provide this value, the - * display language is inferred from the location of the first origin. - */ - // const languageCode = 'abc123' - /** - * Optional. The region code, specified as a ccTLD ("top-level domain") - * two-character value. For more information see Country code top-level - * domains (https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - */ - // const regionCode = 'abc123' - /** - * Optional. Specifies the units of measure for the display fields. - */ - // const units = {} - /** - * Optional. A list of extra computations which may be used to complete the - * request. Note: These extra computations may return extra fields on the - * response. These extra fields must also be specified in the field mask to be - * returned in the response. - */ - // const extraComputations = [1,2,3,4] - /** - * Optional. Specifies the assumptions to use when calculating time in - * traffic. This setting affects the value returned in the duration field in - * the RouteMatrixElement google.maps.routing.v2.RouteMatrixElement which - * contains the predicted time in traffic based on historical averages. - * `TrafficModel` is only available for requests that have set - * RoutingPreference google.maps.routing.v2.RoutingPreference to - * `TRAFFIC_AWARE_OPTIMAL` and - * RouteTravelMode google.maps.routing.v2.RouteTravelMode to `DRIVE`. - * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - * specified. - */ - // const trafficModel = {} - /** - * Optional. Specifies preferences that influence the route returned for - * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - * RouteTravelMode google.maps.routing.v2.RouteTravelMode is set to - * `TRANSIT`. - */ - // const transitPreferences = {} - - // Imports the Routing library - const {RoutesClient} = require('@googlemaps/routing').v2; - - // Instantiates a client - const routingClient = new RoutesClient(); - - async function callComputeRouteMatrix() { - // Construct request - const request = { - origins, - destinations, - }; - - // Run request - const stream = await routingClient.computeRouteMatrix(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callComputeRouteMatrix(); - // [END routes_v2_generated_Routes_ComputeRouteMatrix_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js b/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js deleted file mode 100644 index 32acd7be8f8..00000000000 --- a/owl-bot-staging/google-maps-routing/samples/generated/v2/routes.compute_routes.js +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(origin, destination) { - // [START routes_v2_generated_Routes_ComputeRoutes_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. Origin waypoint. - */ - // const origin = {} - /** - * Required. Destination waypoint. - */ - // const destination = {} - /** - * Optional. A set of waypoints along the route (excluding terminal points), - * for either stopping at or passing by. Up to 25 intermediate waypoints are - * supported. - */ - // const intermediates = [1,2,3,4] - /** - * Optional. Specifies the mode of transportation. - */ - // const travelMode = {} - /** - * Optional. Specifies how to compute the route. The server - * attempts to use the selected routing preference to compute the route. If - * the routing preference results in an error or an extra long latency, then - * an error is returned. You can specify this option only when the - * `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - */ - // const routingPreference = {} - /** - * Optional. Specifies your preference for the quality of the polyline. - */ - // const polylineQuality = {} - /** - * Optional. Specifies the preferred encoding for the polyline. - */ - // const polylineEncoding = {} - /** - * Optional. The departure time. If you don't set this value, then this value - * defaults to the time that you made the request. - * NOTE: You can only specify a `departure_time` in the past when - * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to - * `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 - * days in the future. - */ - // const departureTime = {} - /** - * Optional. The arrival time. - * NOTE: This field is ignored when requests specify a - * RouteTravelMode google.maps.routing.v2.RouteTravelMode other than - * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - * not both. Transit trips are available for up to 7 days in the past or 100 - * days in the future. - */ - // const arrivalTime = {} - /** - * Optional. Specifies whether to calculate alternate routes in addition to - * the route. No alternative routes are returned for requests that have - * intermediate waypoints. - */ - // const computeAlternativeRoutes = true - /** - * Optional. A set of conditions to satisfy that affect the way routes are - * calculated. - */ - // const routeModifiers = {} - /** - * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - * information, see Unicode Locale - * Identifier (http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - * See Language - * Support (https://developers.google.com/maps/faq#languagesupport) - * for the list of supported languages. When you don't provide this value, the - * display language is inferred from the location of the route request. - */ - // const languageCode = 'abc123' - /** - * Optional. The region code, specified as a ccTLD ("top-level domain") - * two-character value. For more information see Country code top-level - * domains (https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - */ - // const regionCode = 'abc123' - /** - * Optional. Specifies the units of measure for the display fields. These - * fields include the `instruction` field in - * `NavigationInstruction` google.maps.routing.v2.NavigationInstruction. - * The units of measure used for the route, leg, step distance, and duration - * are not affected by this value. If you don't provide this value, then the - * display units are inferred from the location of the first origin. - */ - // const units = {} - /** - * Optional. If set to true, the service attempts to minimize the overall cost - * of the route by re-ordering the specified intermediate waypoints. The - * request fails if any of the intermediate waypoints is a `via` waypoint. Use - * `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to - * find the new ordering. - * If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is - * not requested in the `X-Goog-FieldMask` header, the request fails. - * If `optimize_waypoint_order` is set to false, - * `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be - * empty. - */ - // const optimizeWaypointOrder = true - /** - * Optional. Specifies what reference routes to calculate as part of the - * request in addition to the default route. A reference route is a route with - * a different route calculation objective than the default route. For example - * a `FUEL_EFFICIENT` reference route calculation takes into account various - * parameters that would generate an optimal fuel efficient route. When using - * this feature, look for - * `route_labels` google.maps.routing.v2.Route.route_labels on the - * resulting routes. - */ - // const requestedReferenceRoutes = [1,2,3,4] - /** - * Optional. A list of extra computations which may be used to complete the - * request. Note: These extra computations may return extra fields on the - * response. These extra fields must also be specified in the field mask to be - * returned in the response. - */ - // const extraComputations = [1,2,3,4] - /** - * Optional. Specifies the assumptions to use when calculating time in - * traffic. This setting affects the value returned in the duration field in - * the - * `Route` google.maps.routing.v2.Route and - * `RouteLeg` google.maps.routing.v2.RouteLeg which contains the predicted - * time in traffic based on historical averages. - * `TrafficModel` is only available for requests that have set - * `RoutingPreference` google.maps.routing.v2.RoutingPreference to - * `TRAFFIC_AWARE_OPTIMAL` and - * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode to `DRIVE`. - * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - * specified. - */ - // const trafficModel = {} - /** - * Optional. Specifies preferences that influence the route returned for - * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - * `RouteTravelMode` google.maps.routing.v2.RouteTravelMode is set to - * `TRANSIT`. - */ - // const transitPreferences = {} - - // Imports the Routing library - const {RoutesClient} = require('@googlemaps/routing').v2; - - // Instantiates a client - const routingClient = new RoutesClient(); - - async function callComputeRoutes() { - // Construct request - const request = { - origin, - destination, - }; - - // Run request - const response = await routingClient.computeRoutes(request); - console.log(response); - } - - callComputeRoutes(); - // [END routes_v2_generated_Routes_ComputeRoutes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json b/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json deleted file mode 100644 index fe1c5b047d2..00000000000 --- a/owl-bot-staging/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-routing", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.maps.routing.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "routes_v2_generated_Routes_ComputeRoutes_async", - "title": "Routes computeRoutes Sample", - "origin": "API_DEFINITION", - "description": " Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using URL parameter `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters)). The value is a comma separated list of field paths. See detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of Route-level duration, distance, and polyline (an example production setup): `X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` Google discourage the use of the wildcard (`*`) response field mask, or specifying the field mask at the top level (`routes`), because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", - "canonical": true, - "file": "routes.compute_routes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 191, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ComputeRoutes", - "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", - "async": true, - "parameters": [ - { - "name": "origin", - "type": ".google.maps.routing.v2.Waypoint" - }, - { - "name": "destination", - "type": ".google.maps.routing.v2.Waypoint" - }, - { - "name": "intermediates", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "travel_mode", - "type": ".google.maps.routing.v2.RouteTravelMode" - }, - { - "name": "routing_preference", - "type": ".google.maps.routing.v2.RoutingPreference" - }, - { - "name": "polyline_quality", - "type": ".google.maps.routing.v2.PolylineQuality" - }, - { - "name": "polyline_encoding", - "type": ".google.maps.routing.v2.PolylineEncoding" - }, - { - "name": "departure_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "arrival_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "compute_alternative_routes", - "type": "TYPE_BOOL" - }, - { - "name": "route_modifiers", - "type": ".google.maps.routing.v2.RouteModifiers" - }, - { - "name": "language_code", - "type": "TYPE_STRING" - }, - { - "name": "region_code", - "type": "TYPE_STRING" - }, - { - "name": "units", - "type": ".google.maps.routing.v2.Units" - }, - { - "name": "optimize_waypoint_order", - "type": "TYPE_BOOL" - }, - { - "name": "requested_reference_routes", - "type": "TYPE_ENUM[]" - }, - { - "name": "extra_computations", - "type": "TYPE_ENUM[]" - }, - { - "name": "traffic_model", - "type": ".google.maps.routing.v2.TrafficModel" - }, - { - "name": "transit_preferences", - "type": ".google.maps.routing.v2.TransitPreferences" - } - ], - "resultType": ".google.maps.routing.v2.ComputeRoutesResponse", - "client": { - "shortName": "RoutesClient", - "fullName": "google.maps.routing.v2.RoutesClient" - }, - "method": { - "shortName": "ComputeRoutes", - "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", - "service": { - "shortName": "Routes", - "fullName": "google.maps.routing.v2.Routes" - } - } - } - }, - { - "regionTag": "routes_v2_generated_Routes_ComputeRouteMatrix_async", - "title": "Routes computeRouteMatrix Sample", - "origin": "API_DEFINITION", - "description": " Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using the URL parameter `$fields` or `fields`, or by using the HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters)). The value is a comma separated list of field paths. See this detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of route durations, distances, element status, condition, and element indices (an example production setup): `X-Goog-FieldMask: originIndex,destinationIndex,status,condition,distanceMeters,duration` It is critical that you include `status` in your field mask as otherwise all messages will appear to be OK. Google discourages the use of the wildcard (`*`) response field mask, because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", - "canonical": true, - "file": "routes.compute_route_matrix.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 146, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ComputeRouteMatrix", - "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", - "async": true, - "parameters": [ - { - "name": "origins", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "destinations", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "travel_mode", - "type": ".google.maps.routing.v2.RouteTravelMode" - }, - { - "name": "routing_preference", - "type": ".google.maps.routing.v2.RoutingPreference" - }, - { - "name": "departure_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "arrival_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "language_code", - "type": "TYPE_STRING" - }, - { - "name": "region_code", - "type": "TYPE_STRING" - }, - { - "name": "units", - "type": ".google.maps.routing.v2.Units" - }, - { - "name": "extra_computations", - "type": "TYPE_ENUM[]" - }, - { - "name": "traffic_model", - "type": ".google.maps.routing.v2.TrafficModel" - }, - { - "name": "transit_preferences", - "type": ".google.maps.routing.v2.TransitPreferences" - } - ], - "resultType": ".google.maps.routing.v2.RouteMatrixElement", - "client": { - "shortName": "RoutesClient", - "fullName": "google.maps.routing.v2.RoutesClient" - }, - "method": { - "shortName": "ComputeRouteMatrix", - "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", - "service": { - "shortName": "Routes", - "fullName": "google.maps.routing.v2.Routes" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-maps-routing/src/index.ts b/owl-bot-staging/google-maps-routing/src/index.ts deleted file mode 100644 index fd8c3e11639..00000000000 --- a/owl-bot-staging/google-maps-routing/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v2 from './v2'; - -const RoutesClient = v2.RoutesClient; -type RoutesClient = v2.RoutesClient; - -export {v2, RoutesClient}; -export default {v2, RoutesClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json b/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json deleted file mode 100644 index 46b4f4a8b5a..00000000000 --- a/owl-bot-staging/google-maps-routing/src/v2/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.maps.routing.v2", - "libraryPackage": "@googlemaps/routing", - "services": { - "Routes": { - "clients": { - "grpc": { - "libraryClient": "RoutesClient", - "rpcs": { - "ComputeRoutes": { - "methods": [ - "computeRoutes" - ] - }, - "ComputeRouteMatrix": { - "methods": [ - "computeRouteMatrix" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RoutesClient", - "rpcs": { - "ComputeRoutes": { - "methods": [ - "computeRoutes" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-maps-routing/src/v2/index.ts b/owl-bot-staging/google-maps-routing/src/v2/index.ts deleted file mode 100644 index 58450e37846..00000000000 --- a/owl-bot-staging/google-maps-routing/src/v2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {RoutesClient} from './routes_client'; diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts b/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts deleted file mode 100644 index e966e0737d0..00000000000 --- a/owl-bot-staging/google-maps-routing/src/v2/routes_client.ts +++ /dev/null @@ -1,706 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import {PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/routes_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './routes_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The Routes API. - * @class - * @memberof v2 - */ -export class RoutesClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('routing'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - routesStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RoutesClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RoutesClient({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 RoutesClient; - 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 = 'routes.' + 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); - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - computeRouteMatrix: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.maps.routing.v2.Routes', 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.routesStub) { - return this.routesStub; - } - - // Put together the "service stub" for - // google.maps.routing.v2.Routes. - this.routesStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.maps.routing.v2.Routes') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.maps.routing.v2.Routes, - 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 routesStubMethods = - ['computeRoutes', 'computeRouteMatrix']; - for (const methodName of routesStubMethods) { - const callPromise = this.routesStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough({objectMode: true}); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - 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.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.routesStub; - } - - /** - * 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 'routes.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 'routes.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 []; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Returns the primary route along with optional alternate routes, given a set - * of terminal and intermediate waypoints. - * - * **NOTE:** This method requires that you specify a response field mask in - * the input. You can provide the response field mask by using URL parameter - * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` - * (see the [available URL parameters and - * headers](https://cloud.google.com/apis/docs/system-parameters)). The value - * is a comma separated list of field paths. See detailed documentation about - * [how to construct the field - * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). - * - * For example, in this method: - * - * * Field mask of all available fields (for manual inspection): - * `X-Goog-FieldMask: *` - * * Field mask of Route-level duration, distance, and polyline (an example - * production setup): - * `X-Goog-FieldMask: - * routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` - * - * Google discourage the use of the wildcard (`*`) response field mask, or - * specifying the field mask at the top level (`routes`), because: - * - * * Selecting only the fields that you need helps our server save computation - * cycles, allowing us to return the result to you with a lower latency. - * * Selecting only the fields that you need - * in your production job ensures stable latency performance. We might add - * more response fields in the future, and those new fields might require - * extra computation time. If you select all fields, or if you select all - * fields at the top level, then you might experience performance degradation - * because any new field we add will be automatically included in the - * response. - * * Selecting only the fields that you need results in a smaller response - * size, and thus higher network throughput. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.maps.routing.v2.Waypoint} request.origin - * Required. Origin waypoint. - * @param {google.maps.routing.v2.Waypoint} request.destination - * Required. Destination waypoint. - * @param {number[]} [request.intermediates] - * Optional. A set of waypoints along the route (excluding terminal points), - * for either stopping at or passing by. Up to 25 intermediate waypoints are - * supported. - * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] - * Optional. Specifies the mode of transportation. - * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] - * Optional. Specifies how to compute the route. The server - * attempts to use the selected routing preference to compute the route. If - * the routing preference results in an error or an extra long latency, then - * an error is returned. You can specify this option only when the - * `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - * @param {google.maps.routing.v2.PolylineQuality} [request.polylineQuality] - * Optional. Specifies your preference for the quality of the polyline. - * @param {google.maps.routing.v2.PolylineEncoding} [request.polylineEncoding] - * Optional. Specifies the preferred encoding for the polyline. - * @param {google.protobuf.Timestamp} [request.departureTime] - * Optional. The departure time. If you don't set this value, then this value - * defaults to the time that you made the request. - * NOTE: You can only specify a `departure_time` in the past when - * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to - * `TRANSIT`. Transit trips are available for up to 7 days in the past or 100 - * days in the future. - * @param {google.protobuf.Timestamp} [request.arrivalTime] - * Optional. The arrival time. - * NOTE: This field is ignored when requests specify a - * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} other than - * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - * not both. Transit trips are available for up to 7 days in the past or 100 - * days in the future. - * @param {boolean} [request.computeAlternativeRoutes] - * Optional. Specifies whether to calculate alternate routes in addition to - * the route. No alternative routes are returned for requests that have - * intermediate waypoints. - * @param {google.maps.routing.v2.RouteModifiers} [request.routeModifiers] - * Optional. A set of conditions to satisfy that affect the way routes are - * calculated. - * @param {string} [request.languageCode] - * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - * information, see [Unicode Locale - * Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - * See [Language - * Support](https://developers.google.com/maps/faq#languagesupport) - * for the list of supported languages. When you don't provide this value, the - * display language is inferred from the location of the route request. - * @param {string} [request.regionCode] - * Optional. The region code, specified as a ccTLD ("top-level domain") - * two-character value. For more information see [Country code top-level - * domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - * @param {google.maps.routing.v2.Units} [request.units] - * Optional. Specifies the units of measure for the display fields. These - * fields include the `instruction` field in - * {@link protos.google.maps.routing.v2.NavigationInstruction|`NavigationInstruction`}. - * The units of measure used for the route, leg, step distance, and duration - * are not affected by this value. If you don't provide this value, then the - * display units are inferred from the location of the first origin. - * @param {boolean} [request.optimizeWaypointOrder] - * Optional. If set to true, the service attempts to minimize the overall cost - * of the route by re-ordering the specified intermediate waypoints. The - * request fails if any of the intermediate waypoints is a `via` waypoint. Use - * `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to - * find the new ordering. - * If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is - * not requested in the `X-Goog-FieldMask` header, the request fails. - * If `optimize_waypoint_order` is set to false, - * `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be - * empty. - * @param {number[]} [request.requestedReferenceRoutes] - * Optional. Specifies what reference routes to calculate as part of the - * request in addition to the default route. A reference route is a route with - * a different route calculation objective than the default route. For example - * a `FUEL_EFFICIENT` reference route calculation takes into account various - * parameters that would generate an optimal fuel efficient route. When using - * this feature, look for - * {@link protos.google.maps.routing.v2.Route.route_labels|`route_labels`} on the - * resulting routes. - * @param {number[]} [request.extraComputations] - * Optional. A list of extra computations which may be used to complete the - * request. Note: These extra computations may return extra fields on the - * response. These extra fields must also be specified in the field mask to be - * returned in the response. - * @param {google.maps.routing.v2.TrafficModel} [request.trafficModel] - * Optional. Specifies the assumptions to use when calculating time in - * traffic. This setting affects the value returned in the duration field in - * the - * {@link protos.google.maps.routing.v2.Route|`Route`} and - * {@link protos.google.maps.routing.v2.RouteLeg|`RouteLeg`} which contains the predicted - * time in traffic based on historical averages. - * `TrafficModel` is only available for requests that have set - * {@link protos.google.maps.routing.v2.RoutingPreference|`RoutingPreference`} to - * `TRAFFIC_AWARE_OPTIMAL` and - * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} to `DRIVE`. - * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - * specified. - * @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences] - * Optional. Specifies preferences that influence the route returned for - * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to - * `TRANSIT`. - * @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.routing.v2.ComputeRoutesResponse|ComputeRoutesResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/routes.compute_routes.js - * region_tag:routes_v2_generated_Routes_ComputeRoutes_async - */ - computeRoutes( - request?: protos.google.maps.routing.v2.IComputeRoutesRequest, - options?: CallOptions): - Promise<[ - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, {}|undefined - ]>; - computeRoutes( - request: protos.google.maps.routing.v2.IComputeRoutesRequest, - options: CallOptions, - callback: Callback< - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, - {}|null|undefined>): void; - computeRoutes( - request: protos.google.maps.routing.v2.IComputeRoutesRequest, - callback: Callback< - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, - {}|null|undefined>): void; - computeRoutes( - request?: protos.google.maps.routing.v2.IComputeRoutesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('computeRoutes request %j', request); - const wrappedCallback: Callback< - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('computeRoutes response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.computeRoutes(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.maps.routing.v2.IComputeRoutesResponse, - protos.google.maps.routing.v2.IComputeRoutesRequest|undefined, - {}|undefined - ]) => { - this._log.info('computeRoutes response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Takes in a list of origins and destinations and returns a stream containing - * route information for each combination of origin and destination. - * - * **NOTE:** This method requires that you specify a response field mask in - * the input. You can provide the response field mask by using the URL - * parameter `$fields` or `fields`, or by using the HTTP/gRPC header - * `X-Goog-FieldMask` (see the [available URL parameters and - * headers](https://cloud.google.com/apis/docs/system-parameters)). - * The value is a comma separated list of field paths. See this detailed - * documentation about [how to construct the field - * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). - * - * For example, in this method: - * - * * Field mask of all available fields (for manual inspection): - * `X-Goog-FieldMask: *` - * * Field mask of route durations, distances, element status, condition, and - * element indices (an example production setup): - * `X-Goog-FieldMask: - * originIndex,destinationIndex,status,condition,distanceMeters,duration` - * - * It is critical that you include `status` in your field mask as otherwise - * all messages will appear to be OK. Google discourages the use of the - * wildcard (`*`) response field mask, because: - * - * * Selecting only the fields that you need helps our server save computation - * cycles, allowing us to return the result to you with a lower latency. - * * Selecting only the fields that you need in your production job ensures - * stable latency performance. We might add more response fields in the - * future, and those new fields might require extra computation time. If you - * select all fields, or if you select all fields at the top level, then you - * might experience performance degradation because any new field we add will - * be automatically included in the response. - * * Selecting only the fields that you need results in a smaller response - * size, and thus higher network throughput. - * - * @param {Object} request - * The request object that will be sent. - * @param {number[]} request.origins - * Required. Array of origins, which determines the rows of the response - * matrix. Several size restrictions apply to the cardinality of origins and - * destinations: - * - * * The sum of the number of origins + the number of destinations specified - * as either `place_id` or `address` must be no greater than 50. - * * The product of number of origins × number of destinations must be no - * greater than 625 in any case. - * * The product of the number of origins × number of destinations must be no - * greater than 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. - * * The product of the number of origins × number of destinations must be no - * greater than 100 if travel_mode is set to `TRANSIT`. - * @param {number[]} request.destinations - * Required. Array of destinations, which determines the columns of the - * response matrix. - * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] - * Optional. Specifies the mode of transportation. - * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] - * Optional. Specifies how to compute the route. The server attempts to use - * the selected routing preference to compute the route. If the routing - * preference results in an error or an extra long latency, an error is - * returned. You can specify this option only when the `travel_mode` is - * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. - * @param {google.protobuf.Timestamp} [request.departureTime] - * Optional. The departure time. If you don't set this value, then this value - * defaults to the time that you made the request. - * NOTE: You can only specify a `departure_time` in the past when - * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to - * `TRANSIT`. - * @param {google.protobuf.Timestamp} [request.arrivalTime] - * Optional. The arrival time. - * NOTE: Can only be set when - * {@link protos.google.maps.routing.v2.RouteTravelMode|`RouteTravelMode`} is set to - * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but - * not both. - * @param {string} [request.languageCode] - * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more - * information, see [Unicode Locale - * Identifier](http://www.unicode.org/reports/tr35/#Unicode_locale_identifier). - * See [Language - * Support](https://developers.google.com/maps/faq#languagesupport) - * for the list of supported languages. When you don't provide this value, the - * display language is inferred from the location of the first origin. - * @param {string} [request.regionCode] - * Optional. The region code, specified as a ccTLD ("top-level domain") - * two-character value. For more information see [Country code top-level - * domains](https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains). - * @param {google.maps.routing.v2.Units} [request.units] - * Optional. Specifies the units of measure for the display fields. - * @param {number[]} [request.extraComputations] - * Optional. A list of extra computations which may be used to complete the - * request. Note: These extra computations may return extra fields on the - * response. These extra fields must also be specified in the field mask to be - * returned in the response. - * @param {google.maps.routing.v2.TrafficModel} [request.trafficModel] - * Optional. Specifies the assumptions to use when calculating time in - * traffic. This setting affects the value returned in the duration field in - * the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which - * contains the predicted time in traffic based on historical averages. - * `TrafficModel` is only available for requests that have set - * {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to - * `TRAFFIC_AWARE_OPTIMAL` and - * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`. - * Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not - * specified. - * @param {google.maps.routing.v2.TransitPreferences} [request.transitPreferences] - * Optional. Specifies preferences that influence the route returned for - * `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when - * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to - * `TRANSIT`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - * @example include:samples/generated/v2/routes.compute_route_matrix.js - * region_tag:routes_v2_generated_Routes_ComputeRouteMatrix_async - */ - computeRouteMatrix( - request?: protos.google.maps.routing.v2.IComputeRouteMatrixRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - this._log.info('computeRouteMatrix stream %j', options); - return this.innerApiCalls.computeRouteMatrix(request, options); - } - - - /** - * 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.routesStub && !this._terminated) { - return this.routesStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json b/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json deleted file mode 100644 index c69ed299a73..00000000000 --- a/owl-bot-staging/google-maps-routing/src/v2/routes_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.maps.routing.v2.Routes": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ComputeRoutes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ComputeRouteMatrix": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json b/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json deleted file mode 100644 index 2d096dec5da..00000000000 --- a/owl-bot-staging/google-maps-routing/src/v2/routes_proto_list.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - "../../protos/google/geo/type/viewport.proto", - "../../protos/google/maps/routing/v2/fallback_info.proto", - "../../protos/google/maps/routing/v2/geocoding_results.proto", - "../../protos/google/maps/routing/v2/localized_time.proto", - "../../protos/google/maps/routing/v2/location.proto", - "../../protos/google/maps/routing/v2/maneuver.proto", - "../../protos/google/maps/routing/v2/navigation_instruction.proto", - "../../protos/google/maps/routing/v2/polyline.proto", - "../../protos/google/maps/routing/v2/polyline_details.proto", - "../../protos/google/maps/routing/v2/route.proto", - "../../protos/google/maps/routing/v2/route_label.proto", - "../../protos/google/maps/routing/v2/route_modifiers.proto", - "../../protos/google/maps/routing/v2/route_travel_mode.proto", - "../../protos/google/maps/routing/v2/routes_service.proto", - "../../protos/google/maps/routing/v2/routing_preference.proto", - "../../protos/google/maps/routing/v2/speed_reading_interval.proto", - "../../protos/google/maps/routing/v2/toll_info.proto", - "../../protos/google/maps/routing/v2/toll_passes.proto", - "../../protos/google/maps/routing/v2/traffic_model.proto", - "../../protos/google/maps/routing/v2/transit.proto", - "../../protos/google/maps/routing/v2/transit_preferences.proto", - "../../protos/google/maps/routing/v2/units.proto", - "../../protos/google/maps/routing/v2/vehicle_emission_type.proto", - "../../protos/google/maps/routing/v2/vehicle_info.proto", - "../../protos/google/maps/routing/v2/waypoint.proto" -] diff --git a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 9073b2c4213..00000000000 --- a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const routing = require('@googlemaps/routing'); - -function main() { - const routesClient = new routing.RoutesClient(); -} - -main(); diff --git a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index cf74121e36d..00000000000 --- a/owl-bot-staging/google-maps-routing/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {RoutesClient} from '@googlemaps/routing'; - -// check that the client class type name can be used -function doStuffWithRoutesClient(client: RoutesClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const routesClient = new RoutesClient(); - doStuffWithRoutesClient(routesClient); -} - -main(); diff --git a/owl-bot-staging/google-maps-routing/system-test/install.ts b/owl-bot-staging/google-maps-routing/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-maps-routing/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts b/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts deleted file mode 100644 index 1c3a80333b1..00000000000 --- a/owl-bot-staging/google-maps-routing/test/gapic_routes_v2.ts +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as routesModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -describe('v2.RoutesClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new routesModule.v2.RoutesClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'routes.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new routesModule.v2.RoutesClient(); - 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 = routesModule.v2.RoutesClient.servicePath; - assert.strictEqual(servicePath, 'routes.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = routesModule.v2.RoutesClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'routes.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new routesModule.v2.RoutesClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'routes.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new routesModule.v2.RoutesClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'routes.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 routesModule.v2.RoutesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = routesModule.v2.RoutesClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new routesModule.v2.RoutesClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new routesModule.v2.RoutesClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.routesStub, undefined); - await client.initialize(); - assert(client.routesStub); - }); - - it('has close method for the initialized client', done => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.routesStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.routesStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new routesModule.v2.RoutesClient({ - 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 routesModule.v2.RoutesClient({ - 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('computeRoutes', () => { - it('invokes computeRoutes without error', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesResponse() - ); - client.innerApiCalls.computeRoutes = stubSimpleCall(expectedResponse); - const [response] = await client.computeRoutes(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes computeRoutes without error using callback', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesResponse() - ); - client.innerApiCalls.computeRoutes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.computeRoutes( - request, - (err?: Error|null, result?: protos.google.maps.routing.v2.IComputeRoutesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes computeRoutes with error', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.computeRoutes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.computeRoutes(request), expectedError); - }); - - it('invokes computeRoutes with closed client', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRoutesRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.computeRoutes(request), expectedError); - }); - }); - - describe('computeRouteMatrix', () => { - it('invokes computeRouteMatrix without error', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.maps.routing.v2.RouteMatrixElement() - ); - client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(expectedResponse); - const stream = client.computeRouteMatrix(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes computeRouteMatrix without error and gaxServerStreamingRetries enabled', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - gaxServerStreamingRetries: true - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.maps.routing.v2.RouteMatrixElement() - ); - client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(expectedResponse); - const stream = client.computeRouteMatrix(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes computeRouteMatrix with error', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall(undefined, expectedError); - const stream = client.computeRouteMatrix(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - - it('invokes computeRouteMatrix with closed client', async () => { - const client = new routesModule.v2.RoutesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - const stream = client.computeRouteMatrix(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.maps.routing.v2.RouteMatrixElement) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - it('should create a client with gaxServerStreamingRetries enabled', () => { - const client = new routesModule.v2.RoutesClient({ - gaxServerStreamingRetries: true, - }); - assert(client); - }); - }); -}); diff --git a/owl-bot-staging/google-maps-routing/tsconfig.json b/owl-bot-staging/google-maps-routing/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-maps-routing/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-maps-routing/webpack.config.js b/owl-bot-staging/google-maps-routing/webpack.config.js deleted file mode 100644 index 311cb75c287..00000000000 --- a/owl-bot-staging/google-maps-routing/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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: 'Routes', - filename: './routes.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/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto index c60200e425e..a0ef20364bb 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto index 12fc2b011ae..70ba902ab3a 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/geocoding_results.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto index b60db2dc610..7ec111af21b 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/localized_time.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto index 999f98f3fca..88ca2a6f1f2 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto index 5855e156033..13bb3e0b0b1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto index c4702b71dc8..e944e88f111 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto index 34f28f0d1dc..523f78a1f27 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto index 5d9848389c3..a56da6c86aa 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline_details.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto index 3d9386a4e88..42d73042fac 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -121,8 +121,8 @@ message Route { RouteLocalizedValues localized_values = 11; // An opaque token that can be passed to [Navigation - // SDK](https://developers.google.com/maps/documentation/navigation) to - // reconstruct the route during navigation, and, in the event of rerouting, + // SDK](https://developers.google.com/maps/documentation/mobility/driver-sdk/navigation) + // to reconstruct the route during navigation, and, in the event of rerouting, // honor the original intention when the route was created. Treat this token // as an opaque blob. Don't compare its value across requests as its value // may change even if the service returns the exact same route. @@ -141,16 +141,21 @@ message Route { // about, such as possible traffic zone restrictions. message RouteTravelAdvisory { // Contains information about tolls on the route. This field is only populated - // if tolls are expected on the route. If this field is set, but the - // `estimatedPrice` subfield is not populated, then the route contains tolls, - // but the estimated price is unknown. If this field is not set, then there - // are no tolls expected on the route. + // if tolls are expected on the route and `TOLLS` is included in the request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // If this field is set, but the `estimatedPrice` subfield is not populated, + // then the route contains tolls, but the estimated price is unknown. If + // `toll_info` is not set, then there are no tolls expected on the route. TollInfo toll_info = 2; - // Speed reading intervals detailing traffic density. Applicable in case of - // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. - // The intervals cover the entire polyline of the route without overlap. - // The start point of a specified interval is the same as the end point of the + // Speed reading intervals indicating traffic density. This field is only + // populated for requests when the request has a `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL` + // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] + // value, and `TRAFFIC_ON_POLYLINE` is included in the + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // The intervals cover the entire polyline of the route without overlap. The + // start point of a specified interval is the same as the end point of the // preceding interval. // // Example: @@ -160,6 +165,9 @@ message RouteTravelAdvisory { repeated SpeedReadingInterval speed_reading_intervals = 3; // The predicted fuel consumption in microliters. + // This field is only populated when `FUEL_CONSUMPTION` is included in the + // request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. int64 fuel_consumption_microliters = 5; // Returned route may have restrictions that are not suitable for requested @@ -177,14 +185,20 @@ message RouteTravelAdvisory { message RouteLegTravelAdvisory { // Contains information about tolls on the specific `RouteLeg`. // This field is only populated if we expect there are tolls on the - // `RouteLeg`. If this field is set but the estimated_price subfield is not + // `RouteLeg` and `TOLLS` is included in the request's + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. + // If this field is set but the estimated_price subfield is not // populated, we expect that road contains tolls but we do not know an - // estimated price. If this field does not exist, then there is no toll on the - // `RouteLeg`. + // estimated price. If `toll_info` does not exist, then there is no toll on + // the `RouteLeg`. TollInfo toll_info = 1; - // Speed reading intervals detailing traffic density. Applicable in case of - // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // Speed reading intervals indicating traffic density. This field is only + // populated for requests when the request has a `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL` + // [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference] + // value, and `TRAFFIC_ON_POLYLINE` is included in the + // [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations]. // The intervals cover the entire polyline of the `RouteLeg` without overlap. // The start point of a specified interval is the same as the end point of the // preceding interval. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto index 4adffb30de0..c88c941b6b1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_label.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto index 534017ea381..512bdd0d766 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto index 1b8fda47d17..f43b50adbc8 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto index 435c21a4ada..ae7a21e616f 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -235,8 +235,8 @@ message ComputeRoutesRequest { [(google.api.field_behavior) = OPTIONAL]; // Optional. The arrival time. - // NOTE: Can only be set when - // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to + // NOTE: This field is ignored when requests specify a + // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] other than // `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but // not both. Transit trips are available for up to 7 days in the past or 100 // days in the future. @@ -431,6 +431,7 @@ message ComputeRouteMatrixRequest { // traffic. This setting affects the value returned in the duration field in // the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which // contains the predicted time in traffic based on historical averages. + // `TrafficModel` is only available for requests that have set // [RoutingPreference][google.maps.routing.v2.RoutingPreference] to // `TRAFFIC_AWARE_OPTIMAL` and // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto index 1138241e1f5..e64b59c17be 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto index c493001bcaf..e95803ffec0 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,13 +35,13 @@ message SpeedReadingInterval { // Default value. This value is unused. SPEED_UNSPECIFIED = 0; - // Normal speed, no slowdown is detected. + // Normal speed, no traffic delays. NORMAL = 1; - // Slowdown detected, but no traffic jam formed. + // Slowdown detected, medium amount of traffic. SLOW = 2; - // Traffic jam detected. + // Traffic delays. TRAFFIC_JAM = 3; } @@ -51,6 +51,7 @@ message SpeedReadingInterval { // The ending index of this interval in the polyline. optional int32 end_polyline_point_index = 2; + // The type of speed in this interval. oneof speed_type { // Traffic speed in this interval. Speed speed = 3; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto index 0c36df53210..b2296adeb3b 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/type/money.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto index dde43313486..ee2b94091a9 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto index 9afc2391c07..d680e1c46c1 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/traffic_model.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,10 +25,14 @@ option objc_class_prefix = "GMRV2"; option php_namespace = "Google\\Maps\\Routing\\V2"; option ruby_package = "Google::Maps::Routing::V2"; -// Specifies the assumptions to use when calculating time in traffic. This -// setting affects the value returned in the `duration` field in the -// response, which contains the predicted time in traffic based on historical -// averages. +// This field specifies one of the following assumptions to use when calculating +// travel time in traffic conditions, shown in the enums below. Depending on the +// enum chosen, the `duration` field of the TrafficModel response will vary. The +// value contains the predicted time to destination in traffic, based on +// historical averages. `TrafficModel` is only available for requests that have +// set [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to +// `TRAFFIC_AWARE_OPTIMAL` and +// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`. enum TrafficModel { // Unused. If specified, will default to `BEST_GUESS`. TRAFFIC_MODEL_UNSPECIFIED = 0; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto index 142e44af191..295a3203f73 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/transit.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto index 392ea4534cf..0f977cdd1b4 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/transit_preferences.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto index 581768ee7f4..e073a136bb6 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto index 96aaf46f2c0..285fe8c3bc5 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto index 6a0a66c4ef7..6e40a2adb70 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package google.maps.routing.v2; import "google/maps/routing/v2/vehicle_emission_type.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto index fb2f5ed2db2..05c7bd1fdf2 100644 --- a/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,6 +42,11 @@ message Waypoint { // Human readable address or a plus code. // See https://plus.codes for details. string address = 7; + + // A token that identifies a + // [`NavigationPoint`](https://developers.google.com/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations/searchDestinations#navigationpoint), + // obtained from the `SearchDestinations` method of the Geocoding API. + string navigation_point_token = 8; } // Marks this waypoint as a milestone rather a stopping point. For diff --git a/packages/google-maps-routing/protos/protos.d.ts b/packages/google-maps-routing/protos/protos.d.ts index 3ed6c19d02b..e210ac2e81c 100644 --- a/packages/google-maps-routing/protos/protos.d.ts +++ b/packages/google-maps-routing/protos/protos.d.ts @@ -11267,6 +11267,9 @@ export namespace google { /** Waypoint address */ address?: (string|null); + /** Waypoint navigationPointToken */ + navigationPointToken?: (string|null); + /** Waypoint via */ via?: (boolean|null); @@ -11295,6 +11298,9 @@ export namespace google { /** Waypoint address. */ public address?: (string|null); + /** Waypoint navigationPointToken. */ + public navigationPointToken?: (string|null); + /** Waypoint via. */ public via: boolean; @@ -11305,7 +11311,7 @@ export namespace google { public sideOfRoad: boolean; /** Waypoint locationType. */ - public locationType?: ("location"|"placeId"|"address"); + public locationType?: ("location"|"placeId"|"address"|"navigationPointToken"); /** * Creates a new Waypoint instance using the specified properties. diff --git a/packages/google-maps-routing/protos/protos.js b/packages/google-maps-routing/protos/protos.js index 9d669830ec2..f61a469c4b6 100644 --- a/packages/google-maps-routing/protos/protos.js +++ b/packages/google-maps-routing/protos/protos.js @@ -31376,6 +31376,7 @@ * @property {google.maps.routing.v2.ILocation|null} [location] Waypoint location * @property {string|null} [placeId] Waypoint placeId * @property {string|null} [address] Waypoint address + * @property {string|null} [navigationPointToken] Waypoint navigationPointToken * @property {boolean|null} [via] Waypoint via * @property {boolean|null} [vehicleStopover] Waypoint vehicleStopover * @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad @@ -31420,6 +31421,14 @@ */ Waypoint.prototype.address = null; + /** + * Waypoint navigationPointToken. + * @member {string|null|undefined} navigationPointToken + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.navigationPointToken = null; + /** * Waypoint via. * @member {boolean} via @@ -31449,12 +31458,12 @@ /** * Waypoint locationType. - * @member {"location"|"placeId"|"address"|undefined} locationType + * @member {"location"|"placeId"|"address"|"navigationPointToken"|undefined} locationType * @memberof google.maps.routing.v2.Waypoint * @instance */ Object.defineProperty(Waypoint.prototype, "locationType", { - get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address"]), + get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address", "navigationPointToken"]), set: $util.oneOfSetter($oneOfFields) }); @@ -31494,6 +31503,8 @@ writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sideOfRoad); if (message.address != null && Object.hasOwnProperty.call(message, "address")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.address); + if (message.navigationPointToken != null && Object.hasOwnProperty.call(message, "navigationPointToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.navigationPointToken); return writer; }; @@ -31542,6 +31553,10 @@ message.address = reader.string(); break; } + case 8: { + message.navigationPointToken = reader.string(); + break; + } case 3: { message.via = reader.bool(); break; @@ -31612,6 +31627,13 @@ if (!$util.isString(message.address)) return "address: string expected"; } + if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { + if (properties.locationType === 1) + return "locationType: multiple values"; + properties.locationType = 1; + if (!$util.isString(message.navigationPointToken)) + return "navigationPointToken: string expected"; + } if (message.via != null && message.hasOwnProperty("via")) if (typeof message.via !== "boolean") return "via: boolean expected"; @@ -31645,6 +31667,8 @@ message.placeId = String(object.placeId); if (object.address != null) message.address = String(object.address); + if (object.navigationPointToken != null) + message.navigationPointToken = String(object.navigationPointToken); if (object.via != null) message.via = Boolean(object.via); if (object.vehicleStopover != null) @@ -31693,6 +31717,11 @@ if (options.oneofs) object.locationType = "address"; } + if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) { + object.navigationPointToken = message.navigationPointToken; + if (options.oneofs) + object.locationType = "navigationPointToken"; + } return object; }; diff --git a/packages/google-maps-routing/protos/protos.json b/packages/google-maps-routing/protos/protos.json index 265db179e54..6a7aa6dc9b6 100644 --- a/packages/google-maps-routing/protos/protos.json +++ b/packages/google-maps-routing/protos/protos.json @@ -1578,8 +1578,7 @@ "java_package": "com.google.maps.routing.v2", "objc_class_prefix": "GMRV2", "php_namespace": "Google\\Maps\\Routing\\V2", - "ruby_package": "Google::Maps::Routing::V2", - "cc_enable_arenas": true + "ruby_package": "Google::Maps::Routing::V2" }, "nested": { "FallbackInfo": { @@ -3045,7 +3044,8 @@ "oneof": [ "location", "placeId", - "address" + "address", + "navigationPointToken" ] } }, @@ -3062,6 +3062,10 @@ "type": "string", "id": 7 }, + "navigationPointToken": { + "type": "string", + "id": 8 + }, "via": { "type": "bool", "id": 3 diff --git a/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js b/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js index ac72cf5dfdc..487027070e2 100644 --- a/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js +++ b/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js @@ -107,6 +107,7 @@ function main(origins, destinations) { * traffic. This setting affects the value returned in the duration field in * the RouteMatrixElement google.maps.routing.v2.RouteMatrixElement which * contains the predicted time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set * RoutingPreference google.maps.routing.v2.RoutingPreference to * `TRAFFIC_AWARE_OPTIMAL` and * RouteTravelMode google.maps.routing.v2.RouteTravelMode to `DRIVE`. diff --git a/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js index df470c9ea59..32acd7be8f8 100644 --- a/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js +++ b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js @@ -73,8 +73,8 @@ function main(origin, destination) { // const departureTime = {} /** * Optional. The arrival time. - * NOTE: Can only be set when - * RouteTravelMode google.maps.routing.v2.RouteTravelMode is set to + * NOTE: This field is ignored when requests specify a + * RouteTravelMode google.maps.routing.v2.RouteTravelMode other than * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but * not both. Transit trips are available for up to 7 days in the past or 100 * days in the future. diff --git a/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json b/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json index cfac31f0606..fe1c5b047d2 100644 --- a/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json +++ b/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json @@ -134,7 +134,7 @@ "segments": [ { "start": 25, - "end": 145, + "end": 146, "type": "FULL" } ], diff --git a/packages/google-maps-routing/src/v2/routes_client.ts b/packages/google-maps-routing/src/v2/routes_client.ts index c630c8216f2..e966e0737d0 100644 --- a/packages/google-maps-routing/src/v2/routes_client.ts +++ b/packages/google-maps-routing/src/v2/routes_client.ts @@ -397,8 +397,8 @@ export class RoutesClient { * days in the future. * @param {google.protobuf.Timestamp} [request.arrivalTime] * Optional. The arrival time. - * NOTE: Can only be set when - * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} is set to + * NOTE: This field is ignored when requests specify a + * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} other than * `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but * not both. Transit trips are available for up to 7 days in the past or 100 * days in the future. @@ -653,6 +653,7 @@ export class RoutesClient { * traffic. This setting affects the value returned in the duration field in * the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which * contains the predicted time in traffic based on historical averages. + * `TrafficModel` is only available for requests that have set * {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to * `TRAFFIC_AWARE_OPTIMAL` and * {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.