aws_sdk_location/operation/calculate_route_matrix/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::calculate_route_matrix::_calculate_route_matrix_output::CalculateRouteMatrixOutputBuilder;
3
4pub use crate::operation::calculate_route_matrix::_calculate_route_matrix_input::CalculateRouteMatrixInputBuilder;
5
6impl crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixInputBuilder {
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_matrix::CalculateRouteMatrixOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.calculate_route_matrix();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CalculateRouteMatrix`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the <a href="/location/latest/APIReference/API_CalculateRouteMatrix.html">V2 <code>CalculateRouteMatrix</code> </a> unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p>This version of <code>CalculateRouteMatrix</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>CalculateRouteMatrix</code> operation gives better results for matrix routing calculations.</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/// <li>
37/// <p>Start your version 2 API journey with the Routes V2 <a href="/location/latest/APIReference/API_Operations_Amazon_Location_Service_Routes_V2.html">API Reference</a> or the <a href="/location/latest/developerguide/routes.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p><a href="https://docs.aws.amazon.com/location/previous/developerguide/calculate-route-matrix.html"> Calculates a route matrix</a> given the following required parameters: <code>DeparturePositions</code> and <code>DestinationPositions</code>. <code>CalculateRouteMatrix</code> 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, <code>CalculateRouteMatrix</code> 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 <code>DeparturePositions</code> times the number of <code>DestinationPositions</code>.</p><note>
41/// <p>Your account is charged for each route calculated, not the number of requests.</p>
42/// </note>
43/// <p>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>
44/// <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 routes.</p>
45/// <p>Additional options include:</p>
46/// <ul>
47/// <li>
48/// <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 routes based on predictive traffic data at the given time.</p><note>
49/// <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>
50/// </note></li>
51/// <li>
52/// <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></li>
53/// </ul>
54#[derive(::std::clone::Clone, ::std::fmt::Debug)]
55pub struct CalculateRouteMatrixFluentBuilder {
56    handle: ::std::sync::Arc<crate::client::Handle>,
57    inner: crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixInputBuilder,
58    config_override: ::std::option::Option<crate::config::Builder>,
59}
60impl
61    crate::client::customize::internal::CustomizableSend<
62        crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput,
63        crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
64    > for CalculateRouteMatrixFluentBuilder
65{
66    fn send(
67        self,
68        config_override: crate::config::Builder,
69    ) -> crate::client::customize::internal::BoxFuture<
70        crate::client::customize::internal::SendResult<
71            crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput,
72            crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
73        >,
74    > {
75        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
76    }
77}
78impl CalculateRouteMatrixFluentBuilder {
79    /// Creates a new `CalculateRouteMatrixFluentBuilder`.
80    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
81        Self {
82            handle,
83            inner: ::std::default::Default::default(),
84            config_override: ::std::option::Option::None,
85        }
86    }
87    /// Access the CalculateRouteMatrix as a reference.
88    pub fn as_input(&self) -> &crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixInputBuilder {
89        &self.inner
90    }
91    /// Sends the request and returns the response.
92    ///
93    /// If an error occurs, an `SdkError` will be returned with additional details that
94    /// can be matched against.
95    ///
96    /// By default, any retryable failures will be retried twice. Retry behavior
97    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
98    /// set when configuring the client.
99    pub async fn send(
100        self,
101    ) -> ::std::result::Result<
102        crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput,
103        ::aws_smithy_runtime_api::client::result::SdkError<
104            crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
105            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
106        >,
107    > {
108        let input = self
109            .inner
110            .build()
111            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
112        let runtime_plugins = crate::operation::calculate_route_matrix::CalculateRouteMatrix::operation_runtime_plugins(
113            self.handle.runtime_plugins.clone(),
114            &self.handle.conf,
115            self.config_override,
116        );
117        crate::operation::calculate_route_matrix::CalculateRouteMatrix::orchestrate(&runtime_plugins, input).await
118    }
119
120    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
121    pub fn customize(
122        self,
123    ) -> crate::client::customize::CustomizableOperation<
124        crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput,
125        crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
126        Self,
127    > {
128        crate::client::customize::CustomizableOperation::new(self)
129    }
130    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
131        self.set_config_override(::std::option::Option::Some(config_override.into()));
132        self
133    }
134
135    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
136        self.config_override = config_override;
137        self
138    }
139    /// <p>The name of the route calculator resource that you want to use to calculate the route matrix.</p>
140    pub fn calculator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.calculator_name(input.into());
142        self
143    }
144    /// <p>The name of the route calculator resource that you want to use to calculate the route matrix.</p>
145    pub fn set_calculator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_calculator_name(input);
147        self
148    }
149    /// <p>The name of the route calculator resource that you want to use to calculate the route matrix.</p>
150    pub fn get_calculator_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_calculator_name()
152    }
153    ///
154    /// Appends an item to `DeparturePositions`.
155    ///
156    /// To override the contents of this collection use [`set_departure_positions`](Self::set_departure_positions).
157    ///
158    /// <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>
159    /// <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>
160    /// </important> <note>
161    /// <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>
162    /// </note>
163    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
164    pub fn departure_positions(mut self, input: ::std::vec::Vec<f64>) -> Self {
165        self.inner = self.inner.departure_positions(input);
166        self
167    }
168    /// <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>
169    /// <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>
170    /// </important> <note>
171    /// <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>
172    /// </note>
173    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
174    pub fn set_departure_positions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>) -> Self {
175        self.inner = self.inner.set_departure_positions(input);
176        self
177    }
178    /// <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>
179    /// <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>
180    /// </important> <note>
181    /// <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>
182    /// </note>
183    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
184    pub fn get_departure_positions(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>> {
185        self.inner.get_departure_positions()
186    }
187    ///
188    /// Appends an item to `DestinationPositions`.
189    ///
190    /// To override the contents of this collection use [`set_destination_positions`](Self::set_destination_positions).
191    ///
192    /// <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>
193    /// <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>
194    /// </important> <note>
195    /// <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>
196    /// </note>
197    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
198    pub fn destination_positions(mut self, input: ::std::vec::Vec<f64>) -> Self {
199        self.inner = self.inner.destination_positions(input);
200        self
201    }
202    /// <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>
203    /// <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>
204    /// </important> <note>
205    /// <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>
206    /// </note>
207    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
208    pub fn set_destination_positions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>) -> Self {
209        self.inner = self.inner.set_destination_positions(input);
210        self
211    }
212    /// <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>
213    /// <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>
214    /// </important> <note>
215    /// <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>
216    /// </note>
217    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
218    pub fn get_destination_positions(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>> {
219        self.inner.get_destination_positions()
220    }
221    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
222    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
223    /// <ul>
224    /// <li>
225    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
226    /// <li>
227    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
228    /// </ul><note>
229    /// <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>
230    /// <p><code>Truck</code> is not available for Grab.</p>
231    /// <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>
232    /// </note>
233    /// <p>Default Value: <code>Car</code></p>
234    pub fn travel_mode(mut self, input: crate::types::TravelMode) -> Self {
235        self.inner = self.inner.travel_mode(input);
236        self
237    }
238    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
239    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
240    /// <ul>
241    /// <li>
242    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
243    /// <li>
244    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
245    /// </ul><note>
246    /// <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>
247    /// <p><code>Truck</code> is not available for Grab.</p>
248    /// <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>
249    /// </note>
250    /// <p>Default Value: <code>Car</code></p>
251    pub fn set_travel_mode(mut self, input: ::std::option::Option<crate::types::TravelMode>) -> Self {
252        self.inner = self.inner.set_travel_mode(input);
253        self
254    }
255    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
256    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
257    /// <ul>
258    /// <li>
259    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
260    /// <li>
261    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
262    /// </ul><note>
263    /// <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>
264    /// <p><code>Truck</code> is not available for Grab.</p>
265    /// <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>
266    /// </note>
267    /// <p>Default Value: <code>Car</code></p>
268    pub fn get_travel_mode(&self) -> &::std::option::Option<crate::types::TravelMode> {
269        self.inner.get_travel_mode()
270    }
271    /// <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>
272    /// <p>Setting a departure time in the past returns a <code>400 ValidationException</code> error.</p>
273    /// </note>
274    /// <ul>
275    /// <li>
276    /// <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>
277    /// </ul>
278    pub fn departure_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
279        self.inner = self.inner.departure_time(input);
280        self
281    }
282    /// <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>
283    /// <p>Setting a departure time in the past returns a <code>400 ValidationException</code> error.</p>
284    /// </note>
285    /// <ul>
286    /// <li>
287    /// <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>
288    /// </ul>
289    pub fn set_departure_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
290        self.inner = self.inner.set_departure_time(input);
291        self
292    }
293    /// <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>
294    /// <p>Setting a departure time in the past returns a <code>400 ValidationException</code> error.</p>
295    /// </note>
296    /// <ul>
297    /// <li>
298    /// <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>
299    /// </ul>
300    pub fn get_departure_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
301        self.inner.get_departure_time()
302    }
303    /// <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>
304    /// <p>Default Value: <code>false</code></p>
305    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
306    pub fn depart_now(mut self, input: bool) -> Self {
307        self.inner = self.inner.depart_now(input);
308        self
309    }
310    /// <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>
311    /// <p>Default Value: <code>false</code></p>
312    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
313    pub fn set_depart_now(mut self, input: ::std::option::Option<bool>) -> Self {
314        self.inner = self.inner.set_depart_now(input);
315        self
316    }
317    /// <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>
318    /// <p>Default Value: <code>false</code></p>
319    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
320    pub fn get_depart_now(&self) -> &::std::option::Option<bool> {
321        self.inner.get_depart_now()
322    }
323    /// <p>Set the unit system to specify the distance.</p>
324    /// <p>Default Value: <code>Kilometers</code></p>
325    pub fn distance_unit(mut self, input: crate::types::DistanceUnit) -> Self {
326        self.inner = self.inner.distance_unit(input);
327        self
328    }
329    /// <p>Set the unit system to specify the distance.</p>
330    /// <p>Default Value: <code>Kilometers</code></p>
331    pub fn set_distance_unit(mut self, input: ::std::option::Option<crate::types::DistanceUnit>) -> Self {
332        self.inner = self.inner.set_distance_unit(input);
333        self
334    }
335    /// <p>Set the unit system to specify the distance.</p>
336    /// <p>Default Value: <code>Kilometers</code></p>
337    pub fn get_distance_unit(&self) -> &::std::option::Option<crate::types::DistanceUnit> {
338        self.inner.get_distance_unit()
339    }
340    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
341    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
342    pub fn car_mode_options(mut self, input: crate::types::CalculateRouteCarModeOptions) -> Self {
343        self.inner = self.inner.car_mode_options(input);
344        self
345    }
346    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
347    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
348    pub fn set_car_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteCarModeOptions>) -> Self {
349        self.inner = self.inner.set_car_mode_options(input);
350        self
351    }
352    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
353    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
354    pub fn get_car_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteCarModeOptions> {
355        self.inner.get_car_mode_options()
356    }
357    /// <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>
358    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
359    pub fn truck_mode_options(mut self, input: crate::types::CalculateRouteTruckModeOptions) -> Self {
360        self.inner = self.inner.truck_mode_options(input);
361        self
362    }
363    /// <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>
364    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
365    pub fn set_truck_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteTruckModeOptions>) -> Self {
366        self.inner = self.inner.set_truck_mode_options(input);
367        self
368    }
369    /// <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>
370    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
371    pub fn get_truck_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteTruckModeOptions> {
372        self.inner.get_truck_mode_options()
373    }
374    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
375    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
376        self.inner = self.inner.key(input.into());
377        self
378    }
379    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
380    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
381        self.inner = self.inner.set_key(input);
382        self
383    }
384    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
385    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
386        self.inner.get_key()
387    }
388}