From a4ac33a1b52469c0aa1a3babc520dcf9bf23cb16 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 4 Jun 2024 23:29:32 +0000 Subject: [PATCH 1/2] feat: introduce Maps RouteOptimization --- .repo-metadata-full.json | 10 +- MapsRouteOptimization/.OwlBot.yaml | 4 + MapsRouteOptimization/.gitattributes | 7 + .../.github/pull_request_template.md | 24 + MapsRouteOptimization/CONTRIBUTING.md | 10 + MapsRouteOptimization/LICENSE | 202 +++ MapsRouteOptimization/README.md | 45 + MapsRouteOptimization/VERSION | 1 + MapsRouteOptimization/composer.json | 30 + .../metadata/V1/RouteOptimizationService.php | Bin 0 -> 17092 bytes MapsRouteOptimization/owlbot.py | 62 + MapsRouteOptimization/phpunit.xml.dist | 16 + .../batch_optimize_tours.php | 121 ++ .../optimize_tours.php | 89 ++ .../src/V1/AggregatedMetrics.php | 454 ++++++ .../src/V1/BatchOptimizeToursMetadata.php | 33 + .../src/V1/BatchOptimizeToursRequest.php | 125 ++ .../AsyncModelConfig.php | 160 ++ .../src/V1/BatchOptimizeToursResponse.php | 34 + MapsRouteOptimization/src/V1/BreakRule.php | 113 ++ .../src/V1/BreakRule/BreakRequest.php | 170 ++ .../src/V1/BreakRule/FrequencyConstraint.php | 164 ++ .../src/V1/Client/RouteOptimizationClient.php | 311 ++++ MapsRouteOptimization/src/V1/DataFormat.php | 62 + .../src/V1/DistanceLimit.php | 216 +++ .../src/V1/GcsDestination.php | 68 + MapsRouteOptimization/src/V1/GcsSource.php | 71 + .../src/V1/InjectedSolutionConstraint.php | 156 ++ .../ConstraintRelaxation.php | 149 ++ .../ConstraintRelaxation/Relaxation.php | 202 +++ .../ConstraintRelaxation/Relaxation/Level.php | 80 + MapsRouteOptimization/src/V1/InputConfig.php | 110 ++ MapsRouteOptimization/src/V1/Location.php | 133 ++ .../src/V1/OptimizeToursRequest.php | 1178 ++++++++++++++ .../V1/OptimizeToursRequest/SearchMode.php | 63 + .../V1/OptimizeToursRequest/SolvingMode.php | 81 + .../src/V1/OptimizeToursResponse.php | 239 +++ .../src/V1/OptimizeToursResponse/Metrics.php | 370 +++++ .../src/V1/OptimizeToursValidationError.php | 1179 ++++++++++++++ .../FieldReference.php | 195 +++ MapsRouteOptimization/src/V1/OutputConfig.php | 111 ++ MapsRouteOptimization/src/V1/Shipment.php | 841 ++++++++++ .../src/V1/Shipment/Load.php | 79 + .../src/V1/Shipment/VisitRequest.php | 613 ++++++++ .../src/V1/ShipmentModel.php | 1010 ++++++++++++ .../ShipmentModel/DurationDistanceMatrix.php | 135 ++ .../DurationDistanceMatrix/Row.php | 114 ++ .../src/V1/ShipmentModel/PrecedenceRule.php | 241 +++ .../src/V1/ShipmentRoute.php | 706 +++++++++ .../src/V1/ShipmentRoute/EncodedPolyline.php | 71 + .../src/V1/ShipmentRoute/PBBreak.php | 122 ++ .../src/V1/ShipmentRoute/Transition.php | 571 +++++++ .../src/V1/ShipmentRoute/VehicleLoad.php | 78 + .../src/V1/ShipmentRoute/Visit.php | 431 ++++++ .../src/V1/ShipmentTypeIncompatibility.php | 107 ++ .../IncompatibilityMode.php | 70 + .../src/V1/ShipmentTypeRequirement.php | 156 ++ .../RequirementMode.php | 78 + .../src/V1/SkippedShipment.php | 153 ++ .../src/V1/SkippedShipment/Reason.php | 179 +++ .../src/V1/SkippedShipment/Reason/Code.php | 114 ++ MapsRouteOptimization/src/V1/TimeWindow.php | 388 +++++ .../src/V1/TransitionAttributes.php | 412 +++++ MapsRouteOptimization/src/V1/Vehicle.php | 1375 +++++++++++++++++ .../src/V1/Vehicle/DurationLimit.php | 357 +++++ .../src/V1/Vehicle/LoadLimit.php | 268 ++++ .../src/V1/Vehicle/LoadLimit/Interval.php | 148 ++ .../src/V1/Vehicle/TravelMode.php | 65 + .../src/V1/Vehicle/UnloadingPolicy.php | 66 + MapsRouteOptimization/src/V1/Waypoint.php | 166 ++ .../src/V1/gapic_metadata.json | 28 + .../route_optimization_client_config.json | 44 + .../route_optimization_descriptor_config.php | 59 + .../route_optimization_rest_client_config.php | 80 + .../V1/Client/RouteOptimizationClientTest.php | 327 ++++ composer.json | 3 + 76 files changed, 16502 insertions(+), 1 deletion(-) create mode 100644 MapsRouteOptimization/.OwlBot.yaml create mode 100644 MapsRouteOptimization/.gitattributes create mode 100644 MapsRouteOptimization/.github/pull_request_template.md create mode 100644 MapsRouteOptimization/CONTRIBUTING.md create mode 100644 MapsRouteOptimization/LICENSE create mode 100644 MapsRouteOptimization/README.md create mode 100644 MapsRouteOptimization/VERSION create mode 100644 MapsRouteOptimization/composer.json create mode 100644 MapsRouteOptimization/metadata/V1/RouteOptimizationService.php create mode 100644 MapsRouteOptimization/owlbot.py create mode 100644 MapsRouteOptimization/phpunit.xml.dist create mode 100644 MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php create mode 100644 MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php create mode 100644 MapsRouteOptimization/src/V1/AggregatedMetrics.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php create mode 100644 MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php create mode 100644 MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php create mode 100644 MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php create mode 100644 MapsRouteOptimization/src/V1/DataFormat.php create mode 100644 MapsRouteOptimization/src/V1/DistanceLimit.php create mode 100644 MapsRouteOptimization/src/V1/GcsDestination.php create mode 100644 MapsRouteOptimization/src/V1/GcsSource.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php create mode 100644 MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php create mode 100644 MapsRouteOptimization/src/V1/InputConfig.php create mode 100644 MapsRouteOptimization/src/V1/Location.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursResponse.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursValidationError.php create mode 100644 MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php create mode 100644 MapsRouteOptimization/src/V1/OutputConfig.php create mode 100644 MapsRouteOptimization/src/V1/Shipment.php create mode 100644 MapsRouteOptimization/src/V1/Shipment/Load.php create mode 100644 MapsRouteOptimization/src/V1/Shipment/VisitRequest.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php create mode 100644 MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment/Reason.php create mode 100644 MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php create mode 100644 MapsRouteOptimization/src/V1/TimeWindow.php create mode 100644 MapsRouteOptimization/src/V1/TransitionAttributes.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/TravelMode.php create mode 100644 MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php create mode 100644 MapsRouteOptimization/src/V1/Waypoint.php create mode 100644 MapsRouteOptimization/src/V1/gapic_metadata.json create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php create mode 100644 MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php create mode 100644 MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index fea1759fef1b..54939bcc2786 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -855,6 +855,14 @@ "library_type": "GAPIC_AUTO", "api_shortname": "fleetengine" }, + "MapsRouteOptimization": { + "language": "php", + "distribution_name": "google/maps-routeoptimization", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/maps-routeoptimization/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "routeoptimization" + }, "MediaTranslation": { "language": "php", "distribution_name": "google/cloud-media-translation", @@ -1472,4 +1480,4 @@ "library_type": "GAPIC_AUTO", "api_shortname": "workflows" } -} +} \ No newline at end of file diff --git a/MapsRouteOptimization/.OwlBot.yaml b/MapsRouteOptimization/.OwlBot.yaml new file mode 100644 index 000000000000..408c54437af1 --- /dev/null +++ b/MapsRouteOptimization/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/maps/routeoptimization/(v1)/.*-php/(.*) + dest: /owl-bot-staging/MapsRouteOptimization/$1/$2 +api-name: MapsRouteOptimization diff --git a/MapsRouteOptimization/.gitattributes b/MapsRouteOptimization/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/MapsRouteOptimization/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/MapsRouteOptimization/.github/pull_request_template.md b/MapsRouteOptimization/.github/pull_request_template.md new file mode 100644 index 000000000000..957c01edbc65 --- /dev/null +++ b/MapsRouteOptimization/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `MapsRouteOptimization/src`, and tests in `MapsRouteOptimization/tests`. + +* Push the changes in a new branch to a fork, and open a new pull request +[here](https://github.com/googleapis/google-cloud-php). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/MapsRouteOptimization/CONTRIBUTING.md b/MapsRouteOptimization/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/MapsRouteOptimization/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/MapsRouteOptimization/LICENSE b/MapsRouteOptimization/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/MapsRouteOptimization/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/MapsRouteOptimization/README.md b/MapsRouteOptimization/README.md new file mode 100644 index 000000000000..af28ca684341 --- /dev/null +++ b/MapsRouteOptimization/README.md @@ -0,0 +1,45 @@ +# Google Maps Route Optimization for PHP + +> Idiomatic PHP client for [Google Maps Route Optimization](https://developers.google.com/maps/documentation/route-optimization). + +[![Latest Stable Version](https://poser.pugx.org/google/maps-routeoptimization/v/stable)](https://packagist.org/packages/google/maps-routeoptimization) [![Packagist](https://img.shields.io/packagist/dm/google/maps-routeoptimization.svg)](https://packagist.org/packages/google/maps-routeoptimization) + +* [API documentation](https://cloud.google.com/php/docs/reference/maps-routeoptimization/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/maps-routeoptimization +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-maps-routeoptimization/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/maps/documentation/route-optimization). diff --git a/MapsRouteOptimization/VERSION b/MapsRouteOptimization/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/MapsRouteOptimization/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/MapsRouteOptimization/composer.json b/MapsRouteOptimization/composer.json new file mode 100644 index 000000000000..8a3211233826 --- /dev/null +++ b/MapsRouteOptimization/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/maps-routeoptimization", + "description": "Google Maps Route Optimization Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Maps\\RouteOptimization\\": "src", + "GPBMetadata\\Google\\Maps\\Routeoptimization\\": "metadata" + } + }, + "extra": { + "component": { + "id": "maps-routeoptimization", + "path": "MapsRouteOptimization", + "target": "googleapis/php-maps-routeoptimization" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/MapsRouteOptimization/metadata/V1/RouteOptimizationService.php b/MapsRouteOptimization/metadata/V1/RouteOptimizationService.php new file mode 100644 index 0000000000000000000000000000000000000000..827cfb27474fa165cdf329557998b2f9d0c7b480 GIT binary patch literal 17092 zcmcg!OKc-ob~ULVd8u!yKWz5LY_>h_Znr5*{=}i(_K;$!MK>kNB&F^)l++Z-l2p?a zi>@lFTORZ#NQ_K?06`{;Ajl%fB8vbM43cGl1VMJ5Rc4U=EP^Zs2@qtLUG9CKViie| zRD0}RsjJ?*@4fr(=iE>6qfgpLZMc z)^Xcx8g@FF%$JherD{^m7pgaLs$+HRx{*m9TGnCHSUJ|)&WdeyT*GR+=CS#u?wVF> z3 z)2h=ck~E>zsvEcOBsonQ`&!#VKHX2sjqVWZkZt>gmTTB8y}6$^oVsncUCZ9Vp_$B~ z;d%_GC%5m2Wr>`5ki5(K7BT4w8Tztkq-Jl}S` zTgZ3#-0_$8rdCaqM^`^?k3YA1+BWu!y4!3W4xYrM<*koRAsg97!xM!KRIuCL<m$nRwOr;()GFtBJc518#`{&F+P* zSl)$+K{v!8rs${}D-CfgJ*#-{(R6Uuive*#z(xM9G#P*So7Atua3!a^^&_GAMimW` zQ#QWnAOU3=rrWxWLK_byL${;3iC<;I$`Q;RTMeVB)veZndFaH$$%)&swPKntayFaN zXD*b^I;XAr7ExViMA=G-e+|K6?;GU`%r;D?-PBJtvUuH{g_KR0HCyeDD|Ut(3*pAz z8ojXs&GN0Rd<;ZLwqb#s%QXa#sV>M6Ez-UA#K8XyP zU(1aqGw3+!3MWORl|6_#hHlr7IN@nVIQz1M86`&d5!^6aKQ!v-r?msqc3ce)&>_R9 zF{O6mGfa@r!3yRxl^R_02zw+^IULv4(Ne`DOm;pReS(769&&^23#CZVP)cygHV$mV zIno;F+RdgTHywSsO|QZoW<}fR0MV5TzR2x6TF0TQZR$0n>BIp~5K*qfMLLz)Fl=00 zZ)kYFg9Ec3kFnPYP})|zgXYE1+E(+lX|@a}KFi*{4%fYRI17m|zITVsv0?8+T5mS3 zXSl9?Xy8fp22sI3oVJN%*^ccFf)u(m(|H=7XY+2rrH*50hX%@zW7ah^5U!3$!-+4j z_xo=^!h3maAh2*WG_r`G@Ia0DA`S{|zVe5mkdlIn$NF>a1aS?*CtAj^ZOeAzQ#fX7 zGel$NV2bf2zJ$-BsV5M_3nNWnVzvZxd37VZTdZo8QgKgRd_}=Wd)Z&$v#_(JZdWUd;ne2>~ASv8ZMDvV~%n7N{1s)WvY_ zI$Z5CtdA$TI9$>Oaw7G2({QmziMcIPK7nbWNuie$%8M{(bJxQqj~S<^QiLVvso8F$ z;yS_zIcRXm>#UB}stTVf&6n~7mIhrfQTuo_wZO^uJTXy8N|YU#K~CCc-HDUgimiQe zPJ(3=baD%6^Z-OA@h=lFBmP!)A+8@D+QuP;8eIJ~xg7cD*xEazm&2)He zwp{yEQ2<=T`vi9!mtAWpaSy;ZA_fyrjZ+Rp$T*;MbqvO`P$v9ADD{s3b5i=qL^PHA z5bX*w*Oj}Yw=8KOt0IEM5`5hmJ$sK|nv#TN(rX=KvJ*pI6{!>1H)aFhgQdf!Rl_6u zE^zc6yaNkjns;$r35MM|ItDRGVp_&$W}S}^ilR?O+pPQ$65e}h+|fLdj-Zi`uuI<< z%>&6nb_*UB$_sC?Mf9F4ci`q3YdzN-yRNx9VqWsP(V;^dD9LOniDVR&_oC17=`Jo+ z!!X}L=SdR#{^-qDJ-?atW-ABqs+1&+&^@|HN;aVDs+mo6vdjb10{2HRAh| zRQVl91lJ)uZQ2F_LMJ}Q&hXpkTY`cNK>^X^A_9@R(J;_!Yj&rJ`<`b+$1urq-~3j0 zJUV40llVmlE=kbabJ34s(zc#CsJLU=jNn3psiw=;GmKG|dTgM6$P7X>u?`b7;vPh$ zkjV`U0qgTHjfNgk3lf>Q9ZLLL2&VM_fh1`)}4@%2c5=?Fw)l=&*shuFRX1~Qp`Q&?uhO~AlFynGQ-Y3|BRew z_Hhb@W{QN8`ABA4g?OSrLwQne!j-;PbS-Q)MMYD}dvKfcSaU5;j5OOopG|%QgA%mX zS`%}YJm3j&F?u*~nqFgpM$fb;9wxSSwhSrX$0&l`b6^hy5yZk2rwpZl05f35Sm+Y% zB6^Beq6(^;dDyaS0}UI>d*Xj5VKyKpZ^5E&+a@}Ct!dR+oWL|Lwze#9myB_`sJq41 zp_1P;BjWVbpN1_%?1U@=^QIh6`s9Nm-Dsi?i+%F~AP|!)T@V;sJ4Z%=ZHQ1~ z;u1{KA|#CZu?NB@zLUk7b@m&Y+?#Mm8=!jw^*{ADVYn*UJqS!7Mke*();g+Ka3P3V zPI=~sRAhebv+=KXz*^}ZAVU}-^;HO#2Rx^sys*7q+S;B+su+8J4^lLwupM}zRSH{}7RYX^rQHf<0m7;O3S&qw zB3jzK9}>L@w*|cgpq30RK8`sL}XS;>6N?DCT480ClhA}e*H+mVFMfMlgAMWmm zWCp*vAhU5yUM&{()bbNPY9jU3GR(*@s252jNwbv##1N&QU~>By1%=u4`L%aPGe}TP zBSy!`#0#`>^E`YS$5iL!;BR22@4zetUfyy%VjJigzR!nxi}5(^JU#)VVi6otG(->~ zsw_f;MSk>zLNWqoN;ibmq{rYH%kz1R4Oo;>rALRy`sbtbI>f~VO9!MKcbcx*ZW;^= z2ryNF#ZIe<=9iM7n58u9r!12>zcxmYBZXmCQrKYxlx>I+Nsd*V_zmW{&OwjdL6HEK z$V?!ZA;;K_m02DW6MvVy$Na1a30W*n`N|MwalH3W&8Ed7i@3tx;k6!^&v88SxXbJr zPp&pJ^FZXBu=Z;lx82kD1$-aD$o2xu`gy^C0Am;NZES4}^ep+67ga5GMl1tRz)Y&> z-4sWcm%bU@EpNLb>=)a;%*c-6s$~?(xA`U9GM?i`HI5p*y&hP$ctln>9%q-mHNGWL zi6{e|k}VsS&Hhi0f=2_N0Mu+lf64;p_!V}5H%Bj#qd62DcX97koa@KE*YN+5#4p1T z^@L8j2oXvgkq9%xIKi_;1gWh9^eFNjx$OzG$k#k6>tNwu(`y#S334b4Ktq^|U6w`? z6@#Vs5jcr#;TRPYDLURR(chzUL>kH?SmNf;Png@pZ$vn;3K4G+M199*i?ajm-vly& zA$!i7+%!xQUve>sdi+WJPZ%o%0a0IpS>m3Q9T7?l354Fogt+9nH;YFULuTFaT?yF( zO+P?h^;`+R)Q{on7ahGpwg0*|pu0gHLkw9e18;e^?;s_NSbQt?lVxd+16c4RL>SKiUe5*b`WR{SKEY#{{RePs9K8*!eLJ}J*-T}*le+PSs$c*EbuQxjlL^tvcogj*((;1Ph7xhN}Q2B;TUR05}2zG~OASrfV z$^)2h1OWz5betPtpnbrUq<$*e2+p<-sXq!q#LE_a3=uC9;2Jdsyf2EZ(&j5z_KIMS z4JPBw2Gg-9KBIIoR{u4NkRYM}iXS7?suQAwfn1ISsi`tVBsIhWGngjSu&YZb_rRd! z0?Zs?!5c+{YFznY$fgffBh17qd z@X0I+@5n(+dLnAnm~fQk5Ja%vW8T2Q_5XcP~BUDK)Df~!ZmBYS%AJ`N1s=~fXbIUhk#J%l5w@@`Ie)izn(eWClP~;qm2?W9-3lzc}DP^Uo zmyYz#(mE~u1bh7S8fK-KlT}s`P7n&{TI`WA7*6Ri$lRn2VgB1N_e{rF-811lF*sxf zF2cpxn=-PV6O>Kf963xj`)v*{6rNildu>kL=ME6gNYgV$BXdyEyGArE!a@o*d7PPO z!&2WvjK+K&L!Sl%z;o1xh0bwLM{BYm^g6_REBfk349zEQ!a^@2u*AfQl7yg0tr{@J z&1vweM#7RnU2l}{#yrYGuZaxsWk4s@S5vUi+s=o>{FV~`>-X&in89q9gIEp~iOl#I z=&)x6ta1>6#E&Oon*XUhq>`jp9~h^#CfI{0NMf5A77DQC)Oe1cNnk^rgcJNg#6i)+ z@jbX9$6yd+V4n=8Xm$M9$HYzmmS7|^5l#I(43muL1z23~ZxWpc*e?0%RJY*OytrtV)i7~$@dTIGW1uI+Ys#Yv) z6{?F9<4)TxW3jEYEv8K>AHfG>tR}J^`QYp+4x;dW1c-Gpq+zvORD$sh>~6Qhz5UnsMwZ#-RV0Vod4Bc?Tsa&(t92F-lLAKBGJe ztA9t%0!=>$AfD;}HoV2zu9NozR3S>?Lz5YBURfIBTYM$I z!!#s@^!|V2w(5cX)4aLqCHkkop!$-GjadiKbJhVPE$kQt`?C*=CQ*_uBi`YZ6Ms4h z7Y4mhzCfhz4U-9g{r%Bl&^dR223u|h&BcPx7_b&8;^kE0zrz5&abKV(GBE$ioa+2q z?c3Z`x=1Ubd6{>Q=pzvezciyRoiWm*_*F-D4p(Syu~;OL`tuM>apIH!Rw>sU{P5s) zxLH<<*~i*mp;D-_QhPR^2SCmCaHyk9p!XNDml>o~MG%0V+9;-Z^3X;N%LQ z!#-f>Avuxyg9*46Xye}NX~$>TI^m|L`g#Y+@J6w*b((#cC#83c65X&h)9i!IvVmXy zViw7ulmq*K1T(6RqaX4{c$SRB4ob`#P<@%T3h^&YqKThjYiAD)JVy6RH_TQFyd&TN z7V#LEWC==4()|E?%R4pfwZyLtS?~~B`^}z-S~(d&(XhmcjqjMsjw+{hz*F**UK9DQk^%;&5zS#md8n0C&f7|VU>%(G~Y(*?=ko0 z|27XX+yd_Gm@Lt>(M)euMkPytr>esp}B+xI*Q{j%{*?&Q6y~ z!F+Hh{bTN8!Klj=Od4FquaL4DbuM9pOi+^}F!^bvw2jJ&IB}<3s+P2>`nb9nUi&|U zI}ED}(P!*ZevQ?GfG#Lwbg>5}P_Gd3F)>DyK+in!_2kj-{qjG460W6I=@a=M@o!b{ z{bQBC3WL)B8K*KvwAMdM9{akK zG~d_1Y43CG)K5cSXFnMB@u)K3!_qDB;Xh+cGxh%90|psW>-zwhxU-VFJ9zSo%)kkW z>etz%jUS%|e!D;%5xeq6}KL05O{#y(}s2S;f{4s`Khi`F0nG8|NWco;D rGJC7FX_Ro+dgl%AYxjHnhYftcgMf)_EZq + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php new file mode 100644 index 000000000000..8747d8bbf89f --- /dev/null +++ b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/batch_optimize_tours.php @@ -0,0 +1,121 @@ +setDataFormat($modelConfigsInputConfigDataFormat); + $modelConfigsOutputConfig = (new OutputConfig()) + ->setDataFormat($modelConfigsOutputConfigDataFormat); + $asyncModelConfig = (new AsyncModelConfig()) + ->setInputConfig($modelConfigsInputConfig) + ->setOutputConfig($modelConfigsOutputConfig); + $modelConfigs = [$asyncModelConfig,]; + $request = (new BatchOptimizeToursRequest()) + ->setParent($parent) + ->setModelConfigs($modelConfigs); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routeOptimizationClient->batchOptimizeTours($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchOptimizeToursResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $modelConfigsInputConfigDataFormat = DataFormat::DATA_FORMAT_UNSPECIFIED; + $modelConfigsOutputConfigDataFormat = DataFormat::DATA_FORMAT_UNSPECIFIED; + + batch_optimize_tours_sample( + $parent, + $modelConfigsInputConfigDataFormat, + $modelConfigsOutputConfigDataFormat + ); +} +// [END routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_sync] diff --git a/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php new file mode 100644 index 000000000000..8ad98f631377 --- /dev/null +++ b/MapsRouteOptimization/samples/V1/RouteOptimizationClient/optimize_tours.php @@ -0,0 +1,89 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var OptimizeToursResponse $response */ + $response = $routeOptimizationClient->optimizeTours($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample 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. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + optimize_tours_sample($parent); +} +// [END routeoptimization_v1_generated_RouteOptimization_OptimizeTours_sync] diff --git a/MapsRouteOptimization/src/V1/AggregatedMetrics.php b/MapsRouteOptimization/src/V1/AggregatedMetrics.php new file mode 100644 index 000000000000..a4e7c9fdc222 --- /dev/null +++ b/MapsRouteOptimization/src/V1/AggregatedMetrics.php @@ -0,0 +1,454 @@ +google.maps.routeoptimization.v1.AggregatedMetrics + */ +class AggregatedMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + */ + protected $performed_shipment_count = 0; + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + */ + protected $travel_duration = null; + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + */ + protected $wait_duration = null; + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + */ + protected $delay_duration = null; + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + */ + protected $break_duration = null; + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + */ + protected $visit_duration = null; + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + */ + protected $total_duration = null; + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + */ + protected $travel_distance_meters = 0.0; + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + */ + private $max_loads; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $performed_shipment_count + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * @type \Google\Protobuf\Duration $travel_duration + * Total travel duration for a route or a solution. + * @type \Google\Protobuf\Duration $wait_duration + * Total wait duration for a route or a solution. + * @type \Google\Protobuf\Duration $delay_duration + * Total delay duration for a route or a solution. + * @type \Google\Protobuf\Duration $break_duration + * Total break duration for a route or a solution. + * @type \Google\Protobuf\Duration $visit_duration + * Total visit duration for a route or a solution. + * @type \Google\Protobuf\Duration $total_duration + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * @type float $travel_distance_meters + * Total travel distance for a route or a solution. + * @type array|\Google\Protobuf\Internal\MapField $max_loads + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + * @return int + */ + public function getPerformedShipmentCount() + { + return $this->performed_shipment_count; + } + + /** + * Number of shipments performed. Note that a pickup and delivery pair only + * counts once. + * + * Generated from protobuf field int32 performed_shipment_count = 1; + * @param int $var + * @return $this + */ + public function setPerformedShipmentCount($var) + { + GPBUtil::checkInt32($var); + $this->performed_shipment_count = $var; + + return $this; + } + + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTravelDuration() + { + return $this->travel_duration; + } + + public function hasTravelDuration() + { + return isset($this->travel_duration); + } + + public function clearTravelDuration() + { + unset($this->travel_duration); + } + + /** + * Total travel duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTravelDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->travel_duration = $var; + + return $this; + } + + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getWaitDuration() + { + return $this->wait_duration; + } + + public function hasWaitDuration() + { + return isset($this->wait_duration); + } + + public function clearWaitDuration() + { + unset($this->wait_duration); + } + + /** + * Total wait duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWaitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait_duration = $var; + + return $this; + } + + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDelayDuration() + { + return $this->delay_duration; + } + + public function hasDelayDuration() + { + return isset($this->delay_duration); + } + + public function clearDelayDuration() + { + unset($this->delay_duration); + } + + /** + * Total delay duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelayDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay_duration = $var; + + return $this; + } + + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getBreakDuration() + { + return $this->break_duration; + } + + public function hasBreakDuration() + { + return isset($this->break_duration); + } + + public function clearBreakDuration() + { + unset($this->break_duration); + } + + /** + * Total break duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->break_duration = $var; + + return $this; + } + + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getVisitDuration() + { + return $this->visit_duration; + } + + public function hasVisitDuration() + { + return isset($this->visit_duration); + } + + public function clearVisitDuration() + { + unset($this->visit_duration); + } + + /** + * Total visit duration for a route or a solution. + * + * Generated from protobuf field .google.protobuf.Duration visit_duration = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setVisitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->visit_duration = $var; + + return $this; + } + + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getTotalDuration() + { + return $this->total_duration; + } + + public function hasTotalDuration() + { + return isset($this->total_duration); + } + + public function clearTotalDuration() + { + unset($this->total_duration); + } + + /** + * The total duration should be equal to the sum of all durations above. + * For routes, it also corresponds to: + * ``` + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] + * - + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time] + * ``` + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTotalDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->total_duration = $var; + + return $this; + } + + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + * @return float + */ + public function getTravelDistanceMeters() + { + return $this->travel_distance_meters; + } + + /** + * Total travel distance for a route or a solution. + * + * Generated from protobuf field double travel_distance_meters = 8; + * @param float $var + * @return $this + */ + public function setTravelDistanceMeters($var) + { + GPBUtil::checkDouble($var); + $this->travel_distance_meters = $var; + + return $this; + } + + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMaxLoads() + { + return $this->max_loads; + } + + /** + * Maximum load achieved over the entire route (resp. solution), for each of + * the quantities on this route (resp. solution), computed as the maximum over + * all + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads] + * (resp. + * [ShipmentRoute.metrics.max_loads][google.maps.routeoptimization.v1.AggregatedMetrics.max_loads]. + * + * Generated from protobuf field map max_loads = 9; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMaxLoads($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\VehicleLoad::class); + $this->max_loads = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php new file mode 100644 index 000000000000..50b825aa8a7e --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursMetadata.php @@ -0,0 +1,33 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursMetadata + */ +class BatchOptimizeToursMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php new file mode 100644 index 000000000000..3c9fbf3f7c0d --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest.php @@ -0,0 +1,125 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursRequest + */ +class BatchOptimizeToursRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $model_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * @type array<\Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig>|\Google\Protobuf\Internal\RepeatedField $model_configs + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Target project and location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModelConfigs() + { + return $this->model_configs; + } + + /** + * Required. Input/Output information each purchase model, such as file paths + * and data formats. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig model_configs = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModelConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BatchOptimizeToursRequest\AsyncModelConfig::class); + $this->model_configs = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php new file mode 100644 index 000000000000..816ed3274e2a --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursRequest/AsyncModelConfig.php @@ -0,0 +1,160 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursRequest.AsyncModelConfig + */ +class AsyncModelConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * @type \Google\Maps\RouteOptimization\V1\InputConfig $input_config + * Required. Information about the input model. + * @type \Google\Maps\RouteOptimization\V1\OutputConfig $output_config + * Required. The desired output location information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. User defined model name, can be used as alias by users to keep + * track of models. + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\RouteOptimization\V1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. Information about the input model. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InputConfig input_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\RouteOptimization\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Maps\RouteOptimization\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location information. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Maps\RouteOptimization\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php b/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php new file mode 100644 index 000000000000..2b0e02bf139a --- /dev/null +++ b/MapsRouteOptimization/src/V1/BatchOptimizeToursResponse.php @@ -0,0 +1,34 @@ +google.maps.routeoptimization.v1.BatchOptimizeToursResponse + */ +class BatchOptimizeToursResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/MapsRouteOptimization/src/V1/BreakRule.php b/MapsRouteOptimization/src/V1/BreakRule.php new file mode 100644 index 000000000000..500ac900d732 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule.php @@ -0,0 +1,113 @@ +google.maps.routeoptimization.v1.BreakRule + */ +class BreakRule extends \Google\Protobuf\Internal\Message +{ + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + */ + private $break_requests; + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + */ + private $frequency_constraints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest>|\Google\Protobuf\Internal\RepeatedField $break_requests + * Sequence of breaks. See the `BreakRequest` message. + * @type array<\Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint>|\Google\Protobuf\Internal\RepeatedField $frequency_constraints + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBreakRequests() + { + return $this->break_requests; + } + + /** + * Sequence of breaks. See the `BreakRequest` message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.BreakRequest break_requests = 1; + * @param array<\Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBreakRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BreakRule\BreakRequest::class); + $this->break_requests = $arr; + + return $this; + } + + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrequencyConstraints() + { + return $this->frequency_constraints; + } + + /** + * Several `FrequencyConstraint` may apply. They must all be satisfied by + * the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint frequency_constraints = 2; + * @param array<\Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrequencyConstraints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\BreakRule\FrequencyConstraint::class); + $this->frequency_constraints = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php b/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php new file mode 100644 index 000000000000..b51b217abec7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule/BreakRequest.php @@ -0,0 +1,170 @@ +google.maps.routeoptimization.v1.BreakRule.BreakRequest + */ +class BreakRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $earliest_start_time = null; + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $latest_start_time = null; + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $earliest_start_time + * Required. Lower bound (inclusive) on the start of the break. + * @type \Google\Protobuf\Timestamp $latest_start_time + * Required. Upper bound (inclusive) on the start of the break. + * @type \Google\Protobuf\Duration $min_duration + * Required. Minimum duration of the break. Must be positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestStartTime() + { + return $this->earliest_start_time; + } + + public function hasEarliestStartTime() + { + return isset($this->earliest_start_time); + } + + public function clearEarliestStartTime() + { + unset($this->earliest_start_time); + } + + /** + * Required. Lower bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_start_time = $var; + + return $this; + } + + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLatestStartTime() + { + return $this->latest_start_time; + } + + public function hasLatestStartTime() + { + return isset($this->latest_start_time); + } + + public function clearLatestStartTime() + { + unset($this->latest_start_time); + } + + /** + * Required. Upper bound (inclusive) on the start of the break. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_start_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLatestStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->latest_start_time = $var; + + return $this; + } + + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMinDuration() + { + return $this->min_duration; + } + + public function hasMinDuration() + { + return isset($this->min_duration); + } + + public function clearMinDuration() + { + unset($this->min_duration); + } + + /** + * Required. Minimum duration of the break. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration min_duration = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php b/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php new file mode 100644 index 000000000000..f1244ad33963 --- /dev/null +++ b/MapsRouteOptimization/src/V1/BreakRule/FrequencyConstraint.php @@ -0,0 +1,164 @@ +google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint + */ +class FrequencyConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min_break_duration = null; + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max_inter_break_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $min_break_duration + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * @type \Google\Protobuf\Duration $max_inter_break_duration + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMinBreakDuration() + { + return $this->min_break_duration; + } + + public function hasMinBreakDuration() + { + return isset($this->min_break_duration); + } + + public function clearMinBreakDuration() + { + unset($this->min_break_duration); + } + + /** + * Required. Minimum break duration for this constraint. Nonnegative. + * See description of `FrequencyConstraint`. + * + * Generated from protobuf field .google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMinBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->min_break_duration = $var; + + return $this; + } + + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxInterBreakDuration() + { + return $this->max_inter_break_duration; + } + + public function hasMaxInterBreakDuration() + { + return isset($this->max_inter_break_duration); + } + + public function clearMaxInterBreakDuration() + { + unset($this->max_inter_break_duration); + } + + /** + * Required. Maximum allowed span of any interval of time in the route that + * does not include at least partially a break of `duration >= + * min_break_duration`. Must be positive. + * + * Generated from protobuf field .google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxInterBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_inter_break_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php b/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php new file mode 100644 index 000000000000..7c6f11e105cb --- /dev/null +++ b/MapsRouteOptimization/src/V1/Client/RouteOptimizationClient.php @@ -0,0 +1,311 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/route_optimization_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/route_optimization_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/route_optimization_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/route_optimization_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'routeoptimization.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Optimizes vehicle tours for one or more `OptimizeToursRequest` + * messages as a batch. + * + * This method is a Long Running Operation (LRO). The inputs for optimization + * (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse` + * messages) are read/written from/to Cloud Storage in user-specified + * format. Like the `OptimizeTours` method, each `OptimizeToursRequest` + * contains a `ShipmentModel` and returns an `OptimizeToursResponse` + * containing `ShipmentRoute`s, which are a set of routes to be performed by + * vehicles minimizing the overall cost. + * + * The async variant is {@see RouteOptimizationClient::batchOptimizeToursAsync()} . + * + * @example samples/V1/RouteOptimizationClient/batch_optimize_tours.php + * + * @param BatchOptimizeToursRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchOptimizeTours(BatchOptimizeToursRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchOptimizeTours', $request, $callOptions)->wait(); + } + + /** + * Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an + * `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of + * routes to be performed by vehicles minimizing the overall cost. + * + * A `ShipmentModel` model consists mainly of `Shipment`s that need to be + * carried out and `Vehicle`s that can be used to transport the `Shipment`s. + * The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically, + * they assign a series of `Visit`s to each vehicle, where a `Visit` + * corresponds to a `VisitRequest`, which is a pickup or delivery for a + * `Shipment`. + * + * The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that + * minimizes the total cost where cost has many components defined in the + * `ShipmentModel`. + * + * The async variant is {@see RouteOptimizationClient::optimizeToursAsync()} . + * + * @example samples/V1/RouteOptimizationClient/optimize_tours.php + * + * @param OptimizeToursRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OptimizeToursResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function optimizeTours(OptimizeToursRequest $request, array $callOptions = []): OptimizeToursResponse + { + return $this->startApiCall('OptimizeTours', $request, $callOptions)->wait(); + } +} diff --git a/MapsRouteOptimization/src/V1/DataFormat.php b/MapsRouteOptimization/src/V1/DataFormat.php new file mode 100644 index 000000000000..76303e93fb37 --- /dev/null +++ b/MapsRouteOptimization/src/V1/DataFormat.php @@ -0,0 +1,62 @@ +google.maps.routeoptimization.v1.DataFormat + */ +class DataFormat +{ + /** + * Invalid value, format must not be UNSPECIFIED. + * + * Generated from protobuf enum DATA_FORMAT_UNSPECIFIED = 0; + */ + const DATA_FORMAT_UNSPECIFIED = 0; + /** + * JavaScript Object Notation. + * + * Generated from protobuf enum JSON = 1; + */ + const JSON = 1; + /** + * Protocol Buffers text format. See + * https://protobuf.dev/reference/protobuf/textformat-spec/ + * + * Generated from protobuf enum PROTO_TEXT = 2; + */ + const PROTO_TEXT = 2; + + private static $valueToName = [ + self::DATA_FORMAT_UNSPECIFIED => 'DATA_FORMAT_UNSPECIFIED', + self::JSON => 'JSON', + self::PROTO_TEXT => 'PROTO_TEXT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/MapsRouteOptimization/src/V1/DistanceLimit.php b/MapsRouteOptimization/src/V1/DistanceLimit.php new file mode 100644 index 000000000000..3d2f4d3910e5 --- /dev/null +++ b/MapsRouteOptimization/src/V1/DistanceLimit.php @@ -0,0 +1,216 @@ +google.maps.routeoptimization.v1.DistanceLimit + */ +class DistanceLimit extends \Google\Protobuf\Internal\Message +{ + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + */ + protected $max_meters = null; + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + */ + protected $soft_max_meters = null; + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + */ + protected $cost_per_kilometer_above_soft_max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $max_meters + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * @type int|string $soft_max_meters + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * @type float $cost_per_kilometer_above_soft_max + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + * @return int|string + */ + public function getMaxMeters() + { + return isset($this->max_meters) ? $this->max_meters : 0; + } + + public function hasMaxMeters() + { + return isset($this->max_meters); + } + + public function clearMaxMeters() + { + unset($this->max_meters); + } + + /** + * A hard limit constraining the distance to be at most max_meters. The limit + * must be nonnegative. + * + * Generated from protobuf field optional int64 max_meters = 1; + * @param int|string $var + * @return $this + */ + public function setMaxMeters($var) + { + GPBUtil::checkInt64($var); + $this->max_meters = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + * @return int|string + */ + public function getSoftMaxMeters() + { + return isset($this->soft_max_meters) ? $this->soft_max_meters : 0; + } + + public function hasSoftMaxMeters() + { + return isset($this->soft_max_meters); + } + + public function clearSoftMaxMeters() + { + unset($this->soft_max_meters); + } + + /** + * A soft limit not enforcing a maximum distance limit, but when violated + * results in a cost which adds up to other costs defined in the model, + * with the same unit. + * If defined soft_max_meters must be less than max_meters and must be + * nonnegative. + * + * Generated from protobuf field optional int64 soft_max_meters = 2; + * @param int|string $var + * @return $this + */ + public function setSoftMaxMeters($var) + { + GPBUtil::checkInt64($var); + $this->soft_max_meters = $var; + + return $this; + } + + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + * @return float + */ + public function getCostPerKilometerAboveSoftMax() + { + return isset($this->cost_per_kilometer_above_soft_max) ? $this->cost_per_kilometer_above_soft_max : 0.0; + } + + public function hasCostPerKilometerAboveSoftMax() + { + return isset($this->cost_per_kilometer_above_soft_max); + } + + public function clearCostPerKilometerAboveSoftMax() + { + unset($this->cost_per_kilometer_above_soft_max); + } + + /** + * Cost per kilometer incurred if distance is above `soft_max_meters` limit. + * The additional cost is 0 if the distance is under the limit, otherwise the + * formula used to compute the cost is the following: + * ``` + * (distance_meters - soft_max_meters) / 1000.0 * + * cost_per_kilometer_above_soft_max. + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_kilometer_above_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerKilometerAboveSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer_above_soft_max = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/GcsDestination.php b/MapsRouteOptimization/src/V1/GcsDestination.php new file mode 100644 index 000000000000..593d35570a86 --- /dev/null +++ b/MapsRouteOptimization/src/V1/GcsDestination.php @@ -0,0 +1,68 @@ +google.maps.routeoptimization.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. Google Cloud Storage URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. Google Cloud Storage URI. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/GcsSource.php b/MapsRouteOptimization/src/V1/GcsSource.php new file mode 100644 index 000000000000..a4b7083b7252 --- /dev/null +++ b/MapsRouteOptimization/src/V1/GcsSource.php @@ -0,0 +1,71 @@ +google.maps.routeoptimization.v1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI of a Google Cloud Storage object with the format + * `gs://bucket/path/to/object`. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php new file mode 100644 index 000000000000..bfb8197f0531 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint.php @@ -0,0 +1,156 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint + */ +class InjectedSolutionConstraint extends \Google\Protobuf\Internal\Message +{ + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + private $routes; + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + */ + private $skipped_shipments; + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + */ + private $constraint_relaxations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $routes + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $skipped_shipments + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * @type array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $constraint_relaxations + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutes() + { + return $this->routes; + } + + /** + * Routes of the solution to inject. Some routes may be omitted from the + * original solution. The routes and skipped shipments must satisfy the basic + * validity assumptions listed for `injected_first_solution_routes`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->routes = $arr; + + return $this; + } + + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSkippedShipments() + { + return $this->skipped_shipments; + } + + /** + * Skipped shipments of the solution to inject. Some may be omitted from the + * original solution. See the `routes` field. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 2; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSkippedShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment::class); + $this->skipped_shipments = $arr; + + return $this; + } + + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConstraintRelaxations() + { + return $this->constraint_relaxations; + } + + /** + * For zero or more groups of vehicles, specifies when and how much to relax + * constraints. If this field is empty, all non-empty vehicle routes are + * fully constrained. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation constraint_relaxations = 3; + * @param array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConstraintRelaxations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation::class); + $this->constraint_relaxations = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php new file mode 100644 index 000000000000..3396bf44f295 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation.php @@ -0,0 +1,149 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation + */ +class ConstraintRelaxation extends \Google\Protobuf\Internal\Message +{ + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + */ + private $relaxations; + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + */ + private $vehicle_indices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation>|\Google\Protobuf\Internal\RepeatedField $relaxations + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * @type array|\Google\Protobuf\Internal\RepeatedField $vehicle_indices + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelaxations() + { + return $this->relaxations; + } + + /** + * All the visit constraint relaxations that will apply to visits on + * routes with vehicles in `vehicle_indices`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation relaxations = 1; + * @param array<\Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelaxations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation::class); + $this->relaxations = $arr; + + return $this; + } + + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicleIndices() + { + return $this->vehicle_indices; + } + + /** + * Specifies the vehicle indices to which the visit constraint + * `relaxations` apply. If empty, this is considered the default and the + * `relaxations` apply to all vehicles that are not specified in other + * `constraint_relaxations`. There can be at most one default, i.e., at + * most one constraint relaxation field is allowed empty + * `vehicle_indices`. A vehicle index can only be listed once, even within + * several `constraint_relaxations`. + * A vehicle index is mapped the same as + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index], + * if `interpret_injected_solutions_using_labels` is true (see `fields` + * comment). + * + * Generated from protobuf field repeated int32 vehicle_indices = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->vehicle_indices = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php new file mode 100644 index 000000000000..822319bc2403 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation.php @@ -0,0 +1,202 @@ += relaxations(i).threshold_time` AND + * * `j + 1 >= relaxations(i).threshold_visit_count` + * Similarly, the vehicle start is relaxed to `relaxations(i).level` if it + * satisfies: + * * `vehicle_start_time >= relaxations(i).threshold_time` AND + * * `relaxations(i).threshold_visit_count == 0` + * and the vehicle end is relaxed to `relaxations(i).level` if it satisfies: + * * `vehicle_end_time >= relaxations(i).threshold_time` AND + * * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count` + * To apply a relaxation level if a visit meets the `threshold_visit_count` + * OR the `threshold_time` add two `relaxations` with the same `level`: + * one with only `threshold_visit_count` set and the other with only + * `threshold_time` set. If a visit satisfies the conditions of multiple + * `relaxations`, the most relaxed level applies. As a result, from the + * vehicle start through the route visits in order to the vehicle end, the + * relaxation level becomes more relaxed: i.e., the relaxation level is + * non-decreasing as the route progresses. + * The timing and sequence of route visits that do not satisfy the + * threshold conditions of any `relaxations` are fully constrained + * and no visits may be inserted into these sequences. Also, if a + * vehicle start or end does not satisfy the conditions of any + * relaxation the time is fixed, unless the vehicle is empty. + * + * Generated from protobuf message google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation + */ +class Relaxation extends \Google\Protobuf\Internal\Message +{ + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + */ + protected $level = 0; + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + */ + protected $threshold_time = null; + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + */ + protected $threshold_visit_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $level + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * @type \Google\Protobuf\Timestamp $threshold_time + * The time at or after which the relaxation `level` may be applied. + * @type int $threshold_visit_count + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * @return int + */ + public function getLevel() + { + return $this->level; + } + + /** + * The constraint relaxation level that applies when the conditions + * at or after `threshold_time` AND at least `threshold_visit_count` are + * satisfied. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1; + * @param int $var + * @return $this + */ + public function setLevel($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint\ConstraintRelaxation\Relaxation\Level::class); + $this->level = $var; + + return $this; + } + + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getThresholdTime() + { + return $this->threshold_time; + } + + public function hasThresholdTime() + { + return isset($this->threshold_time); + } + + public function clearThresholdTime() + { + unset($this->threshold_time); + } + + /** + * The time at or after which the relaxation `level` may be applied. + * + * Generated from protobuf field .google.protobuf.Timestamp threshold_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setThresholdTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->threshold_time = $var; + + return $this; + } + + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + * @return int + */ + public function getThresholdVisitCount() + { + return $this->threshold_visit_count; + } + + /** + * The number of visits at or after which the relaxation `level` may be + * applied. If `threshold_visit_count` is 0 (or unset), the `level` may be + * applied directly at the vehicle start. + * If it is `route.visits_size() + 1`, the `level` may only be applied to + * the vehicle end. If it is more than `route.visits_size() + 1`, + * `level` is not applied at all for that route. + * + * Generated from protobuf field int32 threshold_visit_count = 3; + * @param int $var + * @return $this + */ + public function setThresholdVisitCount($var) + { + GPBUtil::checkInt32($var); + $this->threshold_visit_count = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php new file mode 100644 index 000000000000..8c55ffabcb54 --- /dev/null +++ b/MapsRouteOptimization/src/V1/InjectedSolutionConstraint/ConstraintRelaxation/Relaxation/Level.php @@ -0,0 +1,80 @@ +google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level + */ +class Level +{ + /** + * Implicit default relaxation level: no constraints are relaxed, + * i.e., all visits are fully constrained. + * This value must not be explicitly used in `level`. + * + * Generated from protobuf enum LEVEL_UNSPECIFIED = 0; + */ + const LEVEL_UNSPECIFIED = 0; + /** + * Visit start times and vehicle start/end times will be relaxed, but + * each visit remains bound to the same vehicle and the visit sequence + * must be observed: no visit can be inserted between them or before + * them. + * + * Generated from protobuf enum RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + */ + const RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; + /** + * Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence + * is also relaxed: visits remain simply bound to their vehicle. + * + * Generated from protobuf enum RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + */ + const RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; + /** + * Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the + * vehicle is also relaxed: visits are completely free at or after the + * threshold time and can potentially become unperformed. + * + * Generated from protobuf enum RELAX_ALL_AFTER_THRESHOLD = 3; + */ + const RELAX_ALL_AFTER_THRESHOLD = 3; + + private static $valueToName = [ + self::LEVEL_UNSPECIFIED => 'LEVEL_UNSPECIFIED', + self::RELAX_VISIT_TIMES_AFTER_THRESHOLD => 'RELAX_VISIT_TIMES_AFTER_THRESHOLD', + self::RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD => 'RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD', + self::RELAX_ALL_AFTER_THRESHOLD => 'RELAX_ALL_AFTER_THRESHOLD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/InputConfig.php b/MapsRouteOptimization/src/V1/InputConfig.php new file mode 100644 index 000000000000..1ce8d31e1dbd --- /dev/null +++ b/MapsRouteOptimization/src/V1/InputConfig.php @@ -0,0 +1,110 @@ +google.maps.routeoptimization.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_format = 0; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\GcsSource $gcs_source + * A Google Cloud Storage location. This must be a single object (file). + * @type int $data_format + * Required. The input data format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A Google Cloud Storage location. This must be a single object (file). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * @return \Google\Maps\RouteOptimization\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * A Google Cloud Storage location. This must be a single object (file). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsSource gcs_source = 1; + * @param \Google\Maps\RouteOptimization\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDataFormat() + { + return $this->data_format; + } + + /** + * Required. The input data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDataFormat($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\DataFormat::class); + $this->data_format = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/Location.php b/MapsRouteOptimization/src/V1/Location.php new file mode 100644 index 000000000000..fd6c1e3bb48d --- /dev/null +++ b/MapsRouteOptimization/src/V1/Location.php @@ -0,0 +1,133 @@ +google.maps.routeoptimization.v1.Location + */ +class Location extends \Google\Protobuf\Internal\Message +{ + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + */ + protected $lat_lng = null; + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + */ + protected $heading = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $lat_lng + * The waypoint's geographic coordinates. + * @type int $heading + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @return \Google\Type\LatLng|null + */ + public function getLatLng() + { + return $this->lat_lng; + } + + public function hasLatLng() + { + return isset($this->lat_lng); + } + + public function clearLatLng() + { + unset($this->lat_lng); + } + + /** + * The waypoint's geographic coordinates. + * + * Generated from protobuf field .google.type.LatLng lat_lng = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setLatLng($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->lat_lng = $var; + + return $this; + } + + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + * @return int + */ + public function getHeading() + { + return isset($this->heading) ? $this->heading : 0; + } + + public function hasHeading() + { + return isset($this->heading); + } + + public function clearHeading() + { + unset($this->heading); + } + + /** + * The compass heading associated with the direction of the flow of traffic. + * This value is used to specify the side of the road to use for pickup and + * drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + * of due North, 90 specifies a heading of due East, etc. + * + * Generated from protobuf field optional int32 heading = 2; + * @param int $var + * @return $this + */ + public function setHeading($var) + { + GPBUtil::checkInt32($var); + $this->heading = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest.php new file mode 100644 index 000000000000..2f96a735eb6f --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest.php @@ -0,0 +1,1178 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest + */ +class OptimizeToursRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + */ + protected $timeout = null; + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + */ + protected $model = null; + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + */ + protected $solving_mode = 0; + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + */ + protected $search_mode = 0; + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + */ + private $injected_first_solution_routes; + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + */ + protected $injected_solution_constraint = null; + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + */ + private $refresh_details_routes; + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + */ + protected $interpret_injected_solutions_using_labels = false; + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + */ + protected $consider_road_traffic = false; + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + */ + protected $populate_polylines = false; + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + */ + protected $populate_transition_polylines = false; + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + */ + protected $allow_large_deadline_despite_interruption_risk = false; + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + */ + protected $use_geodesic_distances = false; + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + */ + protected $geodesic_meters_per_second = null; + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + */ + protected $max_validation_errors = null; + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + */ + protected $label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * @type \Google\Protobuf\Duration $timeout + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * @type \Google\Maps\RouteOptimization\V1\ShipmentModel $model + * Shipment model to solve. + * @type int $solving_mode + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * @type int $search_mode + * Search mode used to solve the request. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $injected_first_solution_routes + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @type \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint $injected_solution_constraint + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $refresh_details_routes + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * @type bool $interpret_injected_solutions_using_labels + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * @type bool $consider_road_traffic + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * @type bool $populate_polylines + * If true, polylines will be populated in response `ShipmentRoute`s. + * @type bool $populate_transition_polylines + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * @type bool $allow_large_deadline_despite_interruption_risk + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * @type bool $use_geodesic_distances + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * @type float $geodesic_meters_per_second + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * @type int $max_validation_errors + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * @type string $label + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Target project or location to make a call. + * Format: + * * `projects/{project-id}` + * * `projects/{project-id}/locations/{location-id}` + * If no location is specified, a region will be chosen automatically. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * If this timeout is set, the server returns a response before the timeout + * period has elapsed or the server deadline for synchronous requests is + * reached, whichever is sooner. + * For asynchronous requests, the server will generate a solution (if + * possible) before the timeout has elapsed. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * @return \Google\Maps\RouteOptimization\V1\ShipmentModel|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Shipment model to solve. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentModel model = 3; + * @param \Google\Maps\RouteOptimization\V1\ShipmentModel $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentModel::class); + $this->model = $var; + + return $this; + } + + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * @return int + */ + public function getSolvingMode() + { + return $this->solving_mode; + } + + /** + * By default, the solving mode is `DEFAULT_SOLVE` (0). + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4; + * @param int $var + * @return $this + */ + public function setSolvingMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\OptimizeToursRequest\SolvingMode::class); + $this->solving_mode = $var; + + return $this; + } + + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * @return int + */ + public function getSearchMode() + { + return $this->search_mode; + } + + /** + * Search mode used to solve the request. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode search_mode = 6; + * @param int $var + * @return $this + */ + public function setSearchMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\OptimizeToursRequest\SearchMode::class); + $this->search_mode = $var; + + return $this; + } + + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInjectedFirstSolutionRoutes() + { + return $this->injected_first_solution_routes; + } + + /** + * Guide the optimization algorithm in finding a first solution that is + * similar to a previous solution. + * The model is constrained when the first solution is built. + * Any shipments not performed on a route are implicitly skipped in the first + * solution, but they may be performed in successive solutions. + * The solution must satisfy some basic validity assumptions: + * * for all routes, `vehicle_index` must be in range and not be duplicated. + * * for all visits, `shipment_index` and `visit_request_index` must be + * in range. + * * a shipment may only be referenced on one route. + * * the pickup of a pickup-delivery shipment must be performed before + * the delivery. + * * no more than one pickup alternative or delivery alternative of + * a shipment may be performed. + * * for all routes, times are increasing (i.e., `vehicle_start_time + * <= visits[0].start_time <= visits[1].start_time ... + * <= vehicle_end_time`). + * * a shipment may only be performed on a vehicle that is allowed. A + * vehicle is allowed if + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices] + * is empty or its `vehicle_index` is included in + * [Shipment.allowed_vehicle_indices][google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices]. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute injected_first_solution_routes = 7; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInjectedFirstSolutionRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->injected_first_solution_routes = $arr; + + return $this; + } + + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * @return \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint|null + */ + public function getInjectedSolutionConstraint() + { + return $this->injected_solution_constraint; + } + + public function hasInjectedSolutionConstraint() + { + return isset($this->injected_solution_constraint); + } + + public function clearInjectedSolutionConstraint() + { + unset($this->injected_solution_constraint); + } + + /** + * Constrain the optimization algorithm to find a final solution that is + * similar to a previous solution. For example, this may be used to freeze + * portions of routes which have already been completed or which are to be + * completed but must not be modified. + * If the injected solution is not feasible, a validation error is not + * necessarily returned and an error indicating infeasibility may be returned + * instead. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8; + * @param \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint $var + * @return $this + */ + public function setInjectedSolutionConstraint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\InjectedSolutionConstraint::class); + $this->injected_solution_constraint = $var; + + return $this; + } + + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRefreshDetailsRoutes() + { + return $this->refresh_details_routes; + } + + /** + * If non-empty, the given routes will be refreshed, without modifying their + * underlying sequence of visits or travel times: only other details will be + * updated. This does not solve the model. + * As of 2020/11, this only populates the polylines of non-empty routes and + * requires that `populate_polylines` is true. + * The `route_polyline` fields of the passed-in routes may be inconsistent + * with route `transitions`. + * This field must not be used together with `injected_first_solution_routes` + * or `injected_solution_constraint`. + * `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. + * Polylines are still populated between all visits in all non-empty routes + * regardless of whether the related shipments or vehicles are ignored. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute refresh_details_routes = 9; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRefreshDetailsRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->refresh_details_routes = $arr; + + return $this; + } + + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + * @return bool + */ + public function getInterpretInjectedSolutionsUsingLabels() + { + return $this->interpret_injected_solutions_using_labels; + } + + /** + * If true: + * * uses + * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] + * instead of `vehicle_index` to + * match routes in an injected solution with vehicles in the request; + * reuses the mapping of original + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to new + * [ShipmentRoute.vehicle_index][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index] + * to update + * [ConstraintRelaxation.vehicle_indices][google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] + * if non-empty, but the mapping must be unambiguous (i.e., multiple + * `ShipmentRoute`s must not share the same original `vehicle_index`). + * * uses + * [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] + * instead of `shipment_index` + * to match visits in an injected solution with shipments in the request; + * * uses + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * instead of + * [SkippedShipment.index][google.maps.routeoptimization.v1.SkippedShipment.index] + * to + * match skipped shipments in the injected solution with request + * shipments. + * This interpretation applies to the `injected_first_solution_routes`, + * `injected_solution_constraint`, and `refresh_details_routes` fields. + * It can be used when shipment or vehicle indices in the request have + * changed since the solution was created, perhaps because shipments or + * vehicles have been removed from or added to the request. + * If true, labels in the following categories must appear at most once in + * their category: + * * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] in the + * request; + * * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label] in + * the request; + * * [ShipmentRoute.vehicle_label][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label] in the injected solution; + * * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label] in + * the injected solution (except pickup/delivery visit pairs, whose + * `shipment_label` must appear twice). + * If a `vehicle_label` in the injected solution does not correspond to a + * request vehicle, the corresponding route is removed from the solution + * along with its visits. If a `shipment_label` in the injected solution does + * not correspond to a request shipment, the corresponding visit is removed + * from the solution. If a + * [SkippedShipment.label][google.maps.routeoptimization.v1.SkippedShipment.label] + * in the injected solution does not correspond to a request shipment, the + * `SkippedShipment` is removed from the solution. + * Removing route visits or entire routes from an injected solution may + * have an effect on the implied constraints, which may lead to change in + * solution, validation errors, or infeasibility. + * NOTE: The caller must ensure that each + * [Vehicle.label][google.maps.routeoptimization.v1.Vehicle.label] (resp. + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label]) uniquely + * identifies a vehicle (resp. shipment) entity used across the two relevant + * requests: the past request that produced the `OptimizeToursResponse` used + * in the injected solution and the current request that includes the injected + * solution. The uniqueness checks described above are not enough to guarantee + * this requirement. + * + * Generated from protobuf field bool interpret_injected_solutions_using_labels = 10; + * @param bool $var + * @return $this + */ + public function setInterpretInjectedSolutionsUsingLabels($var) + { + GPBUtil::checkBool($var); + $this->interpret_injected_solutions_using_labels = $var; + + return $this; + } + + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + * @return bool + */ + public function getConsiderRoadTraffic() + { + return $this->consider_road_traffic; + } + + /** + * Consider traffic estimation in calculating `ShipmentRoute` fields + * [Transition.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration], + * [Visit.start_time][google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time], + * and `vehicle_end_time`; in setting the + * [ShipmentRoute.has_traffic_infeasibilities][google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities] + * field, and in calculating the + * [OptimizeToursResponse.total_cost][google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost] + * field. + * + * Generated from protobuf field bool consider_road_traffic = 11; + * @param bool $var + * @return $this + */ + public function setConsiderRoadTraffic($var) + { + GPBUtil::checkBool($var); + $this->consider_road_traffic = $var; + + return $this; + } + + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + * @return bool + */ + public function getPopulatePolylines() + { + return $this->populate_polylines; + } + + /** + * If true, polylines will be populated in response `ShipmentRoute`s. + * + * Generated from protobuf field bool populate_polylines = 12; + * @param bool $var + * @return $this + */ + public function setPopulatePolylines($var) + { + GPBUtil::checkBool($var); + $this->populate_polylines = $var; + + return $this; + } + + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + * @return bool + */ + public function getPopulateTransitionPolylines() + { + return $this->populate_transition_polylines; + } + + /** + * If true, polylines will be populated in response + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]. + * + * Generated from protobuf field bool populate_transition_polylines = 13; + * @param bool $var + * @return $this + */ + public function setPopulateTransitionPolylines($var) + { + GPBUtil::checkBool($var); + $this->populate_transition_polylines = $var; + + return $this; + } + + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + * @return bool + */ + public function getAllowLargeDeadlineDespiteInterruptionRisk() + { + return $this->allow_large_deadline_despite_interruption_risk; + } + + /** + * If this is set, then the request can have a deadline + * (see https://grpc.io/blog/deadlines) of up to 60 minutes. + * Otherwise, the maximum deadline is only 30 minutes. + * Note that long-lived requests have a significantly larger (but still small) + * risk of interruption. + * + * Generated from protobuf field bool allow_large_deadline_despite_interruption_risk = 14; + * @param bool $var + * @return $this + */ + public function setAllowLargeDeadlineDespiteInterruptionRisk($var) + { + GPBUtil::checkBool($var); + $this->allow_large_deadline_despite_interruption_risk = $var; + + return $this; + } + + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + * @return bool + */ + public function getUseGeodesicDistances() + { + return $this->use_geodesic_distances; + } + + /** + * If true, travel distances will be computed using geodesic distances instead + * of Google Maps distances, and travel times will be computed using geodesic + * distances with a speed defined by `geodesic_meters_per_second`. + * + * Generated from protobuf field bool use_geodesic_distances = 15; + * @param bool $var + * @return $this + */ + public function setUseGeodesicDistances($var) + { + GPBUtil::checkBool($var); + $this->use_geodesic_distances = $var; + + return $this; + } + + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + * @return float + */ + public function getGeodesicMetersPerSecond() + { + return isset($this->geodesic_meters_per_second) ? $this->geodesic_meters_per_second : 0.0; + } + + public function hasGeodesicMetersPerSecond() + { + return isset($this->geodesic_meters_per_second); + } + + public function clearGeodesicMetersPerSecond() + { + unset($this->geodesic_meters_per_second); + } + + /** + * When `use_geodesic_distances` is true, this field must be set and defines + * the speed applied to compute travel times. Its value must be at least 1.0 + * meters/seconds. + * + * Generated from protobuf field optional double geodesic_meters_per_second = 16; + * @param float $var + * @return $this + */ + public function setGeodesicMetersPerSecond($var) + { + GPBUtil::checkDouble($var); + $this->geodesic_meters_per_second = $var; + + return $this; + } + + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + * @return int + */ + public function getMaxValidationErrors() + { + return isset($this->max_validation_errors) ? $this->max_validation_errors : 0; + } + + public function hasMaxValidationErrors() + { + return isset($this->max_validation_errors); + } + + public function clearMaxValidationErrors() + { + unset($this->max_validation_errors); + } + + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field. + * This defaults to 100 and is capped at 10,000. + * + * Generated from protobuf field optional int32 max_validation_errors = 5; + * @param int $var + * @return $this + */ + public function setMaxValidationErrors($var) + { + GPBUtil::checkInt32($var); + $this->max_validation_errors = $var; + + return $this; + } + + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Label that may be used to identify this request, reported back in the + * [OptimizeToursResponse.request_label][google.maps.routeoptimization.v1.OptimizeToursResponse.request_label]. + * + * Generated from protobuf field string label = 17; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php new file mode 100644 index 000000000000..eb2c4660db47 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SearchMode.php @@ -0,0 +1,63 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode + */ +class SearchMode +{ + /** + * Unspecified search mode, equivalent to `RETURN_FAST`. + * + * Generated from protobuf enum SEARCH_MODE_UNSPECIFIED = 0; + */ + const SEARCH_MODE_UNSPECIFIED = 0; + /** + * Stop the search after finding the first good solution. + * + * Generated from protobuf enum RETURN_FAST = 1; + */ + const RETURN_FAST = 1; + /** + * Spend all the available time to search for better solutions. + * + * Generated from protobuf enum CONSUME_ALL_AVAILABLE_TIME = 2; + */ + const CONSUME_ALL_AVAILABLE_TIME = 2; + + private static $valueToName = [ + self::SEARCH_MODE_UNSPECIFIED => 'SEARCH_MODE_UNSPECIFIED', + self::RETURN_FAST => 'RETURN_FAST', + self::CONSUME_ALL_AVAILABLE_TIME => 'CONSUME_ALL_AVAILABLE_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php new file mode 100644 index 000000000000..856705ff2d8e --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursRequest/SolvingMode.php @@ -0,0 +1,81 @@ +google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode + */ +class SolvingMode +{ + /** + * Solve the model. + * + * Generated from protobuf enum DEFAULT_SOLVE = 0; + */ + const DEFAULT_SOLVE = 0; + /** + * Only validates the model without solving it: populates as many + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * as possible. + * + * Generated from protobuf enum VALIDATE_ONLY = 1; + */ + const VALIDATE_ONLY = 1; + /** + * Only populates + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * or + * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments], + * and doesn't actually solve the rest of the request (`status` and `routes` + * are unset in the response). + * If infeasibilities in `injected_solution_constraint` routes are detected + * they are populated in the + * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors] + * field and + * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments] + * is left empty. + * *IMPORTANT*: not all infeasible shipments are returned here, but only the + * ones that are detected as infeasible during preprocessing. + * + * Generated from protobuf enum DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + */ + const DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; + + private static $valueToName = [ + self::DEFAULT_SOLVE => 'DEFAULT_SOLVE', + self::VALIDATE_ONLY => 'VALIDATE_ONLY', + self::DETECT_SOME_INFEASIBLE_SHIPMENTS => 'DETECT_SOME_INFEASIBLE_SHIPMENTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursResponse.php b/MapsRouteOptimization/src/V1/OptimizeToursResponse.php new file mode 100644 index 000000000000..c82b1fbd15aa --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursResponse.php @@ -0,0 +1,239 @@ +google.maps.routeoptimization.v1.OptimizeToursResponse + */ +class OptimizeToursResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + */ + private $routes; + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + */ + protected $request_label = ''; + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + */ + private $skipped_shipments; + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + */ + private $validation_errors; + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + */ + protected $metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $routes + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * @type string $request_label + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $skipped_shipments + * The list of all shipments skipped. + * @type array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError>|\Google\Protobuf\Internal\RepeatedField $validation_errors + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * @type \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics $metrics + * Duration, distance and usage metrics for this solution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoutes() + { + return $this->routes; + } + + /** + * Routes computed for each vehicle; the i-th route corresponds to the i-th + * vehicle in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute routes = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute::class); + $this->routes = $arr; + + return $this; + } + + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + * @return string + */ + public function getRequestLabel() + { + return $this->request_label; + } + + /** + * Copy of the + * [OptimizeToursRequest.label][google.maps.routeoptimization.v1.OptimizeToursRequest.label], + * if a label was specified in the request. + * + * Generated from protobuf field string request_label = 3; + * @param string $var + * @return $this + */ + public function setRequestLabel($var) + { + GPBUtil::checkString($var, True); + $this->request_label = $var; + + return $this; + } + + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSkippedShipments() + { + return $this->skipped_shipments; + } + + /** + * The list of all shipments skipped. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment skipped_shipments = 4; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSkippedShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment::class); + $this->skipped_shipments = $arr; + + return $this; + } + + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValidationErrors() + { + return $this->validation_errors; + } + + /** + * List of all the validation errors that we were able to detect + * independently. See the "MULTIPLE ERRORS" explanation for the + * [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] + * message. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError validation_errors = 5; + * @param array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValidationErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError::class); + $this->validation_errors = $arr; + + return $this; + } + + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * @return \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Duration, distance and usage metrics for this solution. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics metrics = 6; + * @param \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OptimizeToursResponse\Metrics::class); + $this->metrics = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php b/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php new file mode 100644 index 000000000000..e118c9adfa89 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursResponse/Metrics.php @@ -0,0 +1,370 @@ +google.maps.routeoptimization.v1.OptimizeToursResponse.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + */ + protected $aggregated_route_metrics = null; + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + */ + protected $skipped_mandatory_shipment_count = 0; + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + */ + protected $used_vehicle_count = 0; + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + */ + protected $earliest_vehicle_start_time = null; + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + */ + protected $latest_vehicle_end_time = null; + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + */ + private $costs; + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + */ + protected $total_cost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\AggregatedMetrics $aggregated_route_metrics + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * @type int $skipped_mandatory_shipment_count + * Number of mandatory shipments skipped. + * @type int $used_vehicle_count + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * @type \Google\Protobuf\Timestamp $earliest_vehicle_start_time + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * @type \Google\Protobuf\Timestamp $latest_vehicle_end_time + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * @type array|\Google\Protobuf\Internal\MapField $costs + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * @type float $total_cost + * Total cost of the solution. The sum of all values in the costs map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * @return \Google\Maps\RouteOptimization\V1\AggregatedMetrics|null + */ + public function getAggregatedRouteMetrics() + { + return $this->aggregated_route_metrics; + } + + public function hasAggregatedRouteMetrics() + { + return isset($this->aggregated_route_metrics); + } + + public function clearAggregatedRouteMetrics() + { + unset($this->aggregated_route_metrics); + } + + /** + * Aggregated over the routes. Each metric is the sum (or max, for loads) + * over all + * [ShipmentRoute.metrics][google.maps.routeoptimization.v1.ShipmentRoute.metrics] + * fields of the same name. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics aggregated_route_metrics = 1; + * @param \Google\Maps\RouteOptimization\V1\AggregatedMetrics $var + * @return $this + */ + public function setAggregatedRouteMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\AggregatedMetrics::class); + $this->aggregated_route_metrics = $var; + + return $this; + } + + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + * @return int + */ + public function getSkippedMandatoryShipmentCount() + { + return $this->skipped_mandatory_shipment_count; + } + + /** + * Number of mandatory shipments skipped. + * + * Generated from protobuf field int32 skipped_mandatory_shipment_count = 2; + * @param int $var + * @return $this + */ + public function setSkippedMandatoryShipmentCount($var) + { + GPBUtil::checkInt32($var); + $this->skipped_mandatory_shipment_count = $var; + + return $this; + } + + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + * @return int + */ + public function getUsedVehicleCount() + { + return $this->used_vehicle_count; + } + + /** + * Number of vehicles used. Note: if a vehicle route is empty and + * [Vehicle.used_if_route_is_empty][google.maps.routeoptimization.v1.Vehicle.used_if_route_is_empty] + * is true, the vehicle is considered used. + * + * Generated from protobuf field int32 used_vehicle_count = 3; + * @param int $var + * @return $this + */ + public function setUsedVehicleCount($var) + { + GPBUtil::checkInt32($var); + $this->used_vehicle_count = $var; + + return $this; + } + + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestVehicleStartTime() + { + return $this->earliest_vehicle_start_time; + } + + public function hasEarliestVehicleStartTime() + { + return isset($this->earliest_vehicle_start_time); + } + + public function clearEarliestVehicleStartTime() + { + unset($this->earliest_vehicle_start_time); + } + + /** + * The earliest start time for a used vehicle, computed as the minimum over + * all used vehicles of + * [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_vehicle_start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestVehicleStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_vehicle_start_time = $var; + + return $this; + } + + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLatestVehicleEndTime() + { + return $this->latest_vehicle_end_time; + } + + public function hasLatestVehicleEndTime() + { + return isset($this->latest_vehicle_end_time); + } + + public function clearLatestVehicleEndTime() + { + unset($this->latest_vehicle_end_time); + } + + /** + * The latest end time for a used vehicle, computed as the maximum over all + * used vehicles of + * [ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time]. + * + * Generated from protobuf field .google.protobuf.Timestamp latest_vehicle_end_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLatestVehicleEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->latest_vehicle_end_time = $var; + + return $this; + } + + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCosts() + { + return $this->costs; + } + + /** + * Cost of the solution, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, + * e.g. "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole + * solution. In other words, costs["model.shipments.pickups.cost"] is the + * sum of all pickup costs over the solution. All costs defined in the model + * are reported in detail here with the exception of costs related to + * TransitionAttributes that are only reported in an aggregated way as of + * 2022/01. + * + * Generated from protobuf field map costs = 10; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->costs = $arr; + + return $this; + } + + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + * @return float + */ + public function getTotalCost() + { + return $this->total_cost; + } + + /** + * Total cost of the solution. The sum of all values in the costs map. + * + * Generated from protobuf field double total_cost = 6; + * @param float $var + * @return $this + */ + public function setTotalCost($var) + { + GPBUtil::checkDouble($var); + $this->total_cost = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php b/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php new file mode 100644 index 000000000000..518bc2697246 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursValidationError.php @@ -0,0 +1,1179 @@ +google.maps.routeoptimization.v1.OptimizeToursValidationError + */ +class OptimizeToursValidationError extends \Google\Protobuf\Internal\Message +{ + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + */ + protected $code = 0; + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + */ + private $fields; + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + */ + protected $error_message = ''; + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + */ + protected $offending_values = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * @type string $display_name + * The error display name. + * @type array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference>|\Google\Protobuf\Internal\RepeatedField $fields + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * @type string $error_message + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * @type string $offending_values + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * A validation error is defined by the pair (`code`, `display_name`) which + * are always present. + * Other fields (below) provide more context about the error. + * *MULTIPLE ERRORS*: + * When there are multiple errors, the validation process tries to output + * several of them. Much like a compiler, this is an imperfect process. Some + * validation errors will be "fatal", meaning that they stop the entire + * validation process. This is the case for `display_name="UNSPECIFIED"` + * errors, among others. Some may cause the validation process to skip other + * errors. + * *STABILITY*: + * `code` and `display_name` should be very stable. But new codes and + * display names may appear over time, which may cause a given (invalid) + * request to yield a different (`code`, `display_name`) pair because the new + * error hid the old one (see "MULTIPLE ERRORS"). + * *REFERENCE*: A list of all (code, name) pairs: + * * UNSPECIFIED = 0; + * * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within + * the deadline. + * * REQUEST_OPTIONS_ERROR = 12; + * * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201; + * * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203; + * * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204; + * * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205; + * * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206; + * * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE + * = 1207; + * * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208; + * * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211; + * * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212; + * * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214; + * * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216; + * * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217; + * * INJECTED_SOLUTION_ERROR = 20; + * * INJECTED_SOLUTION_MISSING_LABEL = 2000; + * * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001; + * * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002; + * * INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003; + * * INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004; + * * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; + * * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; + * * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + * * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; + * * SHIPMENT_MODEL_ERROR = 22; + * * SHIPMENT_MODEL_TOO_LARGE = 2200; + * * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202; + * * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203; + * * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204; + * * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205; + * * SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206; + * * SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207; + * * INDEX_ERROR = 24; + * * TAG_ERROR = 26; + * * TIME_WINDOW_ERROR = 28; + * * TIME_WINDOW_INVALID_START_TIME = 2800; + * * TIME_WINDOW_INVALID_END_TIME = 2801; + * * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802; + * * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803; + * * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804; + * * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806; + * * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME + * = 2808; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809; + * * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME + * = 2810; + * * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811; + * * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813; + * * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814; + * * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815; + * * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816; + * * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS + * = 2817; + * * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818; + * * TRANSITION_ATTRIBUTES_ERROR = 30; + * * TRANSITION_ATTRIBUTES_INVALID_COST = 3000; + * * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001; + * * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002; + * * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004; + * * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005; + * * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006; + * * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008; + * * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009; + * * AMOUNT_ERROR = 31; + * * AMOUNT_NEGATIVE_VALUE = 3100; + * * LOAD_LIMIT_ERROR = 33; + * * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303; + * * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304; + * * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305; + * * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306; + * * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307; + * * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308; + * * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309; + * * INTERVAL_ERROR = 34; + * * INTERVAL_MIN_EXCEEDS_MAX = 3401; + * * INTERVAL_NEGATIVE_MIN = 3402; + * * INTERVAL_NEGATIVE_MAX = 3403; + * * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404; + * * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405; + * * DISTANCE_LIMIT_ERROR = 36; + * * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601; + * * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602; + * * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603; + * * DISTANCE_LIMIT_NEGATIVE_MAX = 3604; + * * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605; + * * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606; + * * DURATION_LIMIT_ERROR = 38; + * * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800; + * * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801; + * * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802; + * * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803; + * * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805; + * * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR + * = 3807; + * * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX + * = 3808; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809; + * * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811; + * * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE + * = 3812; + * * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813; + * * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814; + * * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION + * = 3815; + * * SHIPMENT_ERROR = 40; + * * SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000; + * * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4001; + * * SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015; + * * SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002; + * * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003; + * * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004; + * * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005; + * * SHIPMENT_INVALID_PENALTY_COST = 4006; + * * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007; + * * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009; + * * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010; + * * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011; + * * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012; + * * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013; + * * VEHICLE_ERROR = 42; + * * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200; + * * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201; + * * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202; + * * VEHICLE_EMPTY_START_TAG = 4203; + * * VEHICLE_DUPLICATE_START_TAG = 4204; + * * VEHICLE_EMPTY_END_TAG = 4205; + * * VEHICLE_DUPLICATE_END_TAG = 4206; + * * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207; + * * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208; + * * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209; + * * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210; + * * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211; + * * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212; + * * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213; + * * VEHICLE_LAST_SHIPMENT_IGNORED = 4214; + * * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215; + * * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216; + * * VEHICLE_INVALID_COST_PER_KILOMETER = 4217; + * * VEHICLE_INVALID_COST_PER_HOUR = 4218; + * * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219; + * * VEHICLE_INVALID_FIXED_COST = 4220; + * * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221; + * * VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS + * = 4223; + * * VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224; + * * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222; + * * VISIT_REQUEST_ERROR = 44; + * * VISIT_REQUEST_EMPTY_TAG = 4400; + * * VISIT_REQUEST_DUPLICATE_TAG = 4401; + * * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404; + * * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405; + * * PRECEDENCE_ERROR = 46; + * * BREAK_ERROR = 48; + * * BREAK_RULE_EMPTY = 4800; + * * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801; + * * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802; + * * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803; + * * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804; + * * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805; + * * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806; + * * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807; + * * BREAK_REQUEST_NON_SCHEDULABLE = 4808; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810; + * * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811; + * * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION + * = 4812; + * * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813; + * * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814; + * * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815; + * * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50; + * * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001; + * * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002; + * * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003; + * * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004; + * * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005; + * * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001; + * * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002; + * * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003; + * * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006; + * * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007; + * * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008; + * * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009; + * * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010; + * * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011; + * * VEHICLE_OPERATOR_ERROR = 54; + * * VEHICLE_OPERATOR_EMPTY_TYPE = 5400; + * * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401; + * * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402; + * * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403; + * * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404; + * * DURATION_SECONDS_MATRIX_ERROR = 56; + * * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600; + * * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601; + * + * Generated from protobuf field int32 code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The error display name. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * An error context may involve 0, 1 (most of the time) or more fields. For + * example, referring to vehicle #4 and shipment #2's first pickup can be + * done as follows: + * ``` + * fields { name: "vehicles" index: 4} + * fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} } + * ``` + * Note, however, that the cardinality of `fields` should not change for a + * given error code. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference fields = 3; + * @param array<\Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference::class); + $this->fields = $arr; + + return $this; + } + + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Human-readable string describing the error. There is a 1:1 mapping + * between `code` and `error_message` (when code != "UNSPECIFIED"). + * *STABILITY*: Not stable: the error message associated to a given `code` may + * change (hopefully to clarify it) over time. Please rely on the + * `display_name` and `code` instead. + * + * Generated from protobuf field string error_message = 4; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + * @return string + */ + public function getOffendingValues() + { + return $this->offending_values; + } + + /** + * May contain the value(s) of the field(s). This is not always available. You + * should absolutely not rely on it and use it only for manual model + * debugging. + * + * Generated from protobuf field string offending_values = 5; + * @param string $var + * @return $this + */ + public function setOffendingValues($var) + { + GPBUtil::checkString($var, True); + $this->offending_values = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php b/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php new file mode 100644 index 000000000000..4215470610d6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/OptimizeToursValidationError/FieldReference.php @@ -0,0 +1,195 @@ +google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference + */ +class FieldReference extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + */ + protected $sub_field = null; + protected $index_or_key; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the field, e.g., "vehicles". + * @type int $index + * Index of the field if repeated. + * @type string $key + * Key if the field is a map. + * @type \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference $sub_field + * Recursively nested sub-field, if needed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the field, e.g., "vehicles". + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Index of the field if repeated. + * + * Generated from protobuf field int32 index = 2; + * @return int + */ + public function getIndex() + { + return $this->readOneof(2); + } + + public function hasIndex() + { + return $this->hasOneof(2); + } + + /** + * Index of the field if repeated. + * + * Generated from protobuf field int32 index = 2; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Key if the field is a map. + * + * Generated from protobuf field string key = 4; + * @return string + */ + public function getKey() + { + return $this->readOneof(4); + } + + public function hasKey() + { + return $this->hasOneof(4); + } + + /** + * Key if the field is a map. + * + * Generated from protobuf field string key = 4; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * @return \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference|null + */ + public function getSubField() + { + return $this->sub_field; + } + + public function hasSubField() + { + return isset($this->sub_field); + } + + public function clearSubField() + { + unset($this->sub_field); + } + + /** + * Recursively nested sub-field, if needed. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.OptimizeToursValidationError.FieldReference sub_field = 3; + * @param \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference $var + * @return $this + */ + public function setSubField($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\OptimizeToursValidationError\FieldReference::class); + $this->sub_field = $var; + + return $this; + } + + /** + * @return string + */ + public function getIndexOrKey() + { + return $this->whichOneof("index_or_key"); + } + +} + + diff --git a/MapsRouteOptimization/src/V1/OutputConfig.php b/MapsRouteOptimization/src/V1/OutputConfig.php new file mode 100644 index 000000000000..7ed7e0a1d93f --- /dev/null +++ b/MapsRouteOptimization/src/V1/OutputConfig.php @@ -0,0 +1,111 @@ +google.maps.routeoptimization.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_format = 0; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\GcsDestination $gcs_destination + * The Google Cloud Storage location to write the output to. + * @type int $data_format + * Required. The output data format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location to write the output to. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * @return \Google\Maps\RouteOptimization\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * The Google Cloud Storage location to write the output to. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.GcsDestination gcs_destination = 1; + * @param \Google\Maps\RouteOptimization\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDataFormat() + { + return $this->data_format; + } + + /** + * Required. The output data format. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DataFormat data_format = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDataFormat($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\DataFormat::class); + $this->data_format = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/Shipment.php b/MapsRouteOptimization/src/V1/Shipment.php new file mode 100644 index 000000000000..c3de173e6cc8 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment.php @@ -0,0 +1,841 @@ +google.maps.routeoptimization.v1.Shipment + */ +class Shipment extends \Google\Protobuf\Internal\Message +{ + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + */ + protected $display_name = ''; + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + */ + private $pickups; + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + */ + private $deliveries; + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + */ + private $load_demands; + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + */ + protected $penalty_cost = null; + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + */ + private $allowed_vehicle_indices; + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + */ + private $costs_per_vehicle; + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + */ + private $costs_per_vehicle_indices; + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + */ + protected $pickup_to_delivery_relative_detour_limit = null; + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + */ + protected $pickup_to_delivery_absolute_detour_limit = null; + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + */ + protected $pickup_to_delivery_time_limit = null; + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + */ + protected $shipment_type = ''; + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + */ + protected $label = ''; + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + */ + protected $ignore = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * @type array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $pickups + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * @type array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $deliveries + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * @type float $penalty_cost + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_vehicle_indices + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * @type array|\Google\Protobuf\Internal\RepeatedField $costs_per_vehicle + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * @type array|\Google\Protobuf\Internal\RepeatedField $costs_per_vehicle_indices + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * @type float $pickup_to_delivery_relative_detour_limit + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * @type \Google\Protobuf\Duration $pickup_to_delivery_absolute_detour_limit + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * @type \Google\Protobuf\Duration $pickup_to_delivery_time_limit + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * @type string $shipment_type + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * @type string $label + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * @type bool $ignore + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user-defined display name of the shipment. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 16; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPickups() + { + return $this->pickups; + } + + /** + * Set of pickup alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the deliveries. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest pickups = 1; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPickups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\VisitRequest::class); + $this->pickups = $arr; + + return $this; + } + + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeliveries() + { + return $this->deliveries; + } + + /** + * Set of delivery alternatives associated to the shipment. If not specified, + * the vehicle only needs to visit a location corresponding to the pickups. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment.VisitRequest deliveries = 2; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment\VisitRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeliveries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\VisitRequest::class); + $this->deliveries = $arr; + + return $this; + } + + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Load demands of the shipment (for example weight, volume, number of + * pallets etc). The keys in the map should be identifiers describing the type + * of the corresponding load, ideally also including the units. + * For example: "weight_kg", "volume_gallons", "pallet_count", etc. + * If a given key does not appear in the map, the corresponding load is + * considered as null. + * + * Generated from protobuf field map load_demands = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + * @return float + */ + public function getPenaltyCost() + { + return isset($this->penalty_cost) ? $this->penalty_cost : 0.0; + } + + public function hasPenaltyCost() + { + return isset($this->penalty_cost); + } + + public function clearPenaltyCost() + { + unset($this->penalty_cost); + } + + /** + * If the shipment is not completed, this penalty is added to the overall + * cost of the routes. A shipment is considered completed if one of its pickup + * and delivery alternatives is visited. The cost may be expressed in the + * same unit used for all other cost-related fields in the model and must be + * positive. + * *IMPORTANT*: If this penalty is not specified, it is considered infinite, + * i.e. the shipment must be completed. + * + * Generated from protobuf field optional double penalty_cost = 4; + * @param float $var + * @return $this + */ + public function setPenaltyCost($var) + { + GPBUtil::checkDouble($var); + $this->penalty_cost = $var; + + return $this; + } + + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedVehicleIndices() + { + return $this->allowed_vehicle_indices; + } + + /** + * The set of vehicles that may perform this shipment. If empty, all vehicles + * may perform it. Vehicles are given by their index in the `ShipmentModel`'s + * `vehicles` list. + * + * Generated from protobuf field repeated int32 allowed_vehicle_indices = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->allowed_vehicle_indices = $arr; + + return $this; + } + + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCostsPerVehicle() + { + return $this->costs_per_vehicle; + } + + /** + * Specifies the cost that is incurred when this shipment is delivered by each + * vehicle. If specified, it must have EITHER: + * * the same number of elements as `costs_per_vehicle_indices`. + * `costs_per_vehicle[i]` corresponds to vehicle + * `costs_per_vehicle_indices[i]` of the model. + * * the same number of elements as there are vehicles in the model. The + * i-th element corresponds to vehicle #i of the model. + * These costs must be in the same unit as `penalty_cost` and must not be + * negative. Leave this field empty, if there are no such costs. + * + * Generated from protobuf field repeated double costs_per_vehicle = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCostsPerVehicle($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->costs_per_vehicle = $arr; + + return $this; + } + + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCostsPerVehicleIndices() + { + return $this->costs_per_vehicle_indices; + } + + /** + * Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, + * it must have the same number of elements as `costs_per_vehicle`. A vehicle + * index may not be specified more than once. If a vehicle is excluded from + * `costs_per_vehicle_indices`, its cost is zero. + * + * Generated from protobuf field repeated int32 costs_per_vehicle_indices = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCostsPerVehicleIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->costs_per_vehicle_indices = $arr; + + return $this; + } + + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + * @return float + */ + public function getPickupToDeliveryRelativeDetourLimit() + { + return isset($this->pickup_to_delivery_relative_detour_limit) ? $this->pickup_to_delivery_relative_detour_limit : 0.0; + } + + public function hasPickupToDeliveryRelativeDetourLimit() + { + return isset($this->pickup_to_delivery_relative_detour_limit); + } + + public function clearPickupToDeliveryRelativeDetourLimit() + { + unset($this->pickup_to_delivery_relative_detour_limit); + } + + /** + * Specifies the maximum relative detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_relative_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field optional double pickup_to_delivery_relative_detour_limit = 8; + * @param float $var + * @return $this + */ + public function setPickupToDeliveryRelativeDetourLimit($var) + { + GPBUtil::checkDouble($var); + $this->pickup_to_delivery_relative_detour_limit = $var; + + return $this; + } + + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * @return \Google\Protobuf\Duration|null + */ + public function getPickupToDeliveryAbsoluteDetourLimit() + { + return $this->pickup_to_delivery_absolute_detour_limit; + } + + public function hasPickupToDeliveryAbsoluteDetourLimit() + { + return isset($this->pickup_to_delivery_absolute_detour_limit); + } + + public function clearPickupToDeliveryAbsoluteDetourLimit() + { + unset($this->pickup_to_delivery_absolute_detour_limit); + } + + /** + * Specifies the maximum absolute detour time compared to the shortest path + * from pickup to delivery. If specified, it must be nonnegative, and the + * shipment must contain at least a pickup and a delivery. + * For example, let t be the shortest time taken to go from the selected + * pickup alternative directly to the selected delivery alternative. Then + * setting `pickup_to_delivery_absolute_detour_limit` enforces: + * ``` + * start_time(delivery) - start_time(pickup) <= + * t + pickup_to_delivery_absolute_detour_limit + * ``` + * If both relative and absolute limits are specified on the same shipment, + * the more constraining limit is used for each possible pickup/delivery pair. + * As of 2017/10, detours are only supported when travel durations do not + * depend on vehicles. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_absolute_detour_limit = 9; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPickupToDeliveryAbsoluteDetourLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->pickup_to_delivery_absolute_detour_limit = $var; + + return $this; + } + + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * @return \Google\Protobuf\Duration|null + */ + public function getPickupToDeliveryTimeLimit() + { + return $this->pickup_to_delivery_time_limit; + } + + public function hasPickupToDeliveryTimeLimit() + { + return isset($this->pickup_to_delivery_time_limit); + } + + public function clearPickupToDeliveryTimeLimit() + { + unset($this->pickup_to_delivery_time_limit); + } + + /** + * Specifies the maximum duration from start of pickup to start of delivery of + * a shipment. If specified, it must be nonnegative, and the shipment must + * contain at least a pickup and a delivery. This does not depend on which + * alternatives are selected for pickup and delivery, nor on vehicle speed. + * This can be specified alongside maximum detour constraints: the solution + * will respect both specifications. + * + * Generated from protobuf field .google.protobuf.Duration pickup_to_delivery_time_limit = 10; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPickupToDeliveryTimeLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->pickup_to_delivery_time_limit = $var; + + return $this; + } + + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + * @return string + */ + public function getShipmentType() + { + return $this->shipment_type; + } + + /** + * Non-empty string specifying a "type" for this shipment. + * This feature can be used to define incompatibilities or requirements + * between `shipment_types` (see `shipment_type_incompatibilities` and + * `shipment_type_requirements` in `ShipmentModel`). + * Differs from `visit_types` which is specified for a single visit: All + * pickup/deliveries belonging to the same shipment share the same + * `shipment_type`. + * + * Generated from protobuf field string shipment_type = 11; + * @param string $var + * @return $this + */ + public function setShipmentType($var) + { + GPBUtil::checkString($var, True); + $this->shipment_type = $var; + + return $this; + } + + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this shipment. This label is reported in the response + * in the `shipment_label` of the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 12; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + * @return bool + */ + public function getIgnore() + { + return $this->ignore; + } + + /** + * If true, skip this shipment, but don't apply a `penalty_cost`. + * Ignoring a shipment results in a validation error when there are any + * `shipment_type_requirements` in the model. + * Ignoring a shipment that is performed in `injected_first_solution_routes` + * or `injected_solution_constraint` is permitted; the solver removes the + * related pickup/delivery visits from the performing route. + * `precedence_rules` that reference ignored shipments will also be ignored. + * + * Generated from protobuf field bool ignore = 13; + * @param bool $var + * @return $this + */ + public function setIgnore($var) + { + GPBUtil::checkBool($var); + $this->ignore = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Shipment/Load.php b/MapsRouteOptimization/src/V1/Shipment/Load.php new file mode 100644 index 000000000000..04cbca8a31a3 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment/Load.php @@ -0,0 +1,79 @@ +google.maps.routeoptimization.v1.Shipment.Load + */ +class Load extends \Google\Protobuf\Internal\Message +{ + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + */ + protected $amount = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $amount + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + * @return int|string + */ + public function getAmount() + { + return $this->amount; + } + + /** + * The amount by which the load of the vehicle performing the corresponding + * visit will vary. Since it is an integer, users are advised to choose an + * appropriate unit to avoid loss of precision. Must be ≥ 0. + * + * Generated from protobuf field int64 amount = 2; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php b/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php new file mode 100644 index 000000000000..c8508e6489e6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Shipment/VisitRequest.php @@ -0,0 +1,613 @@ +google.maps.routeoptimization.v1.Shipment.VisitRequest + */ +class VisitRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + */ + protected $arrival_location = null; + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + */ + protected $arrival_waypoint = null; + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + */ + protected $departure_location = null; + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + */ + protected $departure_waypoint = null; + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + */ + private $tags; + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + */ + private $time_windows; + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + */ + protected $duration = null; + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + */ + protected $cost = 0.0; + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + */ + private $load_demands; + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + */ + private $visit_types; + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + */ + protected $label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\LatLng $arrival_location + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $arrival_waypoint + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * @type \Google\Type\LatLng $departure_location + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $departure_waypoint + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $time_windows + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * @type \Google\Protobuf\Duration $duration + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * @type float $cost + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * @type array|\Google\Protobuf\Internal\RepeatedField $visit_types + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * @type string $label + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + * @return \Google\Type\LatLng|null + */ + public function getArrivalLocation() + { + return $this->arrival_location; + } + + public function hasArrivalLocation() + { + return isset($this->arrival_location); + } + + public function clearArrivalLocation() + { + unset($this->arrival_location); + } + + /** + * The geo-location where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng arrival_location = 1; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setArrivalLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->arrival_location = $var; + + return $this; + } + + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getArrivalWaypoint() + { + return $this->arrival_waypoint; + } + + public function hasArrivalWaypoint() + { + return isset($this->arrival_waypoint); + } + + public function clearArrivalWaypoint() + { + unset($this->arrival_waypoint); + } + + /** + * The waypoint where the vehicle arrives when performing this + * `VisitRequest`. If the shipment model has duration distance matrices, + * `arrival_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint arrival_waypoint = 2; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setArrivalWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->arrival_waypoint = $var; + + return $this; + } + + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + * @return \Google\Type\LatLng|null + */ + public function getDepartureLocation() + { + return $this->departure_location; + } + + public function hasDepartureLocation() + { + return isset($this->departure_location); + } + + public function clearDepartureLocation() + { + unset($this->departure_location); + } + + /** + * The geo-location where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_location`. + * If the shipment model has duration distance matrices, + * `departure_location` must not be specified. + * + * Generated from protobuf field .google.type.LatLng departure_location = 3; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setDepartureLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->departure_location = $var; + + return $this; + } + + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getDepartureWaypoint() + { + return $this->departure_waypoint; + } + + public function hasDepartureWaypoint() + { + return isset($this->departure_waypoint); + } + + public function clearDepartureWaypoint() + { + unset($this->departure_waypoint); + } + + /** + * The waypoint where the vehicle departs after completing this + * `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`. + * If the shipment model has duration distance matrices, + * `departure_waypoint` must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint departure_waypoint = 4; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setDepartureWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->departure_waypoint = $var; + + return $this; + } + + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Specifies tags attached to the visit request. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string tags = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeWindows() + { + return $this->time_windows; + } + + /** + * Time windows which constrain the arrival time at a visit. + * Note that a vehicle may depart outside of the arrival time window, i.e. + * arrival time + duration do not need to be inside a time window. This can + * result in waiting time if the vehicle arrives before + * [TimeWindow.start_time][google.maps.routeoptimization.v1.TimeWindow.start_time]. + * The absence of `TimeWindow` means that the vehicle can perform this visit + * at any time. + * Time windows must be disjoint, i.e. no time window must overlap with or + * be adjacent to another, and they must be in increasing order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only + * be set if there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow time_windows = 6; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->time_windows = $arr; + + return $this; + } + + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration of the visit, i.e. time spent by the vehicle between arrival + * and departure (to be added to the possible waiting time; see + * `time_windows`). + * + * Generated from protobuf field .google.protobuf.Duration duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * Cost to service this visit request on a vehicle route. This can be used + * to pay different costs for each alternative pickup or delivery of a + * shipment. This cost must be in the same unit as `Shipment.penalty_cost` + * and must not be negative. + * + * Generated from protobuf field double cost = 8; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkDouble($var); + $this->cost = $var; + + return $this; + } + + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Load demands of this visit request. This is just like + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field, except that it only applies to this + * [VisitRequest][google.maps.routeoptimization.v1.Shipment.VisitRequest] + * instead of the whole + * [Shipment][google.maps.routeoptimization.v1.Shipment]. The demands listed + * here are added to the demands listed in + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands]. + * + * Generated from protobuf field map load_demands = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVisitTypes() + { + return $this->visit_types; + } + + /** + * Specifies the types of the visit. This may be used to allocate additional + * time required for a vehicle to complete this visit (see + * [Vehicle.extra_visit_duration_for_visit_type][google.maps.routeoptimization.v1.Vehicle.extra_visit_duration_for_visit_type]). + * A type can only appear once. + * + * Generated from protobuf field repeated string visit_types = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVisitTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->visit_types = $arr; + + return $this; + } + + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this `VisitRequest`. This label is reported in the + * response as `visit_label` in the corresponding + * [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + * + * Generated from protobuf field string label = 11; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel.php b/MapsRouteOptimization/src/V1/ShipmentModel.php new file mode 100644 index 000000000000..34ac5c5b5eb4 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel.php @@ -0,0 +1,1010 @@ +google.maps.routeoptimization.v1.ShipmentModel + */ +class ShipmentModel extends \Google\Protobuf\Internal\Message +{ + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + */ + private $shipments; + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + */ + private $vehicles; + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + */ + protected $max_active_vehicles = null; + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + */ + protected $global_start_time = null; + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + */ + protected $global_end_time = null; + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + */ + protected $global_duration_cost_per_hour = 0.0; + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + */ + private $duration_distance_matrices; + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + */ + private $duration_distance_matrix_src_tags; + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + */ + private $duration_distance_matrix_dst_tags; + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + */ + private $transition_attributes; + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + */ + private $shipment_type_incompatibilities; + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + */ + private $shipment_type_requirements; + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + */ + private $precedence_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\Shipment>|\Google\Protobuf\Internal\RepeatedField $shipments + * Set of shipments which must be performed in the model. + * @type array<\Google\Maps\RouteOptimization\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $vehicles + * Set of vehicles which can be used to perform visits. + * @type int $max_active_vehicles + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * @type \Google\Protobuf\Timestamp $global_start_time + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * @type \Google\Protobuf\Timestamp $global_end_time + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * @type float $global_duration_cost_per_hour + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix>|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrices + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * @type array|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrix_src_tags + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * @type array|\Google\Protobuf\Internal\RepeatedField $duration_distance_matrix_dst_tags + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * @type array<\Google\Maps\RouteOptimization\V1\TransitionAttributes>|\Google\Protobuf\Internal\RepeatedField $transition_attributes + * Transition attributes added to the model. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility>|\Google\Protobuf\Internal\RepeatedField $shipment_type_incompatibilities + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement>|\Google\Protobuf\Internal\RepeatedField $shipment_type_requirements + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule>|\Google\Protobuf\Internal\RepeatedField $precedence_rules + * Set of precedence rules which must be enforced in the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipments() + { + return $this->shipments; + } + + /** + * Set of shipments which must be performed in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Shipment shipments = 1; + * @param array<\Google\Maps\RouteOptimization\V1\Shipment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment::class); + $this->shipments = $arr; + + return $this; + } + + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVehicles() + { + return $this->vehicles; + } + + /** + * Set of vehicles which can be used to perform visits. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.Vehicle vehicles = 2; + * @param array<\Google\Maps\RouteOptimization\V1\Vehicle>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVehicles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Vehicle::class); + $this->vehicles = $arr; + + return $this; + } + + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + * @return int + */ + public function getMaxActiveVehicles() + { + return isset($this->max_active_vehicles) ? $this->max_active_vehicles : 0; + } + + public function hasMaxActiveVehicles() + { + return isset($this->max_active_vehicles); + } + + public function clearMaxActiveVehicles() + { + unset($this->max_active_vehicles); + } + + /** + * Constrains the maximum number of active vehicles. A vehicle is active if + * its route performs at least one shipment. This can be used to limit the + * number of routes in the case where there are fewer drivers than + * vehicles and that the fleet of vehicles is heterogeneous. The optimization + * will then select the best subset of vehicles to use. + * Must be strictly positive. + * + * Generated from protobuf field optional int32 max_active_vehicles = 4; + * @param int $var + * @return $this + */ + public function setMaxActiveVehicles($var) + { + GPBUtil::checkInt32($var); + $this->max_active_vehicles = $var; + + return $this; + } + + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGlobalStartTime() + { + return $this->global_start_time; + } + + public function hasGlobalStartTime() + { + return isset($this->global_start_time); + } + + public function clearGlobalStartTime() + { + unset($this->global_start_time); + } + + /** + * Global start and end time of the model: no times outside of this range + * can be considered valid. + * The model's time span must be less than a year, i.e. the `global_end_time` + * and the `global_start_time` must be within 31536000 seconds of each other. + * When using `cost_per_*hour` fields, you might want to set this window to a + * smaller interval to increase performance (eg. if you model a single day, + * you should set the global time limits to that day). + * If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used + * as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_start_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGlobalStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->global_start_time = $var; + + return $this; + } + + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGlobalEndTime() + { + return $this->global_end_time; + } + + public function hasGlobalEndTime() + { + return isset($this->global_end_time); + } + + public function clearGlobalEndTime() + { + unset($this->global_end_time); + } + + /** + * If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) + * is used as default. + * + * Generated from protobuf field .google.protobuf.Timestamp global_end_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGlobalEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->global_end_time = $var; + + return $this; + } + + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + * @return float + */ + public function getGlobalDurationCostPerHour() + { + return $this->global_duration_cost_per_hour; + } + + /** + * The "global duration" of the overall plan is the difference between the + * earliest effective start time and the latest effective end time of + * all vehicles. Users can assign a cost per hour to that quantity to try + * and optimize for earliest job completion, for example. This cost must be in + * the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double global_duration_cost_per_hour = 7; + * @param float $var + * @return $this + */ + public function setGlobalDurationCostPerHour($var) + { + GPBUtil::checkDouble($var); + $this->global_duration_cost_per_hour = $var; + + return $this; + } + + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrices() + { + return $this->duration_distance_matrices; + } + + /** + * Specifies duration and distance matrices used in the model. If this field + * is empty, Google Maps or geodesic distances will be used instead, depending + * on the value of the `use_geodesic_distances` field. If it is not empty, + * `use_geodesic_distances` cannot be true and neither + * `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` + * can be empty. + * Usage examples: + * * There are two locations: locA and locB. + * * 1 vehicle starting its route at locA and ending it at locA. + * * 1 pickup visit request at locB. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locA" } + * shipments { pickups { tags: "locB" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_dst_tags: "locA" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrices { + * rows { # from: locA + * durations { seconds: 0 } meters: 0 # to: locA + * durations { seconds: 100 } meters: 1000 # to: locB + * } + * rows { # from: locB + * durations { seconds: 102 } meters: 990 # to: locA + * durations { seconds: 0 } meters: 0 # to: locB + * } + * } + * } + * ``` + * * There are three locations: locA, locB and locC. + * * 1 vehicle starting its route at locA and ending it at locB, using + * matrix "fast". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "slow". + * * 1 vehicle starting its route at locB and ending it at locB, using + * matrix "fast". + * * 1 pickup visit request at locC. + * ``` + * model { + * vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } + * vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } + * shipments { pickups { tags: "locC" } } + * duration_distance_matrix_src_tags: "locA" + * duration_distance_matrix_src_tags: "locB" + * duration_distance_matrix_src_tags: "locC" + * duration_distance_matrix_dst_tags: "locB" + * duration_distance_matrix_dst_tags: "locC" + * duration_distance_matrices { + * vehicle_start_tag: "fast" + * rows { # from: locA + * durations { seconds: 1000 } meters: 2000 # to: locB + * durations { seconds: 600 } meters: 1000 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 700 } meters: 1200 # to: locC + * } + * rows { # from: locC + * durations { seconds: 702 } meters: 1190 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * duration_distance_matrices { + * vehicle_start_tag: "slow" + * rows { # from: locA + * durations { seconds: 1800 } meters: 2001 # to: locB + * durations { seconds: 900 } meters: 1002 # to: locC + * } + * rows { # from: locB + * durations { seconds: 0 } meters: 0 # to: locB + * durations { seconds: 1000 } meters: 1202 # to: locC + * } + * rows { # from: locC + * durations { seconds: 1001 } meters: 1195 # to: locB + * durations { seconds: 0 } meters: 0 # to: locC + * } + * } + * } + * ``` + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix duration_distance_matrices = 8; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix::class); + $this->duration_distance_matrices = $arr; + + return $this; + } + + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrixSrcTags() + { + return $this->duration_distance_matrix_src_tags; + } + + /** + * Tags defining the sources of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j)` defines durations and distances + * from visits with tag `duration_distance_matrix_src_tags(j)` to other visits + * in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_src_tags = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrixSrcTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->duration_distance_matrix_src_tags = $arr; + + return $this; + } + + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurationDistanceMatrixDstTags() + { + return $this->duration_distance_matrix_dst_tags; + } + + /** + * Tags defining the destinations of the duration and distance matrices; + * `duration_distance_matrices(i).rows(j).durations(k)` (resp. + * `duration_distance_matrices(i).rows(j).meters(k))` defines the duration + * (resp. the distance) of the travel from visits with tag + * `duration_distance_matrix_src_tags(j)` to visits with tag + * `duration_distance_matrix_dst_tags(k)` in matrix i. + * Tags correspond to + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags]. + * A given `VisitRequest` or `Vehicle` must match exactly one tag in this + * field. Note that a `Vehicle`'s source, destination and matrix tags may be + * the same; similarly a `VisitRequest`'s source and destination tags may be + * the same. All tags must be different and cannot be empty strings. If this + * field is not empty, then `duration_distance_matrices` must not be empty. + * + * Generated from protobuf field repeated string duration_distance_matrix_dst_tags = 10; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurationDistanceMatrixDstTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->duration_distance_matrix_dst_tags = $arr; + + return $this; + } + + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransitionAttributes() + { + return $this->transition_attributes; + } + + /** + * Transition attributes added to the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TransitionAttributes transition_attributes = 11; + * @param array<\Google\Maps\RouteOptimization\V1\TransitionAttributes>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransitionAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TransitionAttributes::class); + $this->transition_attributes = $arr; + + return $this; + } + + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipmentTypeIncompatibilities() + { + return $this->shipment_type_incompatibilities; + } + + /** + * Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility shipment_type_incompatibilities = 12; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipmentTypeIncompatibilities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility::class); + $this->shipment_type_incompatibilities = $arr; + + return $this; + } + + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShipmentTypeRequirements() + { + return $this->shipment_type_requirements; + } + + /** + * Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`). + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentTypeRequirement shipment_type_requirements = 13; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShipmentTypeRequirements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement::class); + $this->shipment_type_requirements = $arr; + + return $this; + } + + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrecedenceRules() + { + return $this->precedence_rules; + } + + /** + * Set of precedence rules which must be enforced in the model. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule precedence_rules = 14; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrecedenceRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\PrecedenceRule::class); + $this->precedence_rules = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php new file mode 100644 index 000000000000..dc14a06e94f1 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix.php @@ -0,0 +1,135 @@ +google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix + */ +class DurationDistanceMatrix extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + */ + private $rows; + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + */ + protected $vehicle_start_tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $rows + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * @type string $vehicle_start_tag + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Specifies the rows of the duration and distance matrix. It must have as + * many elements as + * [ShipmentModel.duration_distance_matrix_src_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_src_tags]. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row rows = 1; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentModel\DurationDistanceMatrix\Row::class); + $this->rows = $arr; + + return $this; + } + + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + * @return string + */ + public function getVehicleStartTag() + { + return $this->vehicle_start_tag; + } + + /** + * Tag defining to which vehicles this duration and distance matrix applies. + * If empty, this applies to all vehicles, and there can only be a single + * matrix. + * Each vehicle start must match exactly one matrix, i.e. exactly one of + * their `start_tags` field must match the `vehicle_start_tag` of a matrix + * (and of that matrix only). + * All matrices must have a different `vehicle_start_tag`. + * + * Generated from protobuf field string vehicle_start_tag = 2; + * @param string $var + * @return $this + */ + public function setVehicleStartTag($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_start_tag = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php new file mode 100644 index 000000000000..dfe9ec58784d --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/DurationDistanceMatrix/Row.php @@ -0,0 +1,114 @@ +google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + */ + private $durations; + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + */ + private $meters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $durations + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * @type array|\Google\Protobuf\Internal\RepeatedField $meters + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDurations() + { + return $this->durations; + } + + /** + * Duration values for a given row. It must have as many elements as + * [ShipmentModel.duration_distance_matrix_dst_tags][google.maps.routeoptimization.v1.ShipmentModel.duration_distance_matrix_dst_tags]. + * + * Generated from protobuf field repeated .google.protobuf.Duration durations = 1; + * @param array<\Google\Protobuf\Duration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDurations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->durations = $arr; + + return $this; + } + + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMeters() + { + return $this->meters; + } + + /** + * Distance values for a given row. If no costs or constraints refer to + * distances in the model, this can be left empty; otherwise it must have + * as many elements as `durations`. + * + * Generated from protobuf field repeated double meters = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMeters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->meters = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php b/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php new file mode 100644 index 000000000000..2aea9bab72c0 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentModel/PrecedenceRule.php @@ -0,0 +1,241 @@ +google.maps.routeoptimization.v1.ShipmentModel.PrecedenceRule + */ +class PrecedenceRule extends \Google\Protobuf\Internal\Message +{ + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + */ + protected $first_index = null; + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + */ + protected $first_is_delivery = false; + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + */ + protected $second_index = null; + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + */ + protected $second_is_delivery = false; + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + */ + protected $offset_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $first_index + * Shipment index of the "first" event. This field must be specified. + * @type bool $first_is_delivery + * Indicates if the "first" event is a delivery. + * @type int $second_index + * Shipment index of the "second" event. This field must be specified. + * @type bool $second_is_delivery + * Indicates if the "second" event is a delivery. + * @type \Google\Protobuf\Duration $offset_duration + * The offset between the "first" and "second" event. It can be negative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + * @return int + */ + public function getFirstIndex() + { + return isset($this->first_index) ? $this->first_index : 0; + } + + public function hasFirstIndex() + { + return isset($this->first_index); + } + + public function clearFirstIndex() + { + unset($this->first_index); + } + + /** + * Shipment index of the "first" event. This field must be specified. + * + * Generated from protobuf field optional int32 first_index = 1; + * @param int $var + * @return $this + */ + public function setFirstIndex($var) + { + GPBUtil::checkInt32($var); + $this->first_index = $var; + + return $this; + } + + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + * @return bool + */ + public function getFirstIsDelivery() + { + return $this->first_is_delivery; + } + + /** + * Indicates if the "first" event is a delivery. + * + * Generated from protobuf field bool first_is_delivery = 3; + * @param bool $var + * @return $this + */ + public function setFirstIsDelivery($var) + { + GPBUtil::checkBool($var); + $this->first_is_delivery = $var; + + return $this; + } + + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + * @return int + */ + public function getSecondIndex() + { + return isset($this->second_index) ? $this->second_index : 0; + } + + public function hasSecondIndex() + { + return isset($this->second_index); + } + + public function clearSecondIndex() + { + unset($this->second_index); + } + + /** + * Shipment index of the "second" event. This field must be specified. + * + * Generated from protobuf field optional int32 second_index = 2; + * @param int $var + * @return $this + */ + public function setSecondIndex($var) + { + GPBUtil::checkInt32($var); + $this->second_index = $var; + + return $this; + } + + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + * @return bool + */ + public function getSecondIsDelivery() + { + return $this->second_is_delivery; + } + + /** + * Indicates if the "second" event is a delivery. + * + * Generated from protobuf field bool second_is_delivery = 4; + * @param bool $var + * @return $this + */ + public function setSecondIsDelivery($var) + { + GPBUtil::checkBool($var); + $this->second_is_delivery = $var; + + return $this; + } + + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getOffsetDuration() + { + return $this->offset_duration; + } + + public function hasOffsetDuration() + { + return isset($this->offset_duration); + } + + public function clearOffsetDuration() + { + unset($this->offset_duration); + } + + /** + * The offset between the "first" and "second" event. It can be negative. + * + * Generated from protobuf field .google.protobuf.Duration offset_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setOffsetDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->offset_duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute.php b/MapsRouteOptimization/src/V1/ShipmentRoute.php new file mode 100644 index 000000000000..3c191d29cca6 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute.php @@ -0,0 +1,706 @@ + + * | TRANSITION[i] | VISIT[i] | + * | | | + * | * TRAVEL: the vehicle moves from | PERFORM the visit: | + * | VISIT[i-1].departure_location to | | + * | VISIT[i].arrival_location, which | * Spend some time: | + * | takes a given travel duration | the "visit duration". | + * | and distance | | + * | | * Load or unload | + * | * BREAKS: the driver may have | some quantities from the | + * | breaks (e.g. lunch break). | vehicle: the "demand". | + * | | | + * | * WAIT: the driver/vehicle does | | + * | nothing. This can happen for | | + * | many reasons, for example when | | + * | the vehicle reaches the next | | + * | event's destination before the | | + * | start of its time window | | + * | | | + * | * DELAY: *right before* the next | | + * | arrival. E.g. the vehicle and/or | | + * | driver spends time unloading. | | + * | | | + * ---+-------------------------------------+-----------------------------+--> + * ^ ^ ^ + * V[i-1].end V[i].start V[i].end + * ``` + * Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged + * during a transition. + * * They don't overlap. + * * The DELAY is unique and *must* be a contiguous period of time right + * before the next visit (or vehicle end). Thus, it suffice to know the + * delay duration to know its start and end time. + * * The BREAKS are contiguous, non-overlapping periods of time. The + * response specifies the start time and duration of each break. + * * TRAVEL and WAIT are "preemptable": they can be interrupted several times + * during this transition. Clients can assume that travel happens "as soon as + * possible" and that "wait" fills the remaining time. + * A (complex) example: + * ``` + * TRANSITION[i] + * --++-----+-----------------------------------------------------------++--> + * || | | | | | | || + * || T | B | T | | B | | D || + * || r | r | r | W | r | W | e || + * || a | e | a | a | e | a | l || + * || v | a | v | i | a | i | a || + * || e | k | e | t | k | t | y || + * || l | | l | | | | || + * || | | | | | | || + * --++-----------------------------------------------------------------++--> + * ``` + * + * Generated from protobuf message google.maps.routeoptimization.v1.ShipmentRoute + */ +class ShipmentRoute extends \Google\Protobuf\Internal\Message +{ + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + */ + protected $vehicle_index = 0; + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + */ + protected $vehicle_label = ''; + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + */ + protected $vehicle_start_time = null; + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + */ + protected $vehicle_end_time = null; + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + */ + private $visits; + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + */ + private $transitions; + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + */ + protected $has_traffic_infeasibilities = false; + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + */ + protected $route_polyline = null; + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + */ + private $breaks; + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + */ + protected $metrics = null; + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + */ + private $route_costs; + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + */ + protected $route_total_cost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $vehicle_index + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * @type string $vehicle_label + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * @type \Google\Protobuf\Timestamp $vehicle_start_time + * Time at which the vehicle starts its route. + * @type \Google\Protobuf\Timestamp $vehicle_end_time + * Time at which the vehicle finishes its route. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit>|\Google\Protobuf\Internal\RepeatedField $visits + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition>|\Google\Protobuf\Internal\RepeatedField $transitions + * Ordered list of transitions for the route. + * @type bool $has_traffic_infeasibilities + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * @type \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $route_polyline + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * @type array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak>|\Google\Protobuf\Internal\RepeatedField $breaks + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * @type \Google\Maps\RouteOptimization\V1\AggregatedMetrics $metrics + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * @type array|\Google\Protobuf\Internal\MapField $route_costs + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * @type float $route_total_cost + * Total cost of the route. The sum of all costs in the cost map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + * @return int + */ + public function getVehicleIndex() + { + return $this->vehicle_index; + } + + /** + * Vehicle performing the route, identified by its index in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 vehicle_index = 1; + * @param int $var + * @return $this + */ + public function setVehicleIndex($var) + { + GPBUtil::checkInt32($var); + $this->vehicle_index = $var; + + return $this; + } + + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + * @return string + */ + public function getVehicleLabel() + { + return $this->vehicle_label; + } + + /** + * Label of the vehicle performing this route, equal to + * `ShipmentModel.vehicles(vehicle_index).label`, if specified. + * + * Generated from protobuf field string vehicle_label = 2; + * @param string $var + * @return $this + */ + public function setVehicleLabel($var) + { + GPBUtil::checkString($var, True); + $this->vehicle_label = $var; + + return $this; + } + + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehicleStartTime() + { + return $this->vehicle_start_time; + } + + public function hasVehicleStartTime() + { + return isset($this->vehicle_start_time); + } + + public function clearVehicleStartTime() + { + unset($this->vehicle_start_time); + } + + /** + * Time at which the vehicle starts its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_start_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehicleStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_start_time = $var; + + return $this; + } + + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getVehicleEndTime() + { + return $this->vehicle_end_time; + } + + public function hasVehicleEndTime() + { + return isset($this->vehicle_end_time); + } + + public function clearVehicleEndTime() + { + unset($this->vehicle_end_time); + } + + /** + * Time at which the vehicle finishes its route. + * + * Generated from protobuf field .google.protobuf.Timestamp vehicle_end_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setVehicleEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->vehicle_end_time = $var; + + return $this; + } + + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVisits() + { + return $this->visits; + } + + /** + * Ordered sequence of visits representing a route. + * visits[i] is the i-th visit in the route. + * If this field is empty, the vehicle is considered as unused. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Visit visits = 7; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVisits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\Visit::class); + $this->visits = $arr; + + return $this; + } + + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransitions() + { + return $this->transitions; + } + + /** + * Ordered list of transitions for the route. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Transition transitions = 8; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\Transition::class); + $this->transitions = $arr; + + return $this; + } + + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + * @return bool + */ + public function getHasTrafficInfeasibilities() + { + return $this->has_traffic_infeasibilities; + } + + /** + * When + * [OptimizeToursRequest.consider_road_traffic][google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * is set to true, this field indicates that inconsistencies in route timings + * are predicted using traffic-based travel duration estimates. There may be + * insufficient time to complete traffic-adjusted travel, delays, and breaks + * between visits, before the first visit, or after the last visit, while + * still satisfying the visit and vehicle time windows. For example, + * ``` + * start_time(previous_visit) + duration(previous_visit) + + * travel_duration(previous_visit, next_visit) > start_time(next_visit) + * ``` + * Arrival at next_visit will likely happen later than its current + * time window due the increased estimate of travel time + * `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break + * may be forced to overlap with a visit due to an increase in travel time + * estimates and visit or break time window restrictions. + * + * Generated from protobuf field bool has_traffic_infeasibilities = 9; + * @param bool $var + * @return $this + */ + public function setHasTrafficInfeasibilities($var) + { + GPBUtil::checkBool($var); + $this->has_traffic_infeasibilities = $var; + + return $this; + } + + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * @return \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline|null + */ + public function getRoutePolyline() + { + return $this->route_polyline; + } + + public function hasRoutePolyline() + { + return isset($this->route_polyline); + } + + public function clearRoutePolyline() + { + unset($this->route_polyline); + } + + /** + * The encoded polyline representation of the route. + * This field is only populated if + * [OptimizeToursRequest.populate_polylines][google.maps.routeoptimization.v1.OptimizeToursRequest.populate_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 10; + * @param \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $var + * @return $this + */ + public function setRoutePolyline($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline::class); + $this->route_polyline = $var; + + return $this; + } + + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBreaks() + { + return $this->breaks; + } + + /** + * Breaks scheduled for the vehicle performing this route. + * The `breaks` sequence represents time intervals, each starting at the + * corresponding `start_time` and lasting `duration` seconds. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.ShipmentRoute.Break breaks = 11; + * @param array<\Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBreaks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\PBBreak::class); + $this->breaks = $arr; + + return $this; + } + + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * @return \Google\Maps\RouteOptimization\V1\AggregatedMetrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * Duration, distance and load metrics for this route. The fields of + * [AggregatedMetrics][google.maps.routeoptimization.v1.AggregatedMetrics] are + * summed over all + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * or + * [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], + * depending on the context. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.AggregatedMetrics metrics = 12; + * @param \Google\Maps\RouteOptimization\V1\AggregatedMetrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\AggregatedMetrics::class); + $this->metrics = $var; + + return $this; + } + + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRouteCosts() + { + return $this->route_costs; + } + + /** + * Cost of the route, broken down by cost-related request fields. + * The keys are proto paths, relative to the input OptimizeToursRequest, e.g. + * "model.shipments.pickups.cost", and the values are the total cost + * generated by the corresponding cost field, aggregated over the whole route. + * In other words, costs["model.shipments.pickups.cost"] is the sum of all + * pickup costs over the route. All costs defined in the model are reported in + * detail here with the exception of costs related to TransitionAttributes + * that are only reported in an aggregated way as of 2022/01. + * + * Generated from protobuf field map route_costs = 17; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRouteCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->route_costs = $arr; + + return $this; + } + + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + * @return float + */ + public function getRouteTotalCost() + { + return $this->route_total_cost; + } + + /** + * Total cost of the route. The sum of all costs in the cost map. + * + * Generated from protobuf field double route_total_cost = 18; + * @param float $var + * @return $this + */ + public function setRouteTotalCost($var) + { + GPBUtil::checkDouble($var); + $this->route_total_cost = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php b/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php new file mode 100644 index 000000000000..db8290832846 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/EncodedPolyline.php @@ -0,0 +1,71 @@ +google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline + */ +class EncodedPolyline extends \Google\Protobuf\Internal\Message +{ + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + */ + protected $points = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $points + * String representing encoded points of the polyline. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + * @return string + */ + public function getPoints() + { + return $this->points; + } + + /** + * String representing encoded points of the polyline. + * + * Generated from protobuf field string points = 1; + * @param string $var + * @return $this + */ + public function setPoints($var) + { + GPBUtil::checkString($var, True); + $this->points = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php b/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php new file mode 100644 index 000000000000..e84a701f43cc --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/PBBreak.php @@ -0,0 +1,122 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Break + */ +class PBBreak extends \Google\Protobuf\Internal\Message +{ + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Start time of a break. + * @type \Google\Protobuf\Duration $duration + * Duration of a break. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of a break. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration of a break. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php b/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php new file mode 100644 index 000000000000..2de1b69665a9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/Transition.php @@ -0,0 +1,571 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Transition + */ +class Transition extends \Google\Protobuf\Internal\Message +{ + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + */ + protected $travel_duration = null; + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + */ + protected $travel_distance_meters = 0.0; + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + */ + protected $traffic_info_unavailable = false; + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + */ + protected $delay_duration = null; + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + */ + protected $break_duration = null; + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + */ + protected $wait_duration = null; + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + */ + protected $total_duration = null; + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + */ + protected $start_time = null; + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + */ + protected $route_polyline = null; + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + */ + private $vehicle_loads; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $travel_duration + * Travel duration during this transition. + * @type float $travel_distance_meters + * Distance traveled during the transition. + * @type bool $traffic_info_unavailable + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * @type \Google\Protobuf\Duration $delay_duration + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * @type \Google\Protobuf\Duration $break_duration + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * @type \Google\Protobuf\Duration $wait_duration + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * @type \Google\Protobuf\Duration $total_duration + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * @type \Google\Protobuf\Timestamp $start_time + * Start time of this transition. + * @type \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $route_polyline + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * @type array|\Google\Protobuf\Internal\MapField $vehicle_loads + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTravelDuration() + { + return $this->travel_duration; + } + + public function hasTravelDuration() + { + return isset($this->travel_duration); + } + + public function clearTravelDuration() + { + unset($this->travel_duration); + } + + /** + * Travel duration during this transition. + * + * Generated from protobuf field .google.protobuf.Duration travel_duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTravelDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->travel_duration = $var; + + return $this; + } + + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + * @return float + */ + public function getTravelDistanceMeters() + { + return $this->travel_distance_meters; + } + + /** + * Distance traveled during the transition. + * + * Generated from protobuf field double travel_distance_meters = 2; + * @param float $var + * @return $this + */ + public function setTravelDistanceMeters($var) + { + GPBUtil::checkDouble($var); + $this->travel_distance_meters = $var; + + return $this; + } + + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + * @return bool + */ + public function getTrafficInfoUnavailable() + { + return $this->traffic_info_unavailable; + } + + /** + * When traffic is requested via + * [OptimizeToursRequest.consider_road_traffic] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic], + * and the traffic info couldn't be retrieved for a `Transition`, this + * boolean is set to true. This may be temporary (rare hiccup in the + * realtime traffic servers) or permanent (no data for this location). + * + * Generated from protobuf field bool traffic_info_unavailable = 3; + * @param bool $var + * @return $this + */ + public function setTrafficInfoUnavailable($var) + { + GPBUtil::checkBool($var); + $this->traffic_info_unavailable = $var; + + return $this; + } + + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getDelayDuration() + { + return $this->delay_duration; + } + + public function hasDelayDuration() + { + return isset($this->delay_duration); + } + + public function clearDelayDuration() + { + unset($this->delay_duration); + } + + /** + * Sum of the delay durations applied to this transition. If any, the delay + * starts exactly `delay_duration` seconds before the next event (visit or + * vehicle end). See + * [TransitionAttributes.delay][google.maps.routeoptimization.v1.TransitionAttributes.delay]. + * + * Generated from protobuf field .google.protobuf.Duration delay_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelayDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay_duration = $var; + + return $this; + } + + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getBreakDuration() + { + return $this->break_duration; + } + + public function hasBreakDuration() + { + return isset($this->break_duration); + } + + public function clearBreakDuration() + { + unset($this->break_duration); + } + + /** + * Sum of the duration of the breaks occurring during this transition, if + * any. Details about each break's start time and duration are stored in + * [ShipmentRoute.breaks][google.maps.routeoptimization.v1.ShipmentRoute.breaks]. + * + * Generated from protobuf field .google.protobuf.Duration break_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBreakDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->break_duration = $var; + + return $this; + } + + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getWaitDuration() + { + return $this->wait_duration; + } + + public function hasWaitDuration() + { + return isset($this->wait_duration); + } + + public function clearWaitDuration() + { + unset($this->wait_duration); + } + + /** + * Time spent waiting during this transition. Wait duration corresponds to + * idle time and does not include break time. Also note that this wait time + * may be split into several non-contiguous intervals. + * + * Generated from protobuf field .google.protobuf.Duration wait_duration = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWaitDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait_duration = $var; + + return $this; + } + + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getTotalDuration() + { + return $this->total_duration; + } + + public function hasTotalDuration() + { + return isset($this->total_duration); + } + + public function clearTotalDuration() + { + unset($this->total_duration); + } + + /** + * Total duration of the transition, provided for convenience. It is equal + * to: + * * next visit `start_time` (or `vehicle_end_time` if this is the last + * transition) - this transition's `start_time`; + * * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following + * additionally holds: `total_duration = travel_duration + delay_duration + * + break_duration + wait_duration`. + * + * Generated from protobuf field .google.protobuf.Duration total_duration = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTotalDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->total_duration = $var; + + return $this; + } + + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of this transition. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * @return \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline|null + */ + public function getRoutePolyline() + { + return $this->route_polyline; + } + + public function hasRoutePolyline() + { + return isset($this->route_polyline); + } + + public function clearRoutePolyline() + { + unset($this->route_polyline); + } + + /** + * The encoded polyline representation of the route followed during the + * transition. + * This field is only populated if [populate_transition_polylines] + * [google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines] + * is set to true. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentRoute.EncodedPolyline route_polyline = 9; + * @param \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline $var + * @return $this + */ + public function setRoutePolyline($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\ShipmentRoute\EncodedPolyline::class); + $this->route_polyline = $var; + + return $this; + } + + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getVehicleLoads() + { + return $this->vehicle_loads; + } + + /** + * Vehicle loads during this transition, for each type that either appears + * in this vehicle's + * [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits], + * or that have non-zero + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * on some shipment performed on this route. + * The loads during the first transition are the starting loads of the + * vehicle route. Then, after each visit, the visit's `load_demands` are + * either added or subtracted to get the next transition's loads, depending + * on whether the visit was a pickup or a delivery. + * + * Generated from protobuf field map vehicle_loads = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setVehicleLoads($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\ShipmentRoute\VehicleLoad::class); + $this->vehicle_loads = $arr; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php b/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php new file mode 100644 index 000000000000..a01bdaf35f2a --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/VehicleLoad.php @@ -0,0 +1,78 @@ +google.maps.routeoptimization.v1.ShipmentRoute.VehicleLoad + */ +class VehicleLoad extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + */ + protected $amount = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $amount + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + * @return int|string + */ + public function getAmount() + { + return $this->amount; + } + + /** + * The amount of load on the vehicle, for the given type. The unit of load + * is usually indicated by the type. See + * [Transition.vehicle_loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition.vehicle_loads]. + * + * Generated from protobuf field int64 amount = 1; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php b/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php new file mode 100644 index 000000000000..def25c193fb5 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentRoute/Visit.php @@ -0,0 +1,431 @@ +google.maps.routeoptimization.v1.ShipmentRoute.Visit + */ +class Visit extends \Google\Protobuf\Internal\Message +{ + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + */ + protected $shipment_index = 0; + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + */ + protected $is_pickup = false; + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + */ + protected $visit_request_index = 0; + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + */ + protected $start_time = null; + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + */ + private $load_demands; + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + */ + protected $detour = null; + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + */ + protected $shipment_label = ''; + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + */ + protected $visit_label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $shipment_index + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * @type bool $is_pickup + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * @type int $visit_request_index + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * @type \Google\Protobuf\Timestamp $start_time + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * @type array|\Google\Protobuf\Internal\MapField $load_demands + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * @type \Google\Protobuf\Duration $detour + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * @type string $shipment_label + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * @type string $visit_label + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + * @return int + */ + public function getShipmentIndex() + { + return $this->shipment_index; + } + + /** + * Index of the `shipments` field in the source + * [ShipmentModel][google.maps.routeoptimization.v1.ShipmentModel]. + * + * Generated from protobuf field int32 shipment_index = 1; + * @param int $var + * @return $this + */ + public function setShipmentIndex($var) + { + GPBUtil::checkInt32($var); + $this->shipment_index = $var; + + return $this; + } + + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + * @return bool + */ + public function getIsPickup() + { + return $this->is_pickup; + } + + /** + * If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it + * corresponds to a delivery. + * + * Generated from protobuf field bool is_pickup = 2; + * @param bool $var + * @return $this + */ + public function setIsPickup($var) + { + GPBUtil::checkBool($var); + $this->is_pickup = $var; + + return $this; + } + + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + * @return int + */ + public function getVisitRequestIndex() + { + return $this->visit_request_index; + } + + /** + * Index of `VisitRequest` in either the pickup or delivery field of the + * `Shipment` (see `is_pickup`). + * + * Generated from protobuf field int32 visit_request_index = 3; + * @param int $var + * @return $this + */ + public function setVisitRequestIndex($var) + { + GPBUtil::checkInt32($var); + $this->visit_request_index = $var; + + return $this; + } + + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time at which the visit starts. Note that the vehicle may arrive earlier + * than this at the visit location. Times are consistent with the + * `ShipmentModel`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadDemands() + { + return $this->load_demands; + } + + /** + * Total visit load demand as the sum of the shipment and the visit request + * `load_demands`. The values are negative if the visit is a delivery. + * Demands are reported for the same types as the + * [Transition.loads][google.maps.routeoptimization.v1.ShipmentRoute.Transition] + * (see this field). + * + * Generated from protobuf field map load_demands = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadDemands($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Shipment\Load::class); + $this->load_demands = $arr; + + return $this; + } + + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getDetour() + { + return $this->detour; + } + + public function hasDetour() + { + return isset($this->detour); + } + + public function clearDetour() + { + unset($this->detour); + } + + /** + * Extra detour time due to the shipments visited on the route before the + * visit and to the potential waiting time induced by time windows. + * If the visit is a delivery, the detour is computed from the corresponding + * pickup visit and is equal to: + * ``` + * start_time(delivery) - start_time(pickup) + * - (duration(pickup) + travel duration from the pickup location + * to the delivery location). + * ``` + * Otherwise, it is computed from the vehicle `start_location` and is equal + * to: + * ``` + * start_time - vehicle_start_time - travel duration from + * the vehicle's `start_location` to the visit. + * ``` + * + * Generated from protobuf field .google.protobuf.Duration detour = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDetour($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->detour = $var; + + return $this; + } + + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + * @return string + */ + public function getShipmentLabel() + { + return $this->shipment_label; + } + + /** + * Copy of the corresponding `Shipment.label`, if specified in the + * `Shipment`. + * + * Generated from protobuf field string shipment_label = 7; + * @param string $var + * @return $this + */ + public function setShipmentLabel($var) + { + GPBUtil::checkString($var, True); + $this->shipment_label = $var; + + return $this; + } + + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + * @return string + */ + public function getVisitLabel() + { + return $this->visit_label; + } + + /** + * Copy of the corresponding + * [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], + * if specified in the `VisitRequest`. + * + * Generated from protobuf field string visit_label = 8; + * @param string $var + * @return $this + */ + public function setVisitLabel($var) + { + GPBUtil::checkString($var, True); + $this->visit_label = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php new file mode 100644 index 000000000000..17d80f6ccd1d --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility.php @@ -0,0 +1,107 @@ +google.maps.routeoptimization.v1.ShipmentTypeIncompatibility + */ +class ShipmentTypeIncompatibility extends \Google\Protobuf\Internal\Message +{ + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + */ + private $types; + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + */ + protected $incompatibility_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $types + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * @type int $incompatibility_mode + * Mode applied to the incompatibility. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTypes() + { + return $this->types; + } + + /** + * List of incompatible types. Two shipments having different `shipment_types` + * among those listed are "incompatible". + * + * Generated from protobuf field repeated string types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->types = $arr; + + return $this; + } + + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * @return int + */ + public function getIncompatibilityMode() + { + return $this->incompatibility_mode; + } + + /** + * Mode applied to the incompatibility. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode incompatibility_mode = 2; + * @param int $var + * @return $this + */ + public function setIncompatibilityMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\ShipmentTypeIncompatibility\IncompatibilityMode::class); + $this->incompatibility_mode = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php new file mode 100644 index 000000000000..74baee1082ed --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeIncompatibility/IncompatibilityMode.php @@ -0,0 +1,70 @@ +google.maps.routeoptimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode + */ +class IncompatibilityMode +{ + /** + * Unspecified incompatibility mode. This value should never be used. + * + * Generated from protobuf enum INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + */ + const INCOMPATIBILITY_MODE_UNSPECIFIED = 0; + /** + * In this mode, two shipments with incompatible types can never share the + * same vehicle. + * + * Generated from protobuf enum NOT_PERFORMED_BY_SAME_VEHICLE = 1; + */ + const NOT_PERFORMED_BY_SAME_VEHICLE = 1; + /** + * For two shipments with incompatible types with the + * `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode: + * * If both are pickups only (no deliveries) or deliveries only (no + * pickups), they cannot share the same vehicle at all. + * * If one of the shipments has a delivery and the other a pickup, the two + * shipments can share the same vehicle iff the former shipment is + * delivered before the latter is picked up. + * + * Generated from protobuf enum NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + */ + const NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2; + + private static $valueToName = [ + self::INCOMPATIBILITY_MODE_UNSPECIFIED => 'INCOMPATIBILITY_MODE_UNSPECIFIED', + self::NOT_PERFORMED_BY_SAME_VEHICLE => 'NOT_PERFORMED_BY_SAME_VEHICLE', + self::NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY => 'NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php new file mode 100644 index 000000000000..c7d8d7f847b7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement.php @@ -0,0 +1,156 @@ +google.maps.routeoptimization.v1.ShipmentTypeRequirement + */ +class ShipmentTypeRequirement extends \Google\Protobuf\Internal\Message +{ + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + */ + private $required_shipment_type_alternatives; + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + */ + private $dependent_shipment_types; + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + */ + protected $requirement_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $required_shipment_type_alternatives + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * @type array|\Google\Protobuf\Internal\RepeatedField $dependent_shipment_types + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * @type int $requirement_mode + * Mode applied to the requirement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredShipmentTypeAlternatives() + { + return $this->required_shipment_type_alternatives; + } + + /** + * List of alternative shipment types required by the + * `dependent_shipment_types`. + * + * Generated from protobuf field repeated string required_shipment_type_alternatives = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredShipmentTypeAlternatives($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->required_shipment_type_alternatives = $arr; + + return $this; + } + + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDependentShipmentTypes() + { + return $this->dependent_shipment_types; + } + + /** + * All shipments with a type in the `dependent_shipment_types` field require + * at least one shipment of type `required_shipment_type_alternatives` to be + * visited on the same route. + * NOTE: Chains of requirements such that a `shipment_type` depends on itself + * are not allowed. + * + * Generated from protobuf field repeated string dependent_shipment_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDependentShipmentTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dependent_shipment_types = $arr; + + return $this; + } + + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * @return int + */ + public function getRequirementMode() + { + return $this->requirement_mode; + } + + /** + * Mode applied to the requirement. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode requirement_mode = 3; + * @param int $var + * @return $this + */ + public function setRequirementMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\ShipmentTypeRequirement\RequirementMode::class); + $this->requirement_mode = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php new file mode 100644 index 000000000000..7aab3666154e --- /dev/null +++ b/MapsRouteOptimization/src/V1/ShipmentTypeRequirement/RequirementMode.php @@ -0,0 +1,78 @@ +google.maps.routeoptimization.v1.ShipmentTypeRequirement.RequirementMode + */ +class RequirementMode +{ + /** + * Unspecified requirement mode. This value should never be used. + * + * Generated from protobuf enum REQUIREMENT_MODE_UNSPECIFIED = 0; + */ + const REQUIREMENT_MODE_UNSPECIFIED = 0; + /** + * In this mode, all "dependent" shipments must share the same vehicle as at + * least one of their "required" shipments. + * + * Generated from protobuf enum PERFORMED_BY_SAME_VEHICLE = 1; + */ + const PERFORMED_BY_SAME_VEHICLE = 1; + /** + * With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent" + * shipments need to have at least one "required" shipment on their vehicle + * at the time of their pickup. + * A "dependent" shipment pickup must therefore have either: + * * A delivery-only "required" shipment delivered on the route after, or + * * A "required" shipment picked up on the route before it, and if the + * "required" shipment has a delivery, this delivery must be performed + * after the "dependent" shipment's pickup. + * + * Generated from protobuf enum IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + */ + const IN_SAME_VEHICLE_AT_PICKUP_TIME = 2; + /** + * Same as before, except the "dependent" shipments need to have a + * "required" shipment on their vehicle at the time of their *delivery*. + * + * Generated from protobuf enum IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + */ + const IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3; + + private static $valueToName = [ + self::REQUIREMENT_MODE_UNSPECIFIED => 'REQUIREMENT_MODE_UNSPECIFIED', + self::PERFORMED_BY_SAME_VEHICLE => 'PERFORMED_BY_SAME_VEHICLE', + self::IN_SAME_VEHICLE_AT_PICKUP_TIME => 'IN_SAME_VEHICLE_AT_PICKUP_TIME', + self::IN_SAME_VEHICLE_AT_DELIVERY_TIME => 'IN_SAME_VEHICLE_AT_DELIVERY_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment.php b/MapsRouteOptimization/src/V1/SkippedShipment.php new file mode 100644 index 000000000000..5a036dbd56e2 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment.php @@ -0,0 +1,153 @@ +google.maps.routeoptimization.v1.SkippedShipment + */ +class SkippedShipment extends \Google\Protobuf\Internal\Message +{ + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + */ + protected $index = 0; + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + */ + protected $label = ''; + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + */ + private $reasons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $index + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * @type string $label + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * @type array<\Google\Maps\RouteOptimization\V1\SkippedShipment\Reason>|\Google\Protobuf\Internal\RepeatedField $reasons + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index corresponds to the index of the shipment in the source + * `ShipmentModel`. + * + * Generated from protobuf field int32 index = 1; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Copy of the corresponding + * [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if + * specified in the `Shipment`. + * + * Generated from protobuf field string label = 2; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReasons() + { + return $this->reasons; + } + + /** + * A list of reasons that explain why the shipment was skipped. See comment + * above `Reason`. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.SkippedShipment.Reason reasons = 3; + * @param array<\Google\Maps\RouteOptimization\V1\SkippedShipment\Reason>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReasons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\SkippedShipment\Reason::class); + $this->reasons = $arr; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php b/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php new file mode 100644 index 000000000000..44b3a0d70662 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment/Reason.php @@ -0,0 +1,179 @@ +google.maps.routeoptimization.v1.SkippedShipment.Reason + */ +class Reason extends \Google\Protobuf\Internal\Message +{ + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + */ + protected $code = 0; + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + */ + protected $example_vehicle_index = null; + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + */ + protected $example_exceeded_capacity_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Refer to the comments of Code. + * @type int $example_vehicle_index + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * @type string $example_exceeded_capacity_type + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Refer to the comments of Code. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.SkippedShipment.Reason.Code code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\SkippedShipment\Reason\Code::class); + $this->code = $var; + + return $this; + } + + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + * @return int + */ + public function getExampleVehicleIndex() + { + return isset($this->example_vehicle_index) ? $this->example_vehicle_index : 0; + } + + public function hasExampleVehicleIndex() + { + return isset($this->example_vehicle_index); + } + + public function clearExampleVehicleIndex() + { + unset($this->example_vehicle_index); + } + + /** + * If the reason is related to a shipment-vehicle incompatibility, this + * field provides the index of one relevant vehicle. + * + * Generated from protobuf field optional int32 example_vehicle_index = 2; + * @param int $var + * @return $this + */ + public function setExampleVehicleIndex($var) + { + GPBUtil::checkInt32($var); + $this->example_vehicle_index = $var; + + return $this; + } + + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + * @return string + */ + public function getExampleExceededCapacityType() + { + return $this->example_exceeded_capacity_type; + } + + /** + * If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one + * capacity type that is exceeded. + * + * Generated from protobuf field string example_exceeded_capacity_type = 3; + * @param string $var + * @return $this + */ + public function setExampleExceededCapacityType($var) + { + GPBUtil::checkString($var, True); + $this->example_exceeded_capacity_type = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php b/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php new file mode 100644 index 000000000000..de17aa0f87c3 --- /dev/null +++ b/MapsRouteOptimization/src/V1/SkippedShipment/Reason/Code.php @@ -0,0 +1,114 @@ +google.maps.routeoptimization.v1.SkippedShipment.Reason.Code + */ +class Code +{ + /** + * This should never be used. If we are unable to understand why a + * shipment was skipped, we simply return an empty set of reasons. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * There is no vehicle in the model making all shipments infeasible. + * + * Generated from protobuf enum NO_VEHICLE = 1; + */ + const NO_VEHICLE = 1; + /** + * The demand of the shipment exceeds a vehicle's capacity for some + * capacity types, one of which is `example_exceeded_capacity_type`. + * + * Generated from protobuf enum DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + */ + const DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2; + /** + * The minimum distance necessary to perform this shipment, i.e. from + * the vehicle's `start_location` to the shipment's pickup and/or delivery + * locations and to the vehicle's end location exceeds the vehicle's + * `route_distance_limit`. + * Note that for this computation we use the geodesic distances. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3; + /** + * The minimum time necessary to perform this shipment, including travel + * time, wait time and service time exceeds the vehicle's + * `route_duration_limit`. + * Note: travel time is computed in the best-case scenario, namely as + * geodesic distance x 36 m/s (roughly 130 km/hour). + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4; + /** + * Same as above but we only compare minimum travel time and the + * vehicle's `travel_duration_limit`. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5; + /** + * The vehicle cannot perform this shipment in the best-case scenario + * (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time + * computation) if it starts at its earliest start time: the total time + * would make the vehicle end after its latest end time. + * + * Generated from protobuf enum CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + */ + const CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6; + /** + * The `allowed_vehicle_indices` field of the shipment is not empty and + * this vehicle does not belong to it. + * + * Generated from protobuf enum VEHICLE_NOT_ALLOWED = 7; + */ + const VEHICLE_NOT_ALLOWED = 7; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::NO_VEHICLE => 'NO_VEHICLE', + self::DEMAND_EXCEEDS_VEHICLE_CAPACITY => 'DEMAND_EXCEEDS_VEHICLE_CAPACITY', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT', + self::CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS => 'CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS', + self::VEHICLE_NOT_ALLOWED => 'VEHICLE_NOT_ALLOWED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/TimeWindow.php b/MapsRouteOptimization/src/V1/TimeWindow.php new file mode 100644 index 000000000000..84c170884b1c --- /dev/null +++ b/MapsRouteOptimization/src/V1/TimeWindow.php @@ -0,0 +1,388 @@ +google.maps.routeoptimization.v1.TimeWindow + */ +class TimeWindow extends \Google\Protobuf\Internal\Message +{ + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + */ + protected $soft_start_time = null; + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + */ + protected $soft_end_time = null; + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + */ + protected $cost_per_hour_before_soft_start_time = null; + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + */ + protected $cost_per_hour_after_soft_end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * @type \Google\Protobuf\Timestamp $end_time + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * @type \Google\Protobuf\Timestamp $soft_start_time + * The soft start time of the time window. + * @type \Google\Protobuf\Timestamp $soft_end_time + * The soft end time of the time window. + * @type float $cost_per_hour_before_soft_start_time + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * @type float $cost_per_hour_after_soft_end_time + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The hard time window start time. If unspecified it will be set to + * `ShipmentModel.global_start_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The hard time window end time. If unspecified it will be set to + * `ShipmentModel.global_end_time`. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSoftStartTime() + { + return $this->soft_start_time; + } + + public function hasSoftStartTime() + { + return isset($this->soft_start_time); + } + + public function clearSoftStartTime() + { + unset($this->soft_start_time); + } + + /** + * The soft start time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSoftStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->soft_start_time = $var; + + return $this; + } + + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSoftEndTime() + { + return $this->soft_end_time; + } + + public function hasSoftEndTime() + { + return isset($this->soft_end_time); + } + + public function clearSoftEndTime() + { + unset($this->soft_end_time); + } + + /** + * The soft end time of the time window. + * + * Generated from protobuf field .google.protobuf.Timestamp soft_end_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSoftEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->soft_end_time = $var; + + return $this; + } + + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + * @return float + */ + public function getCostPerHourBeforeSoftStartTime() + { + return isset($this->cost_per_hour_before_soft_start_time) ? $this->cost_per_hour_before_soft_start_time : 0.0; + } + + public function hasCostPerHourBeforeSoftStartTime() + { + return isset($this->cost_per_hour_before_soft_start_time); + } + + public function clearCostPerHourBeforeSoftStartTime() + { + unset($this->cost_per_hour_before_soft_start_time); + } + + /** + * A cost per hour added to other costs in the model if the event occurs + * before soft_start_time, computed as: + * ``` + * max(0, soft_start_time - t.seconds) + * * cost_per_hour_before_soft_start_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * soft_start_time has been set. + * + * Generated from protobuf field optional double cost_per_hour_before_soft_start_time = 5; + * @param float $var + * @return $this + */ + public function setCostPerHourBeforeSoftStartTime($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_before_soft_start_time = $var; + + return $this; + } + + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + * @return float + */ + public function getCostPerHourAfterSoftEndTime() + { + return isset($this->cost_per_hour_after_soft_end_time) ? $this->cost_per_hour_after_soft_end_time : 0.0; + } + + public function hasCostPerHourAfterSoftEndTime() + { + return isset($this->cost_per_hour_after_soft_end_time); + } + + public function clearCostPerHourAfterSoftEndTime() + { + unset($this->cost_per_hour_after_soft_end_time); + } + + /** + * A cost per hour added to other costs in the model if the event occurs after + * `soft_end_time`, computed as: + * ``` + * max(0, t.seconds - soft_end_time.seconds) + * * cost_per_hour_after_soft_end_time / 3600, + * t being the time of the event. + * ``` + * This cost must be positive, and the field can only be set if + * `soft_end_time` has been set. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_end_time = 6; + * @param float $var + * @return $this + */ + public function setCostPerHourAfterSoftEndTime($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_after_soft_end_time = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/TransitionAttributes.php b/MapsRouteOptimization/src/V1/TransitionAttributes.php new file mode 100644 index 000000000000..6201a4c661d7 --- /dev/null +++ b/MapsRouteOptimization/src/V1/TransitionAttributes.php @@ -0,0 +1,412 @@ +google.maps.routeoptimization.v1.TransitionAttributes + */ +class TransitionAttributes extends \Google\Protobuf\Internal\Message +{ + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + */ + protected $src_tag = ''; + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + */ + protected $excluded_src_tag = ''; + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + */ + protected $dst_tag = ''; + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + */ + protected $excluded_dst_tag = ''; + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + */ + protected $cost = 0.0; + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + */ + protected $cost_per_kilometer = 0.0; + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + */ + protected $distance_limit = null; + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + */ + protected $delay = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $src_tag + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * @type string $excluded_src_tag + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * @type string $dst_tag + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * @type string $excluded_dst_tag + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * @type float $cost + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * @type float $cost_per_kilometer + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * @type \Google\Maps\RouteOptimization\V1\DistanceLimit $distance_limit + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * @type \Google\Protobuf\Duration $delay + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + * @return string + */ + public function getSrcTag() + { + return $this->src_tag; + } + + /** + * Tags defining the set of (src->dst) transitions these attributes apply to. + * A source visit or vehicle start matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or + * [Vehicle.start_tags][google.maps.routeoptimization.v1.Vehicle.start_tags] + * either contains `src_tag` or does not contain `excluded_src_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string src_tag = 1; + * @param string $var + * @return $this + */ + public function setSrcTag($var) + { + GPBUtil::checkString($var, True); + $this->src_tag = $var; + + return $this; + } + + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + * @return string + */ + public function getExcludedSrcTag() + { + return $this->excluded_src_tag; + } + + /** + * See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_src_tag = 2; + * @param string $var + * @return $this + */ + public function setExcludedSrcTag($var) + { + GPBUtil::checkString($var, True); + $this->excluded_src_tag = $var; + + return $this; + } + + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + * @return string + */ + public function getDstTag() + { + return $this->dst_tag; + } + + /** + * A destination visit or vehicle end matches iff its + * [VisitRequest.tags][google.maps.routeoptimization.v1.Shipment.VisitRequest.tags] + * or [Vehicle.end_tags][google.maps.routeoptimization.v1.Vehicle.end_tags] + * either contains `dst_tag` or does not contain `excluded_dst_tag` (depending + * on which of these two fields is non-empty). + * + * Generated from protobuf field string dst_tag = 3; + * @param string $var + * @return $this + */ + public function setDstTag($var) + { + GPBUtil::checkString($var, True); + $this->dst_tag = $var; + + return $this; + } + + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + * @return string + */ + public function getExcludedDstTag() + { + return $this->excluded_dst_tag; + } + + /** + * See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be + * non-empty. + * + * Generated from protobuf field string excluded_dst_tag = 4; + * @param string $var + * @return $this + */ + public function setExcludedDstTag($var) + { + GPBUtil::checkString($var, True); + $this->excluded_dst_tag = $var; + + return $this; + } + + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + * @return float + */ + public function getCost() + { + return $this->cost; + } + + /** + * Specifies a cost for performing this transition. This is in the same unit + * as all other costs in the model and must not be negative. It is applied on + * top of all other existing costs. + * + * Generated from protobuf field double cost = 5; + * @param float $var + * @return $this + */ + public function setCost($var) + { + GPBUtil::checkDouble($var); + $this->cost = $var; + + return $this; + } + + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + * @return float + */ + public function getCostPerKilometer() + { + return $this->cost_per_kilometer; + } + + /** + * Specifies a cost per kilometer applied to the distance traveled while + * performing this transition. It adds up to any + * [Vehicle.cost_per_kilometer][google.maps.routeoptimization.v1.Vehicle.cost_per_kilometer] + * specified on vehicles. + * + * Generated from protobuf field double cost_per_kilometer = 6; + * @param float $var + * @return $this + */ + public function setCostPerKilometer($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer = $var; + + return $this; + } + + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * @return \Google\Maps\RouteOptimization\V1\DistanceLimit|null + */ + public function getDistanceLimit() + { + return $this->distance_limit; + } + + public function hasDistanceLimit() + { + return isset($this->distance_limit); + } + + public function clearDistanceLimit() + { + unset($this->distance_limit); + } + + /** + * Specifies a limit on the distance traveled while performing this + * transition. + * As of 2021/06, only soft limits are supported. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit distance_limit = 7; + * @param \Google\Maps\RouteOptimization\V1\DistanceLimit $var + * @return $this + */ + public function setDistanceLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\DistanceLimit::class); + $this->distance_limit = $var; + + return $this; + } + + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getDelay() + { + return $this->delay; + } + + public function hasDelay() + { + return isset($this->delay); + } + + public function clearDelay() + { + unset($this->delay); + } + + /** + * Specifies a delay incurred when performing this transition. + * This delay always occurs *after* finishing the source visit and *before* + * starting the destination visit. + * + * Generated from protobuf field .google.protobuf.Duration delay = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->delay = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Vehicle.php b/MapsRouteOptimization/src/V1/Vehicle.php new file mode 100644 index 000000000000..03fa94cd8170 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle.php @@ -0,0 +1,1375 @@ +google.maps.routeoptimization.v1.Vehicle + */ +class Vehicle extends \Google\Protobuf\Internal\Message +{ + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + */ + protected $display_name = ''; + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + */ + protected $travel_mode = 0; + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + */ + protected $start_location = null; + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + */ + protected $start_waypoint = null; + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + */ + protected $end_location = null; + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + */ + protected $end_waypoint = null; + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + */ + private $start_tags; + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + */ + private $end_tags; + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + */ + private $start_time_windows; + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + */ + private $end_time_windows; + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + */ + protected $travel_duration_multiple = null; + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + */ + protected $unloading_policy = 0; + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + */ + private $load_limits; + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + */ + protected $cost_per_hour = 0.0; + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + */ + protected $cost_per_traveled_hour = 0.0; + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + */ + protected $cost_per_kilometer = 0.0; + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + */ + protected $fixed_cost = 0.0; + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + */ + protected $used_if_route_is_empty = false; + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + */ + protected $route_duration_limit = null; + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + */ + protected $travel_duration_limit = null; + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + */ + protected $route_distance_limit = null; + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + */ + private $extra_visit_duration_for_visit_type; + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + */ + protected $break_rule = null; + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + */ + protected $label = ''; + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + */ + protected $ignore = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * @type int $travel_mode + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * @type \Google\Type\LatLng $start_location + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $start_waypoint + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * @type \Google\Type\LatLng $end_location + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * @type \Google\Maps\RouteOptimization\V1\Waypoint $end_waypoint + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * @type array|\Google\Protobuf\Internal\RepeatedField $start_tags + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * @type array|\Google\Protobuf\Internal\RepeatedField $end_tags + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $start_time_windows + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * @type array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $end_time_windows + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * @type float $travel_duration_multiple + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * @type int $unloading_policy + * Unloading policy enforced on the vehicle. + * @type array|\Google\Protobuf\Internal\MapField $load_limits + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * @type float $cost_per_hour + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * @type float $cost_per_traveled_hour + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * @type float $cost_per_kilometer + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * @type float $fixed_cost + * Fixed cost applied if this vehicle is used to handle a shipment. + * @type bool $used_if_route_is_empty + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $route_duration_limit + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $travel_duration_limit + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * @type \Google\Maps\RouteOptimization\V1\DistanceLimit $route_distance_limit + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * @type array|\Google\Protobuf\Internal\MapField $extra_visit_duration_for_visit_type + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * @type \Google\Maps\RouteOptimization\V1\BreakRule $break_rule + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * @type string $label + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * @type bool $ignore + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The user-defined display name of the vehicle. + * It can be up to 63 characters long and may use UTF-8 characters. + * + * Generated from protobuf field string display_name = 32; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * @return int + */ + public function getTravelMode() + { + return $this->travel_mode; + } + + /** + * The travel mode which affects the roads usable by the vehicle and its + * speed. See also `travel_duration_multiple`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.TravelMode travel_mode = 1; + * @param int $var + * @return $this + */ + public function setTravelMode($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\Vehicle\TravelMode::class); + $this->travel_mode = $var; + + return $this; + } + + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + * @return \Google\Type\LatLng|null + */ + public function getStartLocation() + { + return $this->start_location; + } + + public function hasStartLocation() + { + return isset($this->start_location); + } + + public function clearStartLocation() + { + unset($this->start_location); + } + + /** + * Geographic location where the vehicle starts before picking up any + * shipments. If not specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng start_location = 3; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setStartLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->start_location = $var; + + return $this; + } + + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getStartWaypoint() + { + return $this->start_waypoint; + } + + public function hasStartWaypoint() + { + return isset($this->start_waypoint); + } + + public function clearStartWaypoint() + { + unset($this->start_waypoint); + } + + /** + * Waypoint representing a geographic location where the vehicle starts before + * picking up any shipments. If neither `start_waypoint` nor `start_location` + * is specified, the vehicle starts at its first pickup. + * If the shipment model has duration and distance matrices, `start_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint start_waypoint = 4; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setStartWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->start_waypoint = $var; + + return $this; + } + + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + * @return \Google\Type\LatLng|null + */ + public function getEndLocation() + { + return $this->end_location; + } + + public function hasEndLocation() + { + return isset($this->end_location); + } + + public function clearEndLocation() + { + unset($this->end_location); + } + + /** + * Geographic location where the vehicle ends after it has completed its last + * `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends + * immediately when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_location` + * must not be specified. + * + * Generated from protobuf field .google.type.LatLng end_location = 5; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setEndLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->end_location = $var; + + return $this; + } + + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * @return \Google\Maps\RouteOptimization\V1\Waypoint|null + */ + public function getEndWaypoint() + { + return $this->end_waypoint; + } + + public function hasEndWaypoint() + { + return isset($this->end_waypoint); + } + + public function clearEndWaypoint() + { + unset($this->end_waypoint); + } + + /** + * Waypoint representing a geographic location where the vehicle ends after + * it has completed its last `VisitRequest`. If neither `end_waypoint` nor + * `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately + * when it completes its last `VisitRequest`. + * If the shipment model has duration and distance matrices, `end_waypoint` + * must not be specified. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Waypoint end_waypoint = 6; + * @param \Google\Maps\RouteOptimization\V1\Waypoint $var + * @return $this + */ + public function setEndWaypoint($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Waypoint::class); + $this->end_waypoint = $var; + + return $this; + } + + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTags() + { + return $this->start_tags; + } + + /** + * Specifies tags attached to the start of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string start_tags = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->start_tags = $arr; + + return $this; + } + + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndTags() + { + return $this->end_tags; + } + + /** + * Specifies tags attached to the end of the vehicle's route. + * Empty or duplicate strings are not allowed. + * + * Generated from protobuf field repeated string end_tags = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->end_tags = $arr; + + return $this; + } + + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStartTimeWindows() + { + return $this->start_time_windows; + } + + /** + * Time windows during which the vehicle may depart its start location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow start_time_windows = 9; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStartTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->start_time_windows = $arr; + + return $this; + } + + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndTimeWindows() + { + return $this->end_time_windows; + } + + /** + * Time windows during which the vehicle may arrive at its end location. + * They must be within the global time limits (see + * [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] + * fields). If unspecified, there is no limitation besides those global time + * limits. + * Time windows belonging to the same repeated field must be disjoint, i.e. no + * time window can overlap with or be adjacent to another, and they must be in + * chronological order. + * `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if + * there is a single time window. + * + * Generated from protobuf field repeated .google.maps.routeoptimization.v1.TimeWindow end_time_windows = 10; + * @param array<\Google\Maps\RouteOptimization\V1\TimeWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndTimeWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\TimeWindow::class); + $this->end_time_windows = $arr; + + return $this; + } + + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + * @return float + */ + public function getTravelDurationMultiple() + { + return isset($this->travel_duration_multiple) ? $this->travel_duration_multiple : 0.0; + } + + public function hasTravelDurationMultiple() + { + return isset($this->travel_duration_multiple); + } + + public function clearTravelDurationMultiple() + { + unset($this->travel_duration_multiple); + } + + /** + * Specifies a multiplicative factor that can be used to increase or decrease + * travel times of this vehicle. For example, setting this to 2.0 means + * that this vehicle is slower and has travel times that are twice what they + * are for standard vehicles. This multiple does not affect visit durations. + * It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are + * specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle + * is standard, and this multiple is considered 1.0. + * WARNING: Travel times will be rounded to the nearest second after this + * multiple is applied but before performing any numerical operations, thus, + * a small multiple may result in a loss of precision. + * See also `extra_visit_duration_for_visit_type` below. + * + * Generated from protobuf field optional double travel_duration_multiple = 11; + * @param float $var + * @return $this + */ + public function setTravelDurationMultiple($var) + { + GPBUtil::checkDouble($var); + $this->travel_duration_multiple = $var; + + return $this; + } + + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * @return int + */ + public function getUnloadingPolicy() + { + return $this->unloading_policy; + } + + /** + * Unloading policy enforced on the vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy unloading_policy = 12; + * @param int $var + * @return $this + */ + public function setUnloadingPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Maps\RouteOptimization\V1\Vehicle\UnloadingPolicy::class); + $this->unloading_policy = $var; + + return $this; + } + + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLoadLimits() + { + return $this->load_limits; + } + + /** + * Capacities of the vehicle (weight, volume, # of pallets for example). + * The keys in the map are the identifiers of the type of load, consistent + * with the keys of the + * [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] + * field. If a given key is absent from this map, the corresponding capacity + * is considered to be limitless. + * + * Generated from protobuf field map load_limits = 30; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLoadLimits($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit::class); + $this->load_limits = $arr; + + return $this; + } + + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + * @return float + */ + public function getCostPerHour() + { + return $this->cost_per_hour; + } + + /** + * Vehicle costs: all costs add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * Cost per hour of the vehicle route. This cost is applied to the total time + * taken by the route, and includes travel time, waiting time, and visit time. + * Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result + * in additional latency. + * + * Generated from protobuf field double cost_per_hour = 16; + * @param float $var + * @return $this + */ + public function setCostPerHour($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour = $var; + + return $this; + } + + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + * @return float + */ + public function getCostPerTraveledHour() + { + return $this->cost_per_traveled_hour; + } + + /** + * Cost per traveled hour of the vehicle route. This cost is applied only to + * travel time taken by the route (i.e., that reported in + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), + * and excludes waiting time and visit time. + * + * Generated from protobuf field double cost_per_traveled_hour = 17; + * @param float $var + * @return $this + */ + public function setCostPerTraveledHour($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_traveled_hour = $var; + + return $this; + } + + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + * @return float + */ + public function getCostPerKilometer() + { + return $this->cost_per_kilometer; + } + + /** + * Cost per kilometer of the vehicle route. This cost is applied to the + * distance reported in the + * [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] + * and does not apply to any distance implicitly traveled from the + * `arrival_location` to the `departure_location` of a single `VisitRequest`. + * + * Generated from protobuf field double cost_per_kilometer = 18; + * @param float $var + * @return $this + */ + public function setCostPerKilometer($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_kilometer = $var; + + return $this; + } + + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + * @return float + */ + public function getFixedCost() + { + return $this->fixed_cost; + } + + /** + * Fixed cost applied if this vehicle is used to handle a shipment. + * + * Generated from protobuf field double fixed_cost = 19; + * @param float $var + * @return $this + */ + public function setFixedCost($var) + { + GPBUtil::checkDouble($var); + $this->fixed_cost = $var; + + return $this; + } + + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + * @return bool + */ + public function getUsedIfRouteIsEmpty() + { + return $this->used_if_route_is_empty; + } + + /** + * This field only applies to vehicles when their route does not serve any + * shipments. It indicates if the vehicle should be considered as used or not + * in this case. + * If true, the vehicle goes from its start to its end location even if it + * doesn't serve any shipments, and time and distance costs resulting from its + * start --> end travel are taken into account. + * Otherwise, it doesn't travel from its start to its end location, and no + * `break_rule` or delay (from `TransitionAttributes`) are scheduled for this + * vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any + * information except for the vehicle index and label. + * + * Generated from protobuf field bool used_if_route_is_empty = 20; + * @param bool $var + * @return $this + */ + public function setUsedIfRouteIsEmpty($var) + { + GPBUtil::checkBool($var); + $this->used_if_route_is_empty = $var; + + return $this; + } + + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit|null + */ + public function getRouteDurationLimit() + { + return $this->route_duration_limit; + } + + public function hasRouteDurationLimit() + { + return isset($this->route_duration_limit); + } + + public function clearRouteDurationLimit() + { + unset($this->route_duration_limit); + } + + /** + * Limit applied to the total duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route duration of a vehicle is the + * difference between its `vehicle_end_time` and `vehicle_start_time`. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit route_duration_limit = 21; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $var + * @return $this + */ + public function setRouteDurationLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit::class); + $this->route_duration_limit = $var; + + return $this; + } + + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit|null + */ + public function getTravelDurationLimit() + { + return $this->travel_duration_limit; + } + + public function hasTravelDurationLimit() + { + return isset($this->travel_duration_limit); + } + + public function clearTravelDurationLimit() + { + unset($this->travel_duration_limit); + } + + /** + * Limit applied to the travel duration of the vehicle's route. In a given + * `OptimizeToursResponse`, the route travel duration is the sum of all its + * [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.DurationLimit travel_duration_limit = 22; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit $var + * @return $this + */ + public function setTravelDurationLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\DurationLimit::class); + $this->travel_duration_limit = $var; + + return $this; + } + + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * @return \Google\Maps\RouteOptimization\V1\DistanceLimit|null + */ + public function getRouteDistanceLimit() + { + return $this->route_distance_limit; + } + + public function hasRouteDistanceLimit() + { + return isset($this->route_distance_limit); + } + + public function clearRouteDistanceLimit() + { + unset($this->route_distance_limit); + } + + /** + * Limit applied to the total distance of the vehicle's route. In a given + * `OptimizeToursResponse`, the route distance is the sum of all its + * [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters]. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.DistanceLimit route_distance_limit = 23; + * @param \Google\Maps\RouteOptimization\V1\DistanceLimit $var + * @return $this + */ + public function setRouteDistanceLimit($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\DistanceLimit::class); + $this->route_distance_limit = $var; + + return $this; + } + + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExtraVisitDurationForVisitType() + { + return $this->extra_visit_duration_for_visit_type; + } + + /** + * Specifies a map from visit_types strings to durations. The duration is time + * in addition to + * [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] + * to be taken at visits with the specified `visit_types`. This extra visit + * duration adds cost if `cost_per_hour` is specified. Keys (i.e. + * `visit_types`) cannot be empty strings. + * If a visit request has multiple types, a duration will be added for each + * type in the map. + * + * Generated from protobuf field map extra_visit_duration_for_visit_type = 24; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExtraVisitDurationForVisitType($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Duration::class); + $this->extra_visit_duration_for_visit_type = $arr; + + return $this; + } + + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * @return \Google\Maps\RouteOptimization\V1\BreakRule|null + */ + public function getBreakRule() + { + return $this->break_rule; + } + + public function hasBreakRule() + { + return isset($this->break_rule); + } + + public function clearBreakRule() + { + unset($this->break_rule); + } + + /** + * Describes the break schedule to be enforced on this vehicle. + * If empty, no breaks will be scheduled for this vehicle. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.BreakRule break_rule = 25; + * @param \Google\Maps\RouteOptimization\V1\BreakRule $var + * @return $this + */ + public function setBreakRule($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\BreakRule::class); + $this->break_rule = $var; + + return $this; + } + + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Specifies a label for this vehicle. This label is reported in the response + * as the `vehicle_label` of the corresponding + * [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]. + * + * Generated from protobuf field string label = 27; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + * @return bool + */ + public function getIgnore() + { + return $this->ignore; + } + + /** + * If true, `used_if_route_is_empty` must be false, and this vehicle will + * remain unused. + * If a shipment is performed by an ignored vehicle in + * `injected_first_solution_routes`, it is skipped in the first solution but + * is free to be performed in the response. + * If a shipment is performed by an ignored vehicle in + * `injected_solution_constraint` and any related pickup/delivery is + * constrained to remain on the vehicle (i.e., not relaxed to level + * `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. + * If a shipment has a non-empty `allowed_vehicle_indices` field and all of + * the allowed vehicles are ignored, it is skipped in the response. + * + * Generated from protobuf field bool ignore = 28; + * @param bool $var + * @return $this + */ + public function setIgnore($var) + { + GPBUtil::checkBool($var); + $this->ignore = $var; + + return $this; + } + +} + diff --git a/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php b/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php new file mode 100644 index 000000000000..08869c7751a9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/DurationLimit.php @@ -0,0 +1,357 @@ +google.maps.routeoptimization.v1.Vehicle.DurationLimit + */ +class DurationLimit extends \Google\Protobuf\Internal\Message +{ + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + */ + protected $max_duration = null; + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + */ + protected $soft_max_duration = null; + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + */ + protected $cost_per_hour_after_soft_max = null; + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + */ + protected $quadratic_soft_max_duration = null; + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + */ + protected $cost_per_square_hour_after_quadratic_soft_max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $max_duration + * A hard limit constraining the duration to be at most max_duration. + * @type \Google\Protobuf\Duration $soft_max_duration + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * @type float $cost_per_hour_after_soft_max + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * @type \Google\Protobuf\Duration $quadratic_soft_max_duration + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * @type float $cost_per_square_hour_after_quadratic_soft_max + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxDuration() + { + return $this->max_duration; + } + + public function hasMaxDuration() + { + return isset($this->max_duration); + } + + public function clearMaxDuration() + { + unset($this->max_duration); + } + + /** + * A hard limit constraining the duration to be at most max_duration. + * + * Generated from protobuf field .google.protobuf.Duration max_duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_duration = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getSoftMaxDuration() + { + return $this->soft_max_duration; + } + + public function hasSoftMaxDuration() + { + return isset($this->soft_max_duration); + } + + public function clearSoftMaxDuration() + { + unset($this->soft_max_duration); + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost. This cost adds up to other costs defined in + * the model, with the same unit. + * If defined, `soft_max_duration` must be nonnegative. If max_duration is + * also defined, `soft_max_duration` must be less than max_duration. + * + * Generated from protobuf field .google.protobuf.Duration soft_max_duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSoftMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->soft_max_duration = $var; + + return $this; + } + + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + * @return float + */ + public function getCostPerHourAfterSoftMax() + { + return isset($this->cost_per_hour_after_soft_max) ? $this->cost_per_hour_after_soft_max : 0.0; + } + + public function hasCostPerHourAfterSoftMax() + { + return isset($this->cost_per_hour_after_soft_max); + } + + public function clearCostPerHourAfterSoftMax() + { + unset($this->cost_per_hour_after_soft_max); + } + + /** + * Cost per hour incurred if the `soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_hour_after_soft_max * (duration - soft_max_duration) + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_hour_after_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerHourAfterSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_hour_after_soft_max = $var; + + return $this; + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getQuadraticSoftMaxDuration() + { + return $this->quadratic_soft_max_duration; + } + + public function hasQuadraticSoftMaxDuration() + { + return isset($this->quadratic_soft_max_duration); + } + + public function clearQuadraticSoftMaxDuration() + { + unset($this->quadratic_soft_max_duration); + } + + /** + * A soft limit not enforcing a maximum duration limit, but when violated + * makes the route incur a cost, quadratic in the duration. This cost adds + * up to other costs defined in the model, with the same unit. + * If defined, `quadratic_soft_max_duration` must be nonnegative. If + * `max_duration` is also defined, `quadratic_soft_max_duration` must be + * less than `max_duration`, and the difference must be no larger than one + * day: + * `max_duration - quadratic_soft_max_duration <= 86400 seconds` + * + * Generated from protobuf field .google.protobuf.Duration quadratic_soft_max_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setQuadraticSoftMaxDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->quadratic_soft_max_duration = $var; + + return $this; + } + + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * @return float + */ + public function getCostPerSquareHourAfterQuadraticSoftMax() + { + return isset($this->cost_per_square_hour_after_quadratic_soft_max) ? $this->cost_per_square_hour_after_quadratic_soft_max : 0.0; + } + + public function hasCostPerSquareHourAfterQuadraticSoftMax() + { + return isset($this->cost_per_square_hour_after_quadratic_soft_max); + } + + public function clearCostPerSquareHourAfterQuadraticSoftMax() + { + unset($this->cost_per_square_hour_after_quadratic_soft_max); + } + + /** + * Cost per square hour incurred if the + * `quadratic_soft_max_duration` threshold is violated. + * The additional cost is 0 if the duration is under the threshold, + * otherwise the cost depends on the duration as follows: + * ``` + * cost_per_square_hour_after_quadratic_soft_max * + * (duration - quadratic_soft_max_duration)^2 + * ``` + * The cost must be nonnegative. + * + * Generated from protobuf field optional double cost_per_square_hour_after_quadratic_soft_max = 5; + * @param float $var + * @return $this + */ + public function setCostPerSquareHourAfterQuadraticSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_square_hour_after_quadratic_soft_max = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php new file mode 100644 index 000000000000..f52604927f98 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit.php @@ -0,0 +1,268 @@ +google.maps.routeoptimization.v1.Vehicle.LoadLimit + */ +class LoadLimit extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + */ + protected $max_load = null; + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + */ + protected $soft_max_load = 0; + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + */ + protected $cost_per_unit_above_soft_max = 0.0; + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + */ + protected $start_load_interval = null; + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + */ + protected $end_load_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $max_load + * The maximum acceptable amount of load. + * @type int|string $soft_max_load + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * @type float $cost_per_unit_above_soft_max + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $start_load_interval + * The acceptable load interval of the vehicle at the start of the route. + * @type \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $end_load_interval + * The acceptable load interval of the vehicle at the end of the route. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + * @return int|string + */ + public function getMaxLoad() + { + return isset($this->max_load) ? $this->max_load : 0; + } + + public function hasMaxLoad() + { + return isset($this->max_load); + } + + public function clearMaxLoad() + { + unset($this->max_load); + } + + /** + * The maximum acceptable amount of load. + * + * Generated from protobuf field optional int64 max_load = 1; + * @param int|string $var + * @return $this + */ + public function setMaxLoad($var) + { + GPBUtil::checkInt64($var); + $this->max_load = $var; + + return $this; + } + + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + * @return int|string + */ + public function getSoftMaxLoad() + { + return $this->soft_max_load; + } + + /** + * A soft limit of the load. See + * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. + * + * Generated from protobuf field int64 soft_max_load = 2; + * @param int|string $var + * @return $this + */ + public function setSoftMaxLoad($var) + { + GPBUtil::checkInt64($var); + $this->soft_max_load = $var; + + return $this; + } + + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + * @return float + */ + public function getCostPerUnitAboveSoftMax() + { + return $this->cost_per_unit_above_soft_max; + } + + /** + * If the load ever exceeds + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load] + * along this vehicle's route, the following cost penalty applies (only once + * per vehicle): (load - + * [soft_max_load][google.maps.routeoptimization.v1.Vehicle.LoadLimit.soft_max_load]) + * * [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs + * add up and must be in the same unit as + * [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + * + * Generated from protobuf field double cost_per_unit_above_soft_max = 3; + * @param float $var + * @return $this + */ + public function setCostPerUnitAboveSoftMax($var) + { + GPBUtil::checkDouble($var); + $this->cost_per_unit_above_soft_max = $var; + + return $this; + } + + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval|null + */ + public function getStartLoadInterval() + { + return $this->start_load_interval; + } + + public function hasStartLoadInterval() + { + return isset($this->start_load_interval); + } + + public function clearStartLoadInterval() + { + unset($this->start_load_interval); + } + + /** + * The acceptable load interval of the vehicle at the start of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval start_load_interval = 4; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var + * @return $this + */ + public function setStartLoadInterval($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval::class); + $this->start_load_interval = $var; + + return $this; + } + + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * @return \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval|null + */ + public function getEndLoadInterval() + { + return $this->end_load_interval; + } + + public function hasEndLoadInterval() + { + return isset($this->end_load_interval); + } + + public function clearEndLoadInterval() + { + unset($this->end_load_interval); + } + + /** + * The acceptable load interval of the vehicle at the end of the route. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval end_load_interval = 5; + * @param \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval $var + * @return $this + */ + public function setEndLoadInterval($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Vehicle\LoadLimit\Interval::class); + $this->end_load_interval = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php new file mode 100644 index 000000000000..274435df50d9 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/LoadLimit/Interval.php @@ -0,0 +1,148 @@ +google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval + */ +class Interval extends \Google\Protobuf\Internal\Message +{ + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + */ + protected $min = 0; + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + */ + protected $max = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $min + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * @type int|string $max + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + * @return int|string + */ + public function getMin() + { + return $this->min; + } + + /** + * A minimum acceptable load. Must be ≥ 0. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field int64 min = 1; + * @param int|string $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkInt64($var); + $this->min = $var; + + return $this; + } + + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + * @return int|string + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum + * load is unrestricted by this message. + * If they're both specified, + * [min][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.min] + * must be ≤ + * [max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.Interval.max]. + * + * Generated from protobuf field optional int64 max = 2; + * @param int|string $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkInt64($var); + $this->max = $var; + + return $this; + } + +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php b/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php new file mode 100644 index 000000000000..12f4ff7dd0cb --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/TravelMode.php @@ -0,0 +1,65 @@ +google.maps.routeoptimization.v1.Vehicle.TravelMode + */ +class TravelMode +{ + /** + * Unspecified travel mode, equivalent to `DRIVING`. + * + * Generated from protobuf enum TRAVEL_MODE_UNSPECIFIED = 0; + */ + const TRAVEL_MODE_UNSPECIFIED = 0; + /** + * Travel mode corresponding to driving directions (car, ...). + * + * Generated from protobuf enum DRIVING = 1; + */ + const DRIVING = 1; + /** + * Travel mode corresponding to walking directions. + * + * Generated from protobuf enum WALKING = 2; + */ + const WALKING = 2; + + private static $valueToName = [ + self::TRAVEL_MODE_UNSPECIFIED => 'TRAVEL_MODE_UNSPECIFIED', + self::DRIVING => 'DRIVING', + self::WALKING => 'WALKING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php b/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php new file mode 100644 index 000000000000..463afa6b0065 --- /dev/null +++ b/MapsRouteOptimization/src/V1/Vehicle/UnloadingPolicy.php @@ -0,0 +1,66 @@ +google.maps.routeoptimization.v1.Vehicle.UnloadingPolicy + */ +class UnloadingPolicy +{ + /** + * Unspecified unloading policy; deliveries must just occur after their + * corresponding pickups. + * + * Generated from protobuf enum UNLOADING_POLICY_UNSPECIFIED = 0; + */ + const UNLOADING_POLICY_UNSPECIFIED = 0; + /** + * Deliveries must occur in reverse order of pickups + * + * Generated from protobuf enum LAST_IN_FIRST_OUT = 1; + */ + const LAST_IN_FIRST_OUT = 1; + /** + * Deliveries must occur in the same order as pickups + * + * Generated from protobuf enum FIRST_IN_FIRST_OUT = 2; + */ + const FIRST_IN_FIRST_OUT = 2; + + private static $valueToName = [ + self::UNLOADING_POLICY_UNSPECIFIED => 'UNLOADING_POLICY_UNSPECIFIED', + self::LAST_IN_FIRST_OUT => 'LAST_IN_FIRST_OUT', + self::FIRST_IN_FIRST_OUT => 'FIRST_IN_FIRST_OUT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/MapsRouteOptimization/src/V1/Waypoint.php b/MapsRouteOptimization/src/V1/Waypoint.php new file mode 100644 index 000000000000..b691d5167b2b --- /dev/null +++ b/MapsRouteOptimization/src/V1/Waypoint.php @@ -0,0 +1,166 @@ +google.maps.routeoptimization.v1.Waypoint + */ +class Waypoint extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $side_of_road = false; + protected $location_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Maps\RouteOptimization\V1\Location $location + * A point specified using geographic coordinates, including an optional + * heading. + * @type string $place_id + * The POI Place ID associated with the waypoint. + * @type bool $side_of_road + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Maps\Routeoptimization\V1\RouteOptimizationService::initOnce(); + parent::__construct($data); + } + + /** + * A point specified using geographic coordinates, including an optional + * heading. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Location location = 1; + * @return \Google\Maps\RouteOptimization\V1\Location|null + */ + public function getLocation() + { + return $this->readOneof(1); + } + + public function hasLocation() + { + return $this->hasOneof(1); + } + + /** + * A point specified using geographic coordinates, including an optional + * heading. + * + * Generated from protobuf field .google.maps.routeoptimization.v1.Location location = 1; + * @param \Google\Maps\RouteOptimization\V1\Location $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Maps\RouteOptimization\V1\Location::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The POI Place ID associated with the waypoint. + * + * Generated from protobuf field string place_id = 2; + * @return string + */ + public function getPlaceId() + { + return $this->readOneof(2); + } + + public function hasPlaceId() + { + return $this->hasOneof(2); + } + + /** + * The POI Place ID associated with the waypoint. + * + * Generated from protobuf field string place_id = 2; + * @param string $var + * @return $this + */ + public function setPlaceId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSideOfRoad() + { + return $this->side_of_road; + } + + /** + * Optional. Indicates that the location of this waypoint is meant to have a + * preference for the vehicle to stop at a particular side of road. When you + * set this value, the route will pass through the location so that the + * vehicle can stop at the side of road that the location is biased towards + * from the center of the road. This option doesn't work for the 'WALKING' + * travel mode. + * + * Generated from protobuf field bool side_of_road = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSideOfRoad($var) + { + GPBUtil::checkBool($var); + $this->side_of_road = $var; + + return $this; + } + + /** + * @return string + */ + public function getLocationType() + { + return $this->whichOneof("location_type"); + } + +} + diff --git a/MapsRouteOptimization/src/V1/gapic_metadata.json b/MapsRouteOptimization/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..71f5ea3e4f9b --- /dev/null +++ b/MapsRouteOptimization/src/V1/gapic_metadata.json @@ -0,0 +1,28 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.maps.routeoptimization.v1", + "libraryPackage": "Google\\Maps\\RouteOptimization\\V1", + "services": { + "RouteOptimization": { + "clients": { + "grpc": { + "libraryClient": "RouteOptimizationGapicClient", + "rpcs": { + "BatchOptimizeTours": { + "methods": [ + "batchOptimizeTours" + ] + }, + "OptimizeTours": { + "methods": [ + "optimizeTours" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json b/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json new file mode 100644 index 000000000000..0e5122e35b74 --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.maps.routeoptimization.v1.RouteOptimization": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 3600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 + } + }, + "methods": { + "BatchOptimizeTours": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "OptimizeTours": { + "timeout_millis": 3600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php b/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php new file mode 100644 index 000000000000..0e8b84155c48 --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_descriptor_config.php @@ -0,0 +1,59 @@ + [ + 'google.maps.routeoptimization.v1.RouteOptimization' => [ + 'BatchOptimizeTours' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Maps\RouteOptimization\V1\BatchOptimizeToursResponse', + 'metadataReturnType' => '\Google\Maps\RouteOptimization\V1\BatchOptimizeToursMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'OptimizeTours' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Maps\RouteOptimization\V1\OptimizeToursResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + ], + ], +]; diff --git a/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php b/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php new file mode 100644 index 000000000000..5087b38b87fd --- /dev/null +++ b/MapsRouteOptimization/src/V1/resources/route_optimization_rest_client_config.php @@ -0,0 +1,80 @@ + [ + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.maps.routeoptimization.v1.RouteOptimization' => [ + 'BatchOptimizeTours' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:batchOptimizeTours', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}:batchOptimizeTours', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'OptimizeTours' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:optimizeTours', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}:optimizeTours', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php b/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php new file mode 100644 index 000000000000..7dc0ad01af34 --- /dev/null +++ b/MapsRouteOptimization/tests/Unit/V1/Client/RouteOptimizationClientTest.php @@ -0,0 +1,327 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return RouteOptimizationClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RouteOptimizationClient($options); + } + + /** @test */ + public function batchOptimizeToursTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchOptimizeToursResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchOptimizeToursTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeTours($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getModelConfigs(); + $this->assertProtobufEquals($modelConfigs, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchOptimizeToursExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeTours($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function optimizeToursTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $requestLabel = 'requestLabel1739091268'; + $expectedResponse = new OptimizeToursResponse(); + $expectedResponse->setRequestLabel($requestLabel); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new OptimizeToursRequest())->setParent($parent); + $response = $gapicClient->optimizeTours($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/OptimizeTours', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function optimizeToursExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new OptimizeToursRequest())->setParent($parent); + try { + $gapicClient->optimizeTours($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchOptimizeToursAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchOptimizeToursTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchOptimizeToursResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchOptimizeToursTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $modelConfigs = []; + $request = (new BatchOptimizeToursRequest())->setParent($parent)->setModelConfigs($modelConfigs); + $response = $gapicClient->batchOptimizeToursAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.maps.routeoptimization.v1.RouteOptimization/BatchOptimizeTours', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getModelConfigs(); + $this->assertProtobufEquals($modelConfigs, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchOptimizeToursTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/composer.json b/composer.json index 352f405e1166..9d5186720d9c 100644 --- a/composer.json +++ b/composer.json @@ -247,6 +247,7 @@ "google/longrunning": "0.4.3", "google/maps-fleetengine": "0.1.2", "google/maps-fleetengine-delivery": "0.1.1", + "google/maps-routeoptimization": "0.0.0", "google/shopping-common-protos": "0.4.0", "google/shopping-css": "0.2.7", "google/shopping-merchant-conversions": "0.1.2", @@ -435,6 +436,7 @@ "GPBMetadata\\Google\\Longrunning\\": "LongRunning/metadata/Longrunning", "GPBMetadata\\Google\\Maps\\Fleetengine\\": "MapsFleetEngine/metadata", "GPBMetadata\\Google\\Maps\\Fleetengine\\Delivery\\": "MapsFleetEngineDelivery/metadata", + "GPBMetadata\\Google\\Maps\\Routeoptimization\\": "MapsRouteOptimization/metadata", "GPBMetadata\\Google\\Monitoring\\": "Monitoring/metadata", "GPBMetadata\\Google\\Privacy\\Dlp\\": "Dlp/metadata", "GPBMetadata\\Google\\Pubsub\\": "PubSub/metadata", @@ -632,6 +634,7 @@ "Google\\LongRunning\\": "LongRunning/src/LongRunning", "Google\\Maps\\FleetEngine\\": "MapsFleetEngine/src", "Google\\Maps\\FleetEngine\\Delivery\\": "MapsFleetEngineDelivery/src", + "Google\\Maps\\RouteOptimization\\": "MapsRouteOptimization/src", "Google\\Shopping\\Css\\": "ShoppingCss/src", "Google\\Shopping\\Merchant\\Conversions\\": "ShoppingMerchantConversions/src", "Google\\Shopping\\Merchant\\Inventories\\": "ShoppingMerchantInventories/src", From 3408cff9989738dece741d1aafb8130de69c5e3a Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 6 Jun 2024 12:46:28 -0700 Subject: [PATCH 2/2] revert newline in repo-metadata-full --- .repo-metadata-full.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 54939bcc2786..9304fe9ed673 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -1480,4 +1480,4 @@ "library_type": "GAPIC_AUTO", "api_shortname": "workflows" } -} \ No newline at end of file +}