/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the location-2020-11-19.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.LocationService.Model
{
///
/// Container for the parameters to the CalculateRoute operation.
/// Calculates
/// a route given the following required parameters: DeparturePosition
/// and DestinationPosition
. Requires that you first create
/// a route calculator resource.
///
///
///
/// By default, a request that doesn't specify a departure time uses the best time of
/// day to travel with the best traffic conditions when calculating the route.
///
///
///
/// Additional options include:
///
/// -
///
/// Specifying
/// a departure time using either
DepartureTime
or DepartNow
.
/// This calculates a route based on predictive traffic data at the given time.
///
///
///
/// You can't specify both DepartureTime
and DepartNow
in a
/// single request. Specifying both parameters returns a validation error.
///
/// -
///
/// Specifying
/// a travel mode using TravelMode sets the transportation mode used to calculate
/// the routes. This also lets you specify additional route preferences in
CarModeOptions
/// if traveling by Car
, or TruckModeOptions
if traveling by
/// Truck
.
///
///
///
/// If you specify walking
for the travel mode and your data provider is
/// Esri, the start and destination must be within 40km.
///
///
///
public partial class CalculateRouteRequest : AmazonLocationServiceRequest
{
private string _calculatorName;
private CalculateRouteCarModeOptions _carModeOptions;
private bool? _departNow;
private List _departurePosition = new List();
private DateTime? _departureTime;
private List _destinationPosition = new List();
private DistanceUnit _distanceUnit;
private bool? _includeLegGeometry;
private string _key;
private TravelMode _travelMode;
private CalculateRouteTruckModeOptions _truckModeOptions;
private List> _waypointPositions = new List>();
///
/// Gets and sets the property CalculatorName.
///
/// The name of the route calculator resource that you want to use to calculate the route.
///
///
///
[AWSProperty(Required=true, Min=1, Max=100)]
public string CalculatorName
{
get { return this._calculatorName; }
set { this._calculatorName = value; }
}
// Check to see if CalculatorName property is set
internal bool IsSetCalculatorName()
{
return this._calculatorName != null;
}
///
/// Gets and sets the property 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 CalculateRouteCarModeOptions CarModeOptions
{
get { return this._carModeOptions; }
set { this._carModeOptions = value; }
}
// Check to see if CarModeOptions property is set
internal bool IsSetCarModeOptions()
{
return this._carModeOptions != null;
}
///
/// Gets and sets the property DepartNow.
///
/// Sets the time of departure as the current time. Uses the current time to calculate
/// a route. Otherwise, the best time of day to travel with the best traffic conditions
/// is used to calculate the route.
///
///
///
/// Default Value: false
///
///
///
/// Valid Values: false
| true
///
///
public bool DepartNow
{
get { return this._departNow.GetValueOrDefault(); }
set { this._departNow = value; }
}
// Check to see if DepartNow property is set
internal bool IsSetDepartNow()
{
return this._departNow.HasValue;
}
///
/// Gets and sets the property DeparturePosition.
///
/// The start position for the route. Defined in World
/// Geodetic System (WGS 84) format: [longitude, latitude]
.
///
/// -
///
/// For example,
[-123.115, 49.285]
///
///
///
/// If you specify a departure that's not located on a road, Amazon Location moves
/// the position to the nearest road. If Esri is the provider for your route calculator,
/// specifying a route that is longer than 400 km returns a 400 RoutesValidationException
/// error.
///
///
///
/// Valid Values: [-180 to 180,-90 to 90]
///
///
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=2)]
public List DeparturePosition
{
get { return this._departurePosition; }
set { this._departurePosition = value; }
}
// Check to see if DeparturePosition property is set
internal bool IsSetDeparturePosition()
{
return this._departurePosition != null && this._departurePosition.Count > 0;
}
///
/// Gets and sets the property DepartureTime.
///
/// Specifies the desired time of departure. Uses the given time to calculate the route.
/// Otherwise, the best time of day to travel with the best traffic conditions is used
/// to calculate the route.
///
///
///
/// Setting a departure time in the past returns a 400 ValidationException
/// error.
///
/// -
///
/// In ISO 8601 format:
///
YYYY-MM-DDThh:mm:ss.sssZ
. For example, 2020–07-2T12:15:20.000Z+01:00
///
///
///
///
public DateTime DepartureTime
{
get { return this._departureTime.GetValueOrDefault(); }
set { this._departureTime = value; }
}
// Check to see if DepartureTime property is set
internal bool IsSetDepartureTime()
{
return this._departureTime.HasValue;
}
///
/// Gets and sets the property DestinationPosition.
///
/// The finish position for the route. Defined in World
/// Geodetic System (WGS 84) format: [longitude, latitude]
.
///
/// -
///
/// For example,
[-122.339, 47.615]
///
///
///
/// If you specify a destination that's not located on a road, Amazon Location moves
/// the position to the nearest road.
///
///
///
/// Valid Values: [-180 to 180,-90 to 90]
///
///
[AWSProperty(Required=true, Sensitive=true, Min=2, Max=2)]
public List DestinationPosition
{
get { return this._destinationPosition; }
set { this._destinationPosition = value; }
}
// Check to see if DestinationPosition property is set
internal bool IsSetDestinationPosition()
{
return this._destinationPosition != null && this._destinationPosition.Count > 0;
}
///
/// Gets and sets the property DistanceUnit.
///
/// Set the unit system to specify the distance.
///
///
///
/// Default Value: Kilometers
///
///
public DistanceUnit DistanceUnit
{
get { return this._distanceUnit; }
set { this._distanceUnit = value; }
}
// Check to see if DistanceUnit property is set
internal bool IsSetDistanceUnit()
{
return this._distanceUnit != null;
}
///
/// Gets and sets the property IncludeLegGeometry.
///
/// Set to include the geometry details in the result for each path between a pair of
/// positions.
///
///
///
/// Default Value: false
///
///
///
/// Valid Values: false
| true
///
///
public bool IncludeLegGeometry
{
get { return this._includeLegGeometry.GetValueOrDefault(); }
set { this._includeLegGeometry = value; }
}
// Check to see if IncludeLegGeometry property is set
internal bool IsSetIncludeLegGeometry()
{
return this._includeLegGeometry.HasValue;
}
///
/// Gets and sets the property Key.
///
/// The optional API
/// key to authorize the request.
///
///
[AWSProperty(Sensitive=true, Min=0, Max=1000)]
public string Key
{
get { return this._key; }
set { this._key = value; }
}
// Check to see if Key property is set
internal bool IsSetKey()
{
return this._key != null;
}
///
/// Gets and sets the property TravelMode.
///
/// Specifies the mode of transport when calculating a route. Used in estimating the speed
/// of travel and road compatibility. You can choose Car
, Truck
,
/// Walking
, Bicycle
or Motorcycle
as options for
/// the TravelMode
.
///
///
///
/// Bicycle
and Motorcycle
are only valid when using Grab as
/// a data provider, and only within Southeast Asia.
///
///
///
/// Truck
is not available for Grab.
///
///
///
/// For more details on the using Grab for routing, including areas of coverage, see GrabMaps
/// in the Amazon Location Service Developer Guide.
///
///
///
/// The TravelMode
you specify also determines how you specify route preferences:
///
///
/// -
///
/// If traveling by
Car
use the CarModeOptions
parameter.
///
/// -
///
/// If traveling by
Truck
use the TruckModeOptions
parameter.
///
///
///
/// Default Value: Car
///
///
public TravelMode TravelMode
{
get { return this._travelMode; }
set { this._travelMode = value; }
}
// Check to see if TravelMode property is set
internal bool IsSetTravelMode()
{
return this._travelMode != null;
}
///
/// Gets and sets the property TruckModeOptions.
///
/// 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
.
///
///
public CalculateRouteTruckModeOptions TruckModeOptions
{
get { return this._truckModeOptions; }
set { this._truckModeOptions = value; }
}
// Check to see if TruckModeOptions property is set
internal bool IsSetTruckModeOptions()
{
return this._truckModeOptions != null;
}
///
/// Gets and sets the property WaypointPositions.
///
/// Specifies an ordered list of up to 23 intermediate positions to include along a route
/// between the departure position and destination position.
///
/// -
///
/// For example, from the
DeparturePosition
[-123.115, 49.285]
,
/// the route follows the order that the waypoint positions are given [[-122.757,
/// 49.0021],[-122.349, 47.620]]
///
///
///
/// If you specify a waypoint position that's not located on a road, Amazon Location moves
/// the position to the nearest road.
///
///
///
/// Specifying more than 23 waypoints returns a 400 ValidationException
error.
///
///
///
/// If Esri is the provider for your route calculator, specifying a route that is longer
/// than 400 km returns a 400 RoutesValidationException
error.
///
///
///
/// Valid Values: [-180 to 180,-90 to 90]
///
///
[AWSProperty(Min=0, Max=23)]
public List> WaypointPositions
{
get { return this._waypointPositions; }
set { this._waypointPositions = value; }
}
// Check to see if WaypointPositions property is set
internal bool IsSetWaypointPositions()
{
return this._waypointPositions != null && this._waypointPositions.Count > 0;
}
}
}