/* * 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 CalculateRouteMatrix operation. /// /// Calculates a route matrix given the following required parameters: DeparturePositions /// and DestinationPositions. CalculateRouteMatrix calculates /// routes and returns the travel time and travel distance from each departure position /// to each destination position in the request. For example, given departure positions /// A and B, and destination positions X and Y, CalculateRouteMatrix will /// return time and distance for routes from A to X, A to Y, B to X, and B to Y (in that /// order). The number of results returned (and routes calculated) will be the number /// of DeparturePositions times the number of DestinationPositions. /// /// /// /// Your account is charged for each route calculated, not the number of requests. /// /// /// /// 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 routes. /// /// /// /// Additional options include: /// /// /// public partial class CalculateRouteMatrixRequest : AmazonLocationServiceRequest { private string _calculatorName; private CalculateRouteCarModeOptions _carModeOptions; private bool? _departNow; private List> _departurePositions = new List>(); private DateTime? _departureTime; private List> _destinationPositions = new List>(); private DistanceUnit _distanceUnit; private string _key; private TravelMode _travelMode; private CalculateRouteTruckModeOptions _truckModeOptions; /// /// Gets and sets the property CalculatorName. /// /// The name of the route calculator resource that you want to use to calculate the route /// matrix. /// /// [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 /// 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 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 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] /// /// [AWSProperty(Required=true, Min=1, Max=350)] public List> DeparturePositions { get { return this._departurePositions; } set { this._departurePositions = value; } } // Check to see if DeparturePositions property is set internal bool IsSetDeparturePositions() { return this._departurePositions != null && this._departurePositions.Count > 0; } /// /// Gets and sets the property 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. /// ///
  • /// /// 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 DestinationPositions. /// /// 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] /// /// [AWSProperty(Required=true, Min=1, Max=350)] public List> DestinationPositions { get { return this._destinationPositions; } set { this._destinationPositions = value; } } // Check to see if DestinationPositions property is set internal bool IsSetDestinationPositions() { return this._destinationPositions != null && this._destinationPositions.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 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. /// /// /// /// 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. /// ///
/// /// 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 /// ///
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; } } }