aws_sdk_location/operation/calculate_route/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::calculate_route::_calculate_route_output::CalculateRouteOutputBuilder;
3
4pub use crate::operation::calculate_route::_calculate_route_input::CalculateRouteInputBuilder;
5
6impl crate::operation::calculate_route::builders::CalculateRouteInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::calculate_route::CalculateRouteOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::calculate_route::CalculateRouteError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.calculate_route();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CalculateRoute`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to <a href="/location/latest/APIReference/API_CalculateRoutes.html"> <code>CalculateRoutes</code> </a> or <a href="/location/latest/APIReference/API_CalculateIsolines.html"> <code>CalculateIsolines</code> </a> unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p><code>CalculateRoute</code> is part of a previous Amazon Location Service Routes API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The version 2 <code>CalculateRoutes</code> operation gives better results for point-to-point routing, while the version 2 <code>CalculateIsolines</code> operation adds support for calculating service areas and travel time envelopes.</p></li>
32/// <li>
33/// <p>If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Routes API version 2 is found under <code>geo-routes</code> or <code>geo_routes</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since Grab is not yet fully supported in Routes API version 2, we recommend you continue using API version 1 when using Grab.</p></li>
36/// </ul>
37/// </important>
38/// <p><a href="https://docs.aws.amazon.com/location/previous/developerguide/calculate-route.html">Calculates a route</a> given the following required parameters: <code>DeparturePosition</code> and <code>DestinationPosition</code>. Requires that you first <a href="https://docs.aws.amazon.com/location-routes/latest/APIReference/API_CreateRouteCalculator.html">create a route calculator resource</a>.</p>
39/// <p>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.</p>
40/// <p>Additional options include:</p>
41/// <ul>
42/// <li>
43/// <p><a href="https://docs.aws.amazon.com/location/previous/developerguide/departure-time.html">Specifying a departure time</a> using either <code>DepartureTime</code> or <code>DepartNow</code>. This calculates a route based on predictive traffic data at the given time.</p><note>
44/// <p>You can't specify both <code>DepartureTime</code> and <code>DepartNow</code> in a single request. Specifying both parameters returns a validation error.</p>
45/// </note></li>
46/// <li>
47/// <p><a href="https://docs.aws.amazon.com/location/previous/developerguide/travel-mode.html">Specifying a travel mode</a> using TravelMode sets the transportation mode used to calculate the routes. This also lets you specify additional route preferences in <code>CarModeOptions</code> if traveling by <code>Car</code>, or <code>TruckModeOptions</code> if traveling by <code>Truck</code>.</p><note>
48/// <p>If you specify <code>walking</code> for the travel mode and your data provider is Esri, the start and destination must be within 40km.</p>
49/// </note></li>
50/// </ul>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct CalculateRouteFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::calculate_route::builders::CalculateRouteInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::calculate_route::CalculateRouteOutput,
60        crate::operation::calculate_route::CalculateRouteError,
61    > for CalculateRouteFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::calculate_route::CalculateRouteOutput,
69            crate::operation::calculate_route::CalculateRouteError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl CalculateRouteFluentBuilder {
76    /// Creates a new `CalculateRouteFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the CalculateRoute as a reference.
85    pub fn as_input(&self) -> &crate::operation::calculate_route::builders::CalculateRouteInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::calculate_route::CalculateRouteOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::calculate_route::CalculateRouteError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::calculate_route::CalculateRoute::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::calculate_route::CalculateRoute::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::calculate_route::CalculateRouteOutput,
122        crate::operation::calculate_route::CalculateRouteError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
137    pub fn calculator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.calculator_name(input.into());
139        self
140    }
141    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
142    pub fn set_calculator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_calculator_name(input);
144        self
145    }
146    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
147    pub fn get_calculator_name(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_calculator_name()
149    }
150    ///
151    /// Appends an item to `DeparturePosition`.
152    ///
153    /// To override the contents of this collection use [`set_departure_position`](Self::set_departure_position).
154    ///
155    /// <p>The start position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
156    /// <ul>
157    /// <li>
158    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
159    /// </ul><note>
160    /// <p>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>. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
161    /// </note>
162    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
163    pub fn departure_position(mut self, input: f64) -> Self {
164        self.inner = self.inner.departure_position(input);
165        self
166    }
167    /// <p>The start position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
168    /// <ul>
169    /// <li>
170    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
171    /// </ul><note>
172    /// <p>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>. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
173    /// </note>
174    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
175    pub fn set_departure_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
176        self.inner = self.inner.set_departure_position(input);
177        self
178    }
179    /// <p>The start position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
180    /// <ul>
181    /// <li>
182    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
183    /// </ul><note>
184    /// <p>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>. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
185    /// </note>
186    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
187    pub fn get_departure_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
188        self.inner.get_departure_position()
189    }
190    ///
191    /// Appends an item to `DestinationPosition`.
192    ///
193    /// To override the contents of this collection use [`set_destination_position`](Self::set_destination_position).
194    ///
195    /// <p>The finish position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
196    /// <ul>
197    /// <li>
198    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
199    /// </ul><note>
200    /// <p>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>.</p>
201    /// </note>
202    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
203    pub fn destination_position(mut self, input: f64) -> Self {
204        self.inner = self.inner.destination_position(input);
205        self
206    }
207    /// <p>The finish position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
208    /// <ul>
209    /// <li>
210    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
211    /// </ul><note>
212    /// <p>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>.</p>
213    /// </note>
214    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
215    pub fn set_destination_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
216        self.inner = self.inner.set_destination_position(input);
217        self
218    }
219    /// <p>The finish position for the route. Defined in <a href="https://earth-info.nga.mil/index.php?dir=wgs84&amp;action=wgs84">World Geodetic System (WGS 84)</a> format: <code>\[longitude, latitude\]</code>.</p>
220    /// <ul>
221    /// <li>
222    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
223    /// </ul><note>
224    /// <p>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>.</p>
225    /// </note>
226    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
227    pub fn get_destination_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
228        self.inner.get_destination_position()
229    }
230    ///
231    /// Appends an item to `WaypointPositions`.
232    ///
233    /// To override the contents of this collection use [`set_waypoint_positions`](Self::set_waypoint_positions).
234    ///
235    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
236    /// <ul>
237    /// <li>
238    /// <p>For example, from the <code>DeparturePosition</code> <code>\[-123.115, 49.285\]</code>, the route follows the order that the waypoint positions are given <code>\[\[-122.757, 49.0021\],\[-122.349, 47.620\]\]</code></p></li>
239    /// </ul><note>
240    /// <p>If you specify a waypoint position 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>.</p>
241    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
242    /// <p>If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
243    /// </note>
244    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
245    pub fn waypoint_positions(mut self, input: ::std::vec::Vec<f64>) -> Self {
246        self.inner = self.inner.waypoint_positions(input);
247        self
248    }
249    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
250    /// <ul>
251    /// <li>
252    /// <p>For example, from the <code>DeparturePosition</code> <code>\[-123.115, 49.285\]</code>, the route follows the order that the waypoint positions are given <code>\[\[-122.757, 49.0021\],\[-122.349, 47.620\]\]</code></p></li>
253    /// </ul><note>
254    /// <p>If you specify a waypoint position 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>.</p>
255    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
256    /// <p>If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
257    /// </note>
258    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
259    pub fn set_waypoint_positions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>) -> Self {
260        self.inner = self.inner.set_waypoint_positions(input);
261        self
262    }
263    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
264    /// <ul>
265    /// <li>
266    /// <p>For example, from the <code>DeparturePosition</code> <code>\[-123.115, 49.285\]</code>, the route follows the order that the waypoint positions are given <code>\[\[-122.757, 49.0021\],\[-122.349, 47.620\]\]</code></p></li>
267    /// </ul><note>
268    /// <p>If you specify a waypoint position 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>.</p>
269    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
270    /// <p>If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a <code>400 RoutesValidationException</code> error.</p>
271    /// </note>
272    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
273    pub fn get_waypoint_positions(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>> {
274        self.inner.get_waypoint_positions()
275    }
276    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose <code>Car</code>, <code>Truck</code>, <code>Walking</code>, <code>Bicycle</code> or <code>Motorcycle</code> as options for the <code>TravelMode</code>.</p><note>
277    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
278    /// <p><code>Truck</code> is not available for Grab.</p>
279    /// <p>For more details on the using Grab for routing, including areas of coverage, 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>
280    /// </note>
281    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
282    /// <ul>
283    /// <li>
284    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
285    /// <li>
286    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
287    /// </ul>
288    /// <p>Default Value: <code>Car</code></p>
289    pub fn travel_mode(mut self, input: crate::types::TravelMode) -> Self {
290        self.inner = self.inner.travel_mode(input);
291        self
292    }
293    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose <code>Car</code>, <code>Truck</code>, <code>Walking</code>, <code>Bicycle</code> or <code>Motorcycle</code> as options for the <code>TravelMode</code>.</p><note>
294    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
295    /// <p><code>Truck</code> is not available for Grab.</p>
296    /// <p>For more details on the using Grab for routing, including areas of coverage, 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>
297    /// </note>
298    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
299    /// <ul>
300    /// <li>
301    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
302    /// <li>
303    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
304    /// </ul>
305    /// <p>Default Value: <code>Car</code></p>
306    pub fn set_travel_mode(mut self, input: ::std::option::Option<crate::types::TravelMode>) -> Self {
307        self.inner = self.inner.set_travel_mode(input);
308        self
309    }
310    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. You can choose <code>Car</code>, <code>Truck</code>, <code>Walking</code>, <code>Bicycle</code> or <code>Motorcycle</code> as options for the <code>TravelMode</code>.</p><note>
311    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
312    /// <p><code>Truck</code> is not available for Grab.</p>
313    /// <p>For more details on the using Grab for routing, including areas of coverage, 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>
314    /// </note>
315    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
316    /// <ul>
317    /// <li>
318    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
319    /// <li>
320    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
321    /// </ul>
322    /// <p>Default Value: <code>Car</code></p>
323    pub fn get_travel_mode(&self) -> &::std::option::Option<crate::types::TravelMode> {
324        self.inner.get_travel_mode()
325    }
326    /// <p>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.</p>
327    /// <ul>
328    /// <li>
329    /// <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>
330    /// </ul>
331    pub fn departure_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
332        self.inner = self.inner.departure_time(input);
333        self
334    }
335    /// <p>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.</p>
336    /// <ul>
337    /// <li>
338    /// <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>
339    /// </ul>
340    pub fn set_departure_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
341        self.inner = self.inner.set_departure_time(input);
342        self
343    }
344    /// <p>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.</p>
345    /// <ul>
346    /// <li>
347    /// <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>
348    /// </ul>
349    pub fn get_departure_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
350        self.inner.get_departure_time()
351    }
352    /// <p>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.</p>
353    /// <p>Default Value: <code>false</code></p>
354    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
355    pub fn depart_now(mut self, input: bool) -> Self {
356        self.inner = self.inner.depart_now(input);
357        self
358    }
359    /// <p>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.</p>
360    /// <p>Default Value: <code>false</code></p>
361    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
362    pub fn set_depart_now(mut self, input: ::std::option::Option<bool>) -> Self {
363        self.inner = self.inner.set_depart_now(input);
364        self
365    }
366    /// <p>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.</p>
367    /// <p>Default Value: <code>false</code></p>
368    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
369    pub fn get_depart_now(&self) -> &::std::option::Option<bool> {
370        self.inner.get_depart_now()
371    }
372    /// <p>Set the unit system to specify the distance.</p>
373    /// <p>Default Value: <code>Kilometers</code></p>
374    pub fn distance_unit(mut self, input: crate::types::DistanceUnit) -> Self {
375        self.inner = self.inner.distance_unit(input);
376        self
377    }
378    /// <p>Set the unit system to specify the distance.</p>
379    /// <p>Default Value: <code>Kilometers</code></p>
380    pub fn set_distance_unit(mut self, input: ::std::option::Option<crate::types::DistanceUnit>) -> Self {
381        self.inner = self.inner.set_distance_unit(input);
382        self
383    }
384    /// <p>Set the unit system to specify the distance.</p>
385    /// <p>Default Value: <code>Kilometers</code></p>
386    pub fn get_distance_unit(&self) -> &::std::option::Option<crate::types::DistanceUnit> {
387        self.inner.get_distance_unit()
388    }
389    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
390    /// <p>Default Value: <code>false</code></p>
391    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
392    pub fn include_leg_geometry(mut self, input: bool) -> Self {
393        self.inner = self.inner.include_leg_geometry(input);
394        self
395    }
396    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
397    /// <p>Default Value: <code>false</code></p>
398    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
399    pub fn set_include_leg_geometry(mut self, input: ::std::option::Option<bool>) -> Self {
400        self.inner = self.inner.set_include_leg_geometry(input);
401        self
402    }
403    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
404    /// <p>Default Value: <code>false</code></p>
405    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
406    pub fn get_include_leg_geometry(&self) -> &::std::option::Option<bool> {
407        self.inner.get_include_leg_geometry()
408    }
409    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
410    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
411    pub fn car_mode_options(mut self, input: crate::types::CalculateRouteCarModeOptions) -> Self {
412        self.inner = self.inner.car_mode_options(input);
413        self
414    }
415    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
416    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
417    pub fn set_car_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteCarModeOptions>) -> Self {
418        self.inner = self.inner.set_car_mode_options(input);
419        self
420    }
421    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
422    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
423    pub fn get_car_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteCarModeOptions> {
424        self.inner.get_car_mode_options()
425    }
426    /// <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>
427    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
428    pub fn truck_mode_options(mut self, input: crate::types::CalculateRouteTruckModeOptions) -> Self {
429        self.inner = self.inner.truck_mode_options(input);
430        self
431    }
432    /// <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>
433    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
434    pub fn set_truck_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteTruckModeOptions>) -> Self {
435        self.inner = self.inner.set_truck_mode_options(input);
436        self
437    }
438    /// <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>
439    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
440    pub fn get_truck_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteTruckModeOptions> {
441        self.inner.get_truck_mode_options()
442    }
443    /// <p>Specifies the desired time of arrival. 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.</p><note>
444    /// <p>ArrivalTime is not supported Esri.</p>
445    /// </note>
446    pub fn arrival_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
447        self.inner = self.inner.arrival_time(input);
448        self
449    }
450    /// <p>Specifies the desired time of arrival. 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.</p><note>
451    /// <p>ArrivalTime is not supported Esri.</p>
452    /// </note>
453    pub fn set_arrival_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
454        self.inner = self.inner.set_arrival_time(input);
455        self
456    }
457    /// <p>Specifies the desired time of arrival. 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.</p><note>
458    /// <p>ArrivalTime is not supported Esri.</p>
459    /// </note>
460    pub fn get_arrival_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
461        self.inner.get_arrival_time()
462    }
463    /// <p>Specifies the distance to optimize for when calculating a route.</p>
464    pub fn optimize_for(mut self, input: crate::types::OptimizationMode) -> Self {
465        self.inner = self.inner.optimize_for(input);
466        self
467    }
468    /// <p>Specifies the distance to optimize for when calculating a route.</p>
469    pub fn set_optimize_for(mut self, input: ::std::option::Option<crate::types::OptimizationMode>) -> Self {
470        self.inner = self.inner.set_optimize_for(input);
471        self
472    }
473    /// <p>Specifies the distance to optimize for when calculating a route.</p>
474    pub fn get_optimize_for(&self) -> &::std::option::Option<crate::types::OptimizationMode> {
475        self.inner.get_optimize_for()
476    }
477    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
478    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
479        self.inner = self.inner.key(input.into());
480        self
481    }
482    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
483    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
484        self.inner = self.inner.set_key(input);
485        self
486    }
487    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
488    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
489        self.inner.get_key()
490    }
491}