/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.location.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CalculateRouteMatrixRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the route calculator resource that you want to use to calculate the route matrix. *

*/ private String calculatorName; /** *

* Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or * tolls. *

*

* Requirements: TravelMode must be specified as Car. *

*/ private CalculateRouteCarModeOptions carModeOptions; /** *

* Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't * set both DepartureTime and DepartNow. If neither is set, the best time of day to travel * with the best traffic conditions is used to calculate the route matrix. *

*

* Default Value: false *

*

* Valid Values: false | true *

*/ private Boolean departNow; /** *

* The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a * 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285]. *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

*/ private java.util.List> departurePositions; /** *

* Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both * DepartureTime and DepartNow. If neither is set, the best time of day to travel with the * best traffic conditions is used to calculate the route matrix. *

* *

* Setting a departure time in the past returns a 400 ValidationException error. *

*
* */ private java.util.Date departureTime; /** *

* The list of destination positions for the route matrix. An array of points, each of which is itself a 2-value * array defined in WGS 84 format: * [longitude, latitude]. For example, [-122.339, 47.615] *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a destination that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDestinationPositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

*/ private java.util.List> destinationPositions; /** *

* Set the unit system to specify the distance. *

*

* Default Value: Kilometers *

*/ private String distanceUnit; /** *

* The optional API key * to authorize the request. *

*/ private String key; /** *

* Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road * compatibility. *

*

* The TravelMode you specify also determines how you specify route preferences: *

* * *

* Bicycle or Motorcycle are only valid when using Grab as a data provider, * and only within Southeast Asia. *

*

* Truck is not available for Grab. *

*

* For more information about using Grab as a data provider, see GrabMaps in the Amazon * Location Service Developer Guide. *

*
*

* Default Value: Car *

*/ private String travelMode; /** *

* Specifies route preferences when traveling by Truck, such as avoiding routes that use ferries or * tolls, and truck specifications to consider when choosing an optimal road. *

*

* Requirements: TravelMode must be specified as Truck. *

*/ private CalculateRouteTruckModeOptions truckModeOptions; /** *

* The name of the route calculator resource that you want to use to calculate the route matrix. *

* * @param calculatorName * The name of the route calculator resource that you want to use to calculate the route matrix. */ public void setCalculatorName(String calculatorName) { this.calculatorName = calculatorName; } /** *

* The name of the route calculator resource that you want to use to calculate the route matrix. *

* * @return The name of the route calculator resource that you want to use to calculate the route matrix. */ public String getCalculatorName() { return this.calculatorName; } /** *

* The name of the route calculator resource that you want to use to calculate the route matrix. *

* * @param calculatorName * The name of the route calculator resource that you want to use to calculate the route matrix. * @return Returns a reference to this object so that method calls can be chained together. */ public CalculateRouteMatrixRequest withCalculatorName(String calculatorName) { setCalculatorName(calculatorName); return this; } /** *

* Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or * tolls. *

*

* Requirements: TravelMode must be specified as Car. *

* * @param carModeOptions * Specifies route preferences when traveling by Car, such as avoiding routes that use ferries * or tolls.

*

* Requirements: TravelMode must be specified as Car. */ public void setCarModeOptions(CalculateRouteCarModeOptions carModeOptions) { this.carModeOptions = carModeOptions; } /** *

* Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or * tolls. *

*

* Requirements: TravelMode must be specified as Car. *

* * @return Specifies route preferences when traveling by Car, such as avoiding routes that use ferries * or tolls.

*

* Requirements: TravelMode must be specified as Car. */ public CalculateRouteCarModeOptions getCarModeOptions() { return this.carModeOptions; } /** *

* Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or * tolls. *

*

* Requirements: TravelMode must be specified as Car. *

* * @param carModeOptions * Specifies route preferences when traveling by Car, such as avoiding routes that use ferries * or tolls.

*

* Requirements: TravelMode must be specified as Car. * @return Returns a reference to this object so that method calls can be chained together. */ public CalculateRouteMatrixRequest withCarModeOptions(CalculateRouteCarModeOptions carModeOptions) { setCarModeOptions(carModeOptions); return this; } /** *

* Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't * set both DepartureTime and DepartNow. If neither is set, the best time of day to travel * with the best traffic conditions is used to calculate the route matrix. *

*

* Default Value: false *

*

* Valid Values: false | true *

* * @param departNow * Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You * can't set both DepartureTime and DepartNow. If neither is set, the best time of * day to travel with the best traffic conditions is used to calculate the route matrix.

*

* Default Value: false *

*

* Valid Values: false | true */ public void setDepartNow(Boolean departNow) { this.departNow = departNow; } /** *

* Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't * set both DepartureTime and DepartNow. If neither is set, the best time of day to travel * with the best traffic conditions is used to calculate the route matrix. *

*

* Default Value: false *

*

* Valid Values: false | true *

* * @return Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You * can't set both DepartureTime and DepartNow. If neither is set, the best time of * day to travel with the best traffic conditions is used to calculate the route matrix.

*

* Default Value: false *

*

* Valid Values: false | true */ public Boolean getDepartNow() { return this.departNow; } /** *

* Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't * set both DepartureTime and DepartNow. If neither is set, the best time of day to travel * with the best traffic conditions is used to calculate the route matrix. *

*

* Default Value: false *

*

* Valid Values: false | true *

* * @param departNow * Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You * can't set both DepartureTime and DepartNow. If neither is set, the best time of * day to travel with the best traffic conditions is used to calculate the route matrix.

*

* Default Value: false *

*

* Valid Values: false | true * @return Returns a reference to this object so that method calls can be chained together. */ public CalculateRouteMatrixRequest withDepartNow(Boolean departNow) { setDepartNow(departNow); return this; } /** *

* Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't * set both DepartureTime and DepartNow. If neither is set, the best time of day to travel * with the best traffic conditions is used to calculate the route matrix. *

*

* Default Value: false *

*

* Valid Values: false | true *

* * @return Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You * can't set both DepartureTime and DepartNow. If neither is set, the best time of * day to travel with the best traffic conditions is used to calculate the route matrix.

*

* Default Value: false *

*

* Valid Values: false | true */ public Boolean isDepartNow() { return this.departNow; } /** *

* The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a * 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285]. *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

* * @return The list of departure (origin) positions for the route matrix. An array of points, each of which is * itself a 2-value array defined in WGS 84 * format: [longitude, latitude]. For example, [-123.115, 49.285].

*

* Depending on the data provider selected in the route calculator resource there may be additional * restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located * on a road, Amazon Location moves the * position to the nearest road. The snapped value is available in the result in * SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] */ public java.util.List> getDeparturePositions() { return departurePositions; } /** *

* The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a * 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285]. *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

* * @param departurePositions * The list of departure (origin) positions for the route matrix. An array of points, each of which is itself * a 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285].

*

* Depending on the data provider selected in the route calculator resource there may be additional * restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on * a road, Amazon Location moves the * position to the nearest road. The snapped value is available in the result in * SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] */ public void setDeparturePositions(java.util.Collection> departurePositions) { if (departurePositions == null) { this.departurePositions = null; return; } this.departurePositions = new java.util.ArrayList>(departurePositions); } /** *

* The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a * 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285]. *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setDeparturePositions(java.util.Collection)} or {@link #withDeparturePositions(java.util.Collection)} if * you want to override the existing values. *

* * @param departurePositions * The list of departure (origin) positions for the route matrix. An array of points, each of which is itself * a 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285].

*

* Depending on the data provider selected in the route calculator resource there may be additional * restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on * a road, Amazon Location moves the * position to the nearest road. The snapped value is available in the result in * SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] * @return Returns a reference to this object so that method calls can be chained together. */ public CalculateRouteMatrixRequest withDeparturePositions(java.util.List... departurePositions) { if (this.departurePositions == null) { setDeparturePositions(new java.util.ArrayList>(departurePositions.length)); } for (java.util.List ele : departurePositions) { this.departurePositions.add(ele); } return this; } /** *

* The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a * 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285]. *

* *

* Depending on the data provider selected in the route calculator resource there may be additional restrictions on * the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on a * road, Amazon Location moves the position to * the nearest road. The snapped value is available in the result in SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] *

* * @param departurePositions * The list of departure (origin) positions for the route matrix. An array of points, each of which is itself * a 2-value array defined in WGS 84 format: * [longitude, latitude]. For example, [-123.115, 49.285].

*

* Depending on the data provider selected in the route calculator resource there may be additional * restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide. *

*
*

* For route calculators that use Esri as the data provider, if you specify a departure that's not located on * a road, Amazon Location moves the * position to the nearest road. The snapped value is available in the result in * SnappedDeparturePositions. *

*
*

* Valid Values: [-180 to 180,-90 to 90] * @return Returns a reference to this object so that method calls can be chained together. */ public CalculateRouteMatrixRequest withDeparturePositions(java.util.Collection> departurePositions) { setDeparturePositions(departurePositions); return this; } /** *

* Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both * DepartureTime and DepartNow. If neither is set, the best time of day to travel with the * best traffic conditions is used to calculate the route matrix. *

* *

* Setting a departure time in the past returns a 400 ValidationException error. *

*
* * * @param departureTime * Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set * both DepartureTime and DepartNow. If neither is set, the best time of day to * travel with the best traffic conditions is used to calculate the route matrix.

*

* Setting a departure time in the past returns a 400 ValidationException error. *

*
*