aws_sdk_location/operation/calculate_route/
_calculate_route_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CalculateRouteInput {
6    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
7    pub calculator_name: ::std::option::Option<::std::string::String>,
8    /// <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>
9    /// <ul>
10    /// <li>
11    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
12    /// </ul><note>
13    /// <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>
14    /// </note>
15    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
16    pub departure_position: ::std::option::Option<::std::vec::Vec<f64>>,
17    /// <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>
18    /// <ul>
19    /// <li>
20    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
21    /// </ul><note>
22    /// <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>
23    /// </note>
24    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
25    pub destination_position: ::std::option::Option<::std::vec::Vec<f64>>,
26    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
27    /// <ul>
28    /// <li>
29    /// <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>
30    /// </ul><note>
31    /// <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>
32    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
33    /// <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>
34    /// </note>
35    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
36    pub waypoint_positions: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>,
37    /// <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>
38    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
39    /// <p><code>Truck</code> is not available for Grab.</p>
40    /// <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>
41    /// </note>
42    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
43    /// <ul>
44    /// <li>
45    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
46    /// <li>
47    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
48    /// </ul>
49    /// <p>Default Value: <code>Car</code></p>
50    pub travel_mode: ::std::option::Option<crate::types::TravelMode>,
51    /// <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>
52    /// <ul>
53    /// <li>
54    /// <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>
55    /// </ul>
56    pub departure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
57    /// <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>
58    /// <p>Default Value: <code>false</code></p>
59    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
60    pub depart_now: ::std::option::Option<bool>,
61    /// <p>Set the unit system to specify the distance.</p>
62    /// <p>Default Value: <code>Kilometers</code></p>
63    pub distance_unit: ::std::option::Option<crate::types::DistanceUnit>,
64    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
65    /// <p>Default Value: <code>false</code></p>
66    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
67    pub include_leg_geometry: ::std::option::Option<bool>,
68    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
69    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
70    pub car_mode_options: ::std::option::Option<crate::types::CalculateRouteCarModeOptions>,
71    /// <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>
72    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
73    pub truck_mode_options: ::std::option::Option<crate::types::CalculateRouteTruckModeOptions>,
74    /// <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>
75    /// <p>ArrivalTime is not supported Esri.</p>
76    /// </note>
77    pub arrival_time: ::std::option::Option<::aws_smithy_types::DateTime>,
78    /// <p>Specifies the distance to optimize for when calculating a route.</p>
79    pub optimize_for: ::std::option::Option<crate::types::OptimizationMode>,
80    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
81    pub key: ::std::option::Option<::std::string::String>,
82}
83impl CalculateRouteInput {
84    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
85    pub fn calculator_name(&self) -> ::std::option::Option<&str> {
86        self.calculator_name.as_deref()
87    }
88    /// <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>
89    /// <ul>
90    /// <li>
91    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
92    /// </ul><note>
93    /// <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>
94    /// </note>
95    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
96    ///
97    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.departure_position.is_none()`.
98    pub fn departure_position(&self) -> &[f64] {
99        self.departure_position.as_deref().unwrap_or_default()
100    }
101    /// <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>
102    /// <ul>
103    /// <li>
104    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
105    /// </ul><note>
106    /// <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>
107    /// </note>
108    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
109    ///
110    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.destination_position.is_none()`.
111    pub fn destination_position(&self) -> &[f64] {
112        self.destination_position.as_deref().unwrap_or_default()
113    }
114    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
115    /// <ul>
116    /// <li>
117    /// <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>
118    /// </ul><note>
119    /// <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>
120    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
121    /// <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>
122    /// </note>
123    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
124    ///
125    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.waypoint_positions.is_none()`.
126    pub fn waypoint_positions(&self) -> &[::std::vec::Vec<f64>] {
127        self.waypoint_positions.as_deref().unwrap_or_default()
128    }
129    /// <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>
130    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
131    /// <p><code>Truck</code> is not available for Grab.</p>
132    /// <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>
133    /// </note>
134    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
135    /// <ul>
136    /// <li>
137    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
138    /// <li>
139    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
140    /// </ul>
141    /// <p>Default Value: <code>Car</code></p>
142    pub fn travel_mode(&self) -> ::std::option::Option<&crate::types::TravelMode> {
143        self.travel_mode.as_ref()
144    }
145    /// <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>
146    /// <ul>
147    /// <li>
148    /// <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>
149    /// </ul>
150    pub fn departure_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
151        self.departure_time.as_ref()
152    }
153    /// <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>
154    /// <p>Default Value: <code>false</code></p>
155    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
156    pub fn depart_now(&self) -> ::std::option::Option<bool> {
157        self.depart_now
158    }
159    /// <p>Set the unit system to specify the distance.</p>
160    /// <p>Default Value: <code>Kilometers</code></p>
161    pub fn distance_unit(&self) -> ::std::option::Option<&crate::types::DistanceUnit> {
162        self.distance_unit.as_ref()
163    }
164    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
165    /// <p>Default Value: <code>false</code></p>
166    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
167    pub fn include_leg_geometry(&self) -> ::std::option::Option<bool> {
168        self.include_leg_geometry
169    }
170    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
171    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
172    pub fn car_mode_options(&self) -> ::std::option::Option<&crate::types::CalculateRouteCarModeOptions> {
173        self.car_mode_options.as_ref()
174    }
175    /// <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>
176    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
177    pub fn truck_mode_options(&self) -> ::std::option::Option<&crate::types::CalculateRouteTruckModeOptions> {
178        self.truck_mode_options.as_ref()
179    }
180    /// <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>
181    /// <p>ArrivalTime is not supported Esri.</p>
182    /// </note>
183    pub fn arrival_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
184        self.arrival_time.as_ref()
185    }
186    /// <p>Specifies the distance to optimize for when calculating a route.</p>
187    pub fn optimize_for(&self) -> ::std::option::Option<&crate::types::OptimizationMode> {
188        self.optimize_for.as_ref()
189    }
190    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
191    pub fn key(&self) -> ::std::option::Option<&str> {
192        self.key.as_deref()
193    }
194}
195impl ::std::fmt::Debug for CalculateRouteInput {
196    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
197        let mut formatter = f.debug_struct("CalculateRouteInput");
198        formatter.field("calculator_name", &self.calculator_name);
199        formatter.field("departure_position", &"*** Sensitive Data Redacted ***");
200        formatter.field("destination_position", &"*** Sensitive Data Redacted ***");
201        formatter.field("waypoint_positions", &"*** Sensitive Data Redacted ***");
202        formatter.field("travel_mode", &self.travel_mode);
203        formatter.field("departure_time", &"*** Sensitive Data Redacted ***");
204        formatter.field("depart_now", &"*** Sensitive Data Redacted ***");
205        formatter.field("distance_unit", &self.distance_unit);
206        formatter.field("include_leg_geometry", &"*** Sensitive Data Redacted ***");
207        formatter.field("car_mode_options", &self.car_mode_options);
208        formatter.field("truck_mode_options", &self.truck_mode_options);
209        formatter.field("arrival_time", &"*** Sensitive Data Redacted ***");
210        formatter.field("optimize_for", &self.optimize_for);
211        formatter.field("key", &"*** Sensitive Data Redacted ***");
212        formatter.finish()
213    }
214}
215impl CalculateRouteInput {
216    /// Creates a new builder-style object to manufacture [`CalculateRouteInput`](crate::operation::calculate_route::CalculateRouteInput).
217    pub fn builder() -> crate::operation::calculate_route::builders::CalculateRouteInputBuilder {
218        crate::operation::calculate_route::builders::CalculateRouteInputBuilder::default()
219    }
220}
221
222/// A builder for [`CalculateRouteInput`](crate::operation::calculate_route::CalculateRouteInput).
223#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
224#[non_exhaustive]
225pub struct CalculateRouteInputBuilder {
226    pub(crate) calculator_name: ::std::option::Option<::std::string::String>,
227    pub(crate) departure_position: ::std::option::Option<::std::vec::Vec<f64>>,
228    pub(crate) destination_position: ::std::option::Option<::std::vec::Vec<f64>>,
229    pub(crate) waypoint_positions: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>,
230    pub(crate) travel_mode: ::std::option::Option<crate::types::TravelMode>,
231    pub(crate) departure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
232    pub(crate) depart_now: ::std::option::Option<bool>,
233    pub(crate) distance_unit: ::std::option::Option<crate::types::DistanceUnit>,
234    pub(crate) include_leg_geometry: ::std::option::Option<bool>,
235    pub(crate) car_mode_options: ::std::option::Option<crate::types::CalculateRouteCarModeOptions>,
236    pub(crate) truck_mode_options: ::std::option::Option<crate::types::CalculateRouteTruckModeOptions>,
237    pub(crate) arrival_time: ::std::option::Option<::aws_smithy_types::DateTime>,
238    pub(crate) optimize_for: ::std::option::Option<crate::types::OptimizationMode>,
239    pub(crate) key: ::std::option::Option<::std::string::String>,
240}
241impl CalculateRouteInputBuilder {
242    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
243    /// This field is required.
244    pub fn calculator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.calculator_name = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
249    pub fn set_calculator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.calculator_name = input;
251        self
252    }
253    /// <p>The name of the route calculator resource that you want to use to calculate the route.</p>
254    pub fn get_calculator_name(&self) -> &::std::option::Option<::std::string::String> {
255        &self.calculator_name
256    }
257    /// Appends an item to `departure_position`.
258    ///
259    /// To override the contents of this collection use [`set_departure_position`](Self::set_departure_position).
260    ///
261    /// <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>
262    /// <ul>
263    /// <li>
264    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
265    /// </ul><note>
266    /// <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>
267    /// </note>
268    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
269    pub fn departure_position(mut self, input: f64) -> Self {
270        let mut v = self.departure_position.unwrap_or_default();
271        v.push(input);
272        self.departure_position = ::std::option::Option::Some(v);
273        self
274    }
275    /// <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>
276    /// <ul>
277    /// <li>
278    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
279    /// </ul><note>
280    /// <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>
281    /// </note>
282    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
283    pub fn set_departure_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
284        self.departure_position = input;
285        self
286    }
287    /// <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>
288    /// <ul>
289    /// <li>
290    /// <p>For example, <code>\[-123.115, 49.285\]</code></p></li>
291    /// </ul><note>
292    /// <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>
293    /// </note>
294    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
295    pub fn get_departure_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
296        &self.departure_position
297    }
298    /// Appends an item to `destination_position`.
299    ///
300    /// To override the contents of this collection use [`set_destination_position`](Self::set_destination_position).
301    ///
302    /// <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>
303    /// <ul>
304    /// <li>
305    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
306    /// </ul><note>
307    /// <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>
308    /// </note>
309    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
310    pub fn destination_position(mut self, input: f64) -> Self {
311        let mut v = self.destination_position.unwrap_or_default();
312        v.push(input);
313        self.destination_position = ::std::option::Option::Some(v);
314        self
315    }
316    /// <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>
317    /// <ul>
318    /// <li>
319    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
320    /// </ul><note>
321    /// <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>
322    /// </note>
323    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
324    pub fn set_destination_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
325        self.destination_position = input;
326        self
327    }
328    /// <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>
329    /// <ul>
330    /// <li>
331    /// <p>For example, <code>\[-122.339, 47.615\]</code></p></li>
332    /// </ul><note>
333    /// <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>
334    /// </note>
335    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
336    pub fn get_destination_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
337        &self.destination_position
338    }
339    /// Appends an item to `waypoint_positions`.
340    ///
341    /// To override the contents of this collection use [`set_waypoint_positions`](Self::set_waypoint_positions).
342    ///
343    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
344    /// <ul>
345    /// <li>
346    /// <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>
347    /// </ul><note>
348    /// <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>
349    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
350    /// <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>
351    /// </note>
352    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
353    pub fn waypoint_positions(mut self, input: ::std::vec::Vec<f64>) -> Self {
354        let mut v = self.waypoint_positions.unwrap_or_default();
355        v.push(input);
356        self.waypoint_positions = ::std::option::Option::Some(v);
357        self
358    }
359    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
360    /// <ul>
361    /// <li>
362    /// <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>
363    /// </ul><note>
364    /// <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>
365    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
366    /// <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>
367    /// </note>
368    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
369    pub fn set_waypoint_positions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>>) -> Self {
370        self.waypoint_positions = input;
371        self
372    }
373    /// <p>Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.</p>
374    /// <ul>
375    /// <li>
376    /// <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>
377    /// </ul><note>
378    /// <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>
379    /// <p>Specifying more than 23 waypoints returns a <code>400 ValidationException</code> error.</p>
380    /// <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>
381    /// </note>
382    /// <p>Valid Values: <code>\[-180 to 180,-90 to 90\]</code></p>
383    pub fn get_waypoint_positions(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<f64>>> {
384        &self.waypoint_positions
385    }
386    /// <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>
387    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
388    /// <p><code>Truck</code> is not available for Grab.</p>
389    /// <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>
390    /// </note>
391    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
392    /// <ul>
393    /// <li>
394    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
395    /// <li>
396    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
397    /// </ul>
398    /// <p>Default Value: <code>Car</code></p>
399    pub fn travel_mode(mut self, input: crate::types::TravelMode) -> Self {
400        self.travel_mode = ::std::option::Option::Some(input);
401        self
402    }
403    /// <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>
404    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
405    /// <p><code>Truck</code> is not available for Grab.</p>
406    /// <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>
407    /// </note>
408    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
409    /// <ul>
410    /// <li>
411    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
412    /// <li>
413    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
414    /// </ul>
415    /// <p>Default Value: <code>Car</code></p>
416    pub fn set_travel_mode(mut self, input: ::std::option::Option<crate::types::TravelMode>) -> Self {
417        self.travel_mode = input;
418        self
419    }
420    /// <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>
421    /// <p><code>Bicycle</code> and <code>Motorcycle</code> are only valid when using Grab as a data provider, and only within Southeast Asia.</p>
422    /// <p><code>Truck</code> is not available for Grab.</p>
423    /// <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>
424    /// </note>
425    /// <p>The <code>TravelMode</code> you specify also determines how you specify route preferences:</p>
426    /// <ul>
427    /// <li>
428    /// <p>If traveling by <code>Car</code> use the <code>CarModeOptions</code> parameter.</p></li>
429    /// <li>
430    /// <p>If traveling by <code>Truck</code> use the <code>TruckModeOptions</code> parameter.</p></li>
431    /// </ul>
432    /// <p>Default Value: <code>Car</code></p>
433    pub fn get_travel_mode(&self) -> &::std::option::Option<crate::types::TravelMode> {
434        &self.travel_mode
435    }
436    /// <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>
437    /// <ul>
438    /// <li>
439    /// <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>
440    /// </ul>
441    pub fn departure_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
442        self.departure_time = ::std::option::Option::Some(input);
443        self
444    }
445    /// <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>
446    /// <ul>
447    /// <li>
448    /// <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>
449    /// </ul>
450    pub fn set_departure_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
451        self.departure_time = input;
452        self
453    }
454    /// <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>
455    /// <ul>
456    /// <li>
457    /// <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>
458    /// </ul>
459    pub fn get_departure_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
460        &self.departure_time
461    }
462    /// <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>
463    /// <p>Default Value: <code>false</code></p>
464    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
465    pub fn depart_now(mut self, input: bool) -> Self {
466        self.depart_now = ::std::option::Option::Some(input);
467        self
468    }
469    /// <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>
470    /// <p>Default Value: <code>false</code></p>
471    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
472    pub fn set_depart_now(mut self, input: ::std::option::Option<bool>) -> Self {
473        self.depart_now = input;
474        self
475    }
476    /// <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>
477    /// <p>Default Value: <code>false</code></p>
478    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
479    pub fn get_depart_now(&self) -> &::std::option::Option<bool> {
480        &self.depart_now
481    }
482    /// <p>Set the unit system to specify the distance.</p>
483    /// <p>Default Value: <code>Kilometers</code></p>
484    pub fn distance_unit(mut self, input: crate::types::DistanceUnit) -> Self {
485        self.distance_unit = ::std::option::Option::Some(input);
486        self
487    }
488    /// <p>Set the unit system to specify the distance.</p>
489    /// <p>Default Value: <code>Kilometers</code></p>
490    pub fn set_distance_unit(mut self, input: ::std::option::Option<crate::types::DistanceUnit>) -> Self {
491        self.distance_unit = input;
492        self
493    }
494    /// <p>Set the unit system to specify the distance.</p>
495    /// <p>Default Value: <code>Kilometers</code></p>
496    pub fn get_distance_unit(&self) -> &::std::option::Option<crate::types::DistanceUnit> {
497        &self.distance_unit
498    }
499    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
500    /// <p>Default Value: <code>false</code></p>
501    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
502    pub fn include_leg_geometry(mut self, input: bool) -> Self {
503        self.include_leg_geometry = ::std::option::Option::Some(input);
504        self
505    }
506    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
507    /// <p>Default Value: <code>false</code></p>
508    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
509    pub fn set_include_leg_geometry(mut self, input: ::std::option::Option<bool>) -> Self {
510        self.include_leg_geometry = input;
511        self
512    }
513    /// <p>Set to include the geometry details in the result for each path between a pair of positions.</p>
514    /// <p>Default Value: <code>false</code></p>
515    /// <p>Valid Values: <code>false</code> | <code>true</code></p>
516    pub fn get_include_leg_geometry(&self) -> &::std::option::Option<bool> {
517        &self.include_leg_geometry
518    }
519    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
520    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
521    pub fn car_mode_options(mut self, input: crate::types::CalculateRouteCarModeOptions) -> Self {
522        self.car_mode_options = ::std::option::Option::Some(input);
523        self
524    }
525    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
526    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
527    pub fn set_car_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteCarModeOptions>) -> Self {
528        self.car_mode_options = input;
529        self
530    }
531    /// <p>Specifies route preferences when traveling by <code>Car</code>, such as avoiding routes that use ferries or tolls.</p>
532    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Car</code>.</p>
533    pub fn get_car_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteCarModeOptions> {
534        &self.car_mode_options
535    }
536    /// <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>
537    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
538    pub fn truck_mode_options(mut self, input: crate::types::CalculateRouteTruckModeOptions) -> Self {
539        self.truck_mode_options = ::std::option::Option::Some(input);
540        self
541    }
542    /// <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>
543    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
544    pub fn set_truck_mode_options(mut self, input: ::std::option::Option<crate::types::CalculateRouteTruckModeOptions>) -> Self {
545        self.truck_mode_options = input;
546        self
547    }
548    /// <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>
549    /// <p>Requirements: <code>TravelMode</code> must be specified as <code>Truck</code>.</p>
550    pub fn get_truck_mode_options(&self) -> &::std::option::Option<crate::types::CalculateRouteTruckModeOptions> {
551        &self.truck_mode_options
552    }
553    /// <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>
554    /// <p>ArrivalTime is not supported Esri.</p>
555    /// </note>
556    pub fn arrival_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
557        self.arrival_time = ::std::option::Option::Some(input);
558        self
559    }
560    /// <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>
561    /// <p>ArrivalTime is not supported Esri.</p>
562    /// </note>
563    pub fn set_arrival_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
564        self.arrival_time = input;
565        self
566    }
567    /// <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>
568    /// <p>ArrivalTime is not supported Esri.</p>
569    /// </note>
570    pub fn get_arrival_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
571        &self.arrival_time
572    }
573    /// <p>Specifies the distance to optimize for when calculating a route.</p>
574    pub fn optimize_for(mut self, input: crate::types::OptimizationMode) -> Self {
575        self.optimize_for = ::std::option::Option::Some(input);
576        self
577    }
578    /// <p>Specifies the distance to optimize for when calculating a route.</p>
579    pub fn set_optimize_for(mut self, input: ::std::option::Option<crate::types::OptimizationMode>) -> Self {
580        self.optimize_for = input;
581        self
582    }
583    /// <p>Specifies the distance to optimize for when calculating a route.</p>
584    pub fn get_optimize_for(&self) -> &::std::option::Option<crate::types::OptimizationMode> {
585        &self.optimize_for
586    }
587    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
588    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
589        self.key = ::std::option::Option::Some(input.into());
590        self
591    }
592    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
593    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
594        self.key = input;
595        self
596    }
597    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
598    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
599        &self.key
600    }
601    /// Consumes the builder and constructs a [`CalculateRouteInput`](crate::operation::calculate_route::CalculateRouteInput).
602    pub fn build(
603        self,
604    ) -> ::std::result::Result<crate::operation::calculate_route::CalculateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
605        ::std::result::Result::Ok(crate::operation::calculate_route::CalculateRouteInput {
606            calculator_name: self.calculator_name,
607            departure_position: self.departure_position,
608            destination_position: self.destination_position,
609            waypoint_positions: self.waypoint_positions,
610            travel_mode: self.travel_mode,
611            departure_time: self.departure_time,
612            depart_now: self.depart_now,
613            distance_unit: self.distance_unit,
614            include_leg_geometry: self.include_leg_geometry,
615            car_mode_options: self.car_mode_options,
616            truck_mode_options: self.truck_mode_options,
617            arrival_time: self.arrival_time,
618            optimize_for: self.optimize_for,
619            key: self.key,
620        })
621    }
622}
623impl ::std::fmt::Debug for CalculateRouteInputBuilder {
624    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
625        let mut formatter = f.debug_struct("CalculateRouteInputBuilder");
626        formatter.field("calculator_name", &self.calculator_name);
627        formatter.field("departure_position", &"*** Sensitive Data Redacted ***");
628        formatter.field("destination_position", &"*** Sensitive Data Redacted ***");
629        formatter.field("waypoint_positions", &"*** Sensitive Data Redacted ***");
630        formatter.field("travel_mode", &self.travel_mode);
631        formatter.field("departure_time", &"*** Sensitive Data Redacted ***");
632        formatter.field("depart_now", &"*** Sensitive Data Redacted ***");
633        formatter.field("distance_unit", &self.distance_unit);
634        formatter.field("include_leg_geometry", &"*** Sensitive Data Redacted ***");
635        formatter.field("car_mode_options", &self.car_mode_options);
636        formatter.field("truck_mode_options", &self.truck_mode_options);
637        formatter.field("arrival_time", &"*** Sensitive Data Redacted ***");
638        formatter.field("optimize_for", &self.optimize_for);
639        formatter.field("key", &"*** Sensitive Data Redacted ***");
640        formatter.finish()
641    }
642}