aws_sdk_location/client/calculate_route_matrix.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CalculateRouteMatrix`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`calculator_name(impl Into<String>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::calculator_name) / [`set_calculator_name(Option<String>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_calculator_name):<br>required: **true**<br><p>The name of the route calculator resource that you want to use to calculate the route matrix.</p><br>
7 /// - [`departure_positions(Vec::<f64>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::departure_positions) / [`set_departure_positions(Option<Vec::<Vec::<f64>>>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_departure_positions):<br>required: **true**<br><p>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 <a href="https://earth-info.nga.mil/GandG/wgs84/index.html">WGS 84</a> format: <code>\[longitude, latitude\]</code>. For example, <code>\[-123.115, 49.285\]</code>.</p><important> <p>Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See <a href="https://docs.aws.amazon.com/location/previous/developerguide/calculate-route-matrix.html#matrix-routing-position-limits"> Position restrictions</a> in the <i>Amazon Location Service Developer Guide</i>.</p> </important> <note> <p>For route calculators that use Esri as the data provider, if you specify a departure that's not located on a road, Amazon Location <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html"> moves the position to the nearest road</a>. The snapped value is available in the result in <code>SnappedDeparturePositions</code>.</p> </note> <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p><br>
8 /// - [`destination_positions(Vec::<f64>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::destination_positions) / [`set_destination_positions(Option<Vec::<Vec::<f64>>>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_destination_positions):<br>required: **true**<br><p>The list of destination positions for the route matrix. An array of points, each of which is itself a 2-value array defined in <a href="https://earth-info.nga.mil/GandG/wgs84/index.html">WGS 84</a> format: <code>\[longitude, latitude\]</code>. For example, <code>\[-122.339, 47.615\]</code></p><important> <p>Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See <a href="https://docs.aws.amazon.com/location/previous/developerguide/calculate-route-matrix.html#matrix-routing-position-limits"> Position restrictions</a> in the <i>Amazon Location Service Developer Guide</i>.</p> </important> <note> <p>For route calculators that use Esri as the data provider, if you specify a destination that's not located on a road, Amazon Location <a href="https://docs.aws.amazon.com/location/previous/developerguide/snap-to-nearby-road.html"> moves the position to the nearest road</a>. The snapped value is available in the result in <code>SnappedDestinationPositions</code>.</p> </note> <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p><br>
9 /// - [`travel_mode(TravelMode)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::travel_mode) / [`set_travel_mode(Option<TravelMode>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_travel_mode):<br>required: **false**<br><p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p> <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p> <ul> <li> <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li> <li> <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li> </ul><note> <p><code>Bicycle</code> or <code>Motorcycle</code> are only valid when using <code>Grab</code> as a data provider, and only within Southeast Asia.</p> <p><code>Truck</code> is not available for Grab.</p> <p>For more information about using Grab as a data provider, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a> in the <i>Amazon Location Service Developer Guide</i>.</p> </note> <p>Default Value: <code>Car</code></p><br>
10 /// - [`departure_time(DateTime)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::departure_time) / [`set_departure_time(Option<DateTime>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_departure_time):<br>required: **false**<br><p>Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both <code>DepartureTime</code> and <code>DepartNow</code>. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.</p><note> <p>Setting a departure time in the past returns a <code>400 ValidationException</code> error.</p> </note> <ul> <li> <p>In <a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. For example, <code>2020–07-2T12:15:20.000Z+01:00</code></p></li> </ul><br>
11 /// - [`depart_now(bool)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::depart_now) / [`set_depart_now(Option<bool>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_depart_now):<br>required: **false**<br><p>Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't set both <code>DepartureTime</code> and <code>DepartNow</code>. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.</p> <p>Default Value: <code>false</code></p> <p>Valid Values: <code>false</code> | <code>true</code></p><br>
12 /// - [`distance_unit(DistanceUnit)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::distance_unit) / [`set_distance_unit(Option<DistanceUnit>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_distance_unit):<br>required: **false**<br><p>Set the unit system to specify the distance.</p> <p>Default Value: <code>Kilometers</code></p><br>
13 /// - [`car_mode_options(CalculateRouteCarModeOptions)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::car_mode_options) / [`set_car_mode_options(Option<CalculateRouteCarModeOptions>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_car_mode_options):<br>required: **false**<br><p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p> <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p><br>
14 /// - [`truck_mode_options(CalculateRouteTruckModeOptions)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::truck_mode_options) / [`set_truck_mode_options(Option<CalculateRouteTruckModeOptions>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_truck_mode_options):<br>required: **false**<br><p>Specifies route preferences when traveling by <code>Truck</code>, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.</p> <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p><br>
15 /// - [`key(impl Into<String>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::key) / [`set_key(Option<String>)`](crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::set_key):<br>required: **false**<br><p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p><br>
16 /// - On success, responds with [`CalculateRouteMatrixOutput`](crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput) with field(s):
17 /// - [`route_matrix(Vec::<Vec::<RouteMatrixEntry>>)`](crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput::route_matrix): <p>The calculated route matrix containing the results for all pairs of <code>DeparturePositions</code> to <code>DestinationPositions</code>. Each row corresponds to one entry in <code>DeparturePositions</code>. Each entry in the row corresponds to the route from that entry in <code>DeparturePositions</code> to an entry in <code>DestinationPositions</code>.</p>
18 /// - [`snapped_departure_positions(Option<Vec::<Vec::<f64>>>)`](crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput::snapped_departure_positions): <p>For routes calculated using an Esri route calculator resource, departure positions are snapped to the closest road. For Esri route calculator resources, this returns the list of departure/origin positions used for calculation of the <code>RouteMatrix</code>.</p>
19 /// - [`snapped_destination_positions(Option<Vec::<Vec::<f64>>>)`](crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput::snapped_destination_positions): <p>The list of destination positions for the route matrix used for calculation of the <code>RouteMatrix</code>.</p>
20 /// - [`summary(Option<CalculateRouteMatrixSummary>)`](crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput::summary): <p>Contains information about the route matrix, <code>DataSource</code>, <code>DistanceUnit</code>, <code>RouteCount</code> and <code>ErrorCount</code>.</p>
21 /// - On failure, responds with [`SdkError<CalculateRouteMatrixError>`](crate::operation::calculate_route_matrix::CalculateRouteMatrixError)
22 pub fn calculate_route_matrix(&self) -> crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder {
23 crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixFluentBuilder::new(self.handle.clone())
24 }
25}