aws_sdk_georoutes/operation/optimize_waypoints/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::optimize_waypoints::_optimize_waypoints_output::OptimizeWaypointsOutputBuilder;
3
4pub use crate::operation::optimize_waypoints::_optimize_waypoints_input::OptimizeWaypointsInputBuilder;
5
6impl crate::operation::optimize_waypoints::builders::OptimizeWaypointsInputBuilder {
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::optimize_waypoints::OptimizeWaypointsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::optimize_waypoints::OptimizeWaypointsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.optimize_waypoints();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `OptimizeWaypoints`.
24///
25/// <p><code>OptimizeWaypoints</code> calculates the optimal order to travel between a set of waypoints to minimize either the travel time or the distance travelled during the journey, based on road network restrictions and the traffic pattern data.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct OptimizeWaypointsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::optimize_waypoints::builders::OptimizeWaypointsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::optimize_waypoints::OptimizeWaypointsOutput,
35        crate::operation::optimize_waypoints::OptimizeWaypointsError,
36    > for OptimizeWaypointsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::optimize_waypoints::OptimizeWaypointsOutput,
44            crate::operation::optimize_waypoints::OptimizeWaypointsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl OptimizeWaypointsFluentBuilder {
51    /// Creates a new `OptimizeWaypointsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the OptimizeWaypoints as a reference.
60    pub fn as_input(&self) -> &crate::operation::optimize_waypoints::builders::OptimizeWaypointsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::optimize_waypoints::OptimizeWaypointsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::optimize_waypoints::OptimizeWaypointsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::optimize_waypoints::OptimizeWaypoints::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::optimize_waypoints::OptimizeWaypoints::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::optimize_waypoints::OptimizeWaypointsOutput,
97        crate::operation::optimize_waypoints::OptimizeWaypointsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Features that are avoided. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, this setting is ignored.</p>
112    pub fn avoid(mut self, input: crate::types::WaypointOptimizationAvoidanceOptions) -> Self {
113        self.inner = self.inner.avoid(input);
114        self
115    }
116    /// <p>Features that are avoided. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, this setting is ignored.</p>
117    pub fn set_avoid(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationAvoidanceOptions>) -> Self {
118        self.inner = self.inner.set_avoid(input);
119        self
120    }
121    /// <p>Features that are avoided. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, this setting is ignored.</p>
122    pub fn get_avoid(&self) -> &::std::option::Option<crate::types::WaypointOptimizationAvoidanceOptions> {
123        self.inner.get_avoid()
124    }
125    /// <p>Clustering allows you to specify how nearby waypoints can be clustered to improve the optimized sequence.</p>
126    pub fn clustering(mut self, input: crate::types::WaypointOptimizationClusteringOptions) -> Self {
127        self.inner = self.inner.clustering(input);
128        self
129    }
130    /// <p>Clustering allows you to specify how nearby waypoints can be clustered to improve the optimized sequence.</p>
131    pub fn set_clustering(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationClusteringOptions>) -> Self {
132        self.inner = self.inner.set_clustering(input);
133        self
134    }
135    /// <p>Clustering allows you to specify how nearby waypoints can be clustered to improve the optimized sequence.</p>
136    pub fn get_clustering(&self) -> &::std::option::Option<crate::types::WaypointOptimizationClusteringOptions> {
137        self.inner.get_clustering()
138    }
139    /// <p>Departure time from the waypoint.</p>
140    /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
141    /// <p>Examples:</p>
142    /// <p><code>2020-04-22T17:57:24Z</code></p>
143    /// <p><code>2020-04-22T17:57:24+02:00</code></p>
144    pub fn departure_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.departure_time(input.into());
146        self
147    }
148    /// <p>Departure time from the waypoint.</p>
149    /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
150    /// <p>Examples:</p>
151    /// <p><code>2020-04-22T17:57:24Z</code></p>
152    /// <p><code>2020-04-22T17:57:24+02:00</code></p>
153    pub fn set_departure_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_departure_time(input);
155        self
156    }
157    /// <p>Departure time from the waypoint.</p>
158    /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
159    /// <p>Examples:</p>
160    /// <p><code>2020-04-22T17:57:24Z</code></p>
161    /// <p><code>2020-04-22T17:57:24+02:00</code></p>
162    pub fn get_departure_time(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_departure_time()
164    }
165    ///
166    /// Appends an item to `Destination`.
167    ///
168    /// To override the contents of this collection use [`set_destination`](Self::set_destination).
169    ///
170    /// <p>The final position for the route in the World Geodetic System (WGS 84) format: <code>\[longitude, latitude\]</code>.</p>
171    pub fn destination(mut self, input: f64) -> Self {
172        self.inner = self.inner.destination(input);
173        self
174    }
175    /// <p>The final position for the route in the World Geodetic System (WGS 84) format: <code>\[longitude, latitude\]</code>.</p>
176    pub fn set_destination(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
177        self.inner = self.inner.set_destination(input);
178        self
179    }
180    /// <p>The final position for the route in the World Geodetic System (WGS 84) format: <code>\[longitude, latitude\]</code>.</p>
181    pub fn get_destination(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
182        self.inner.get_destination()
183    }
184    /// <p>Destination related options.</p>
185    pub fn destination_options(mut self, input: crate::types::WaypointOptimizationDestinationOptions) -> Self {
186        self.inner = self.inner.destination_options(input);
187        self
188    }
189    /// <p>Destination related options.</p>
190    pub fn set_destination_options(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationDestinationOptions>) -> Self {
191        self.inner = self.inner.set_destination_options(input);
192        self
193    }
194    /// <p>Destination related options.</p>
195    pub fn get_destination_options(&self) -> &::std::option::Option<crate::types::WaypointOptimizationDestinationOptions> {
196        self.inner.get_destination_options()
197    }
198    /// <p>Driver related options.</p>
199    pub fn driver(mut self, input: crate::types::WaypointOptimizationDriverOptions) -> Self {
200        self.inner = self.inner.driver(input);
201        self
202    }
203    /// <p>Driver related options.</p>
204    pub fn set_driver(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationDriverOptions>) -> Self {
205        self.inner = self.inner.set_driver(input);
206        self
207    }
208    /// <p>Driver related options.</p>
209    pub fn get_driver(&self) -> &::std::option::Option<crate::types::WaypointOptimizationDriverOptions> {
210        self.inner.get_driver()
211    }
212    /// <p>Features to be strictly excluded while calculating the route.</p>
213    pub fn exclude(mut self, input: crate::types::WaypointOptimizationExclusionOptions) -> Self {
214        self.inner = self.inner.exclude(input);
215        self
216    }
217    /// <p>Features to be strictly excluded while calculating the route.</p>
218    pub fn set_exclude(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationExclusionOptions>) -> Self {
219        self.inner = self.inner.set_exclude(input);
220        self
221    }
222    /// <p>Features to be strictly excluded while calculating the route.</p>
223    pub fn get_exclude(&self) -> &::std::option::Option<crate::types::WaypointOptimizationExclusionOptions> {
224        self.inner.get_exclude()
225    }
226    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
227    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228        self.inner = self.inner.key(input.into());
229        self
230    }
231    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
232    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233        self.inner = self.inner.set_key(input);
234        self
235    }
236    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
237    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
238        self.inner.get_key()
239    }
240    /// <p>Specifies the optimization criteria for the calculated sequence.</p>
241    /// <p>Default Value: <code>FastestRoute</code>.</p>
242    pub fn optimize_sequencing_for(mut self, input: crate::types::WaypointOptimizationSequencingObjective) -> Self {
243        self.inner = self.inner.optimize_sequencing_for(input);
244        self
245    }
246    /// <p>Specifies the optimization criteria for the calculated sequence.</p>
247    /// <p>Default Value: <code>FastestRoute</code>.</p>
248    pub fn set_optimize_sequencing_for(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationSequencingObjective>) -> Self {
249        self.inner = self.inner.set_optimize_sequencing_for(input);
250        self
251    }
252    /// <p>Specifies the optimization criteria for the calculated sequence.</p>
253    /// <p>Default Value: <code>FastestRoute</code>.</p>
254    pub fn get_optimize_sequencing_for(&self) -> &::std::option::Option<crate::types::WaypointOptimizationSequencingObjective> {
255        self.inner.get_optimize_sequencing_for()
256    }
257    ///
258    /// Appends an item to `Origin`.
259    ///
260    /// To override the contents of this collection use [`set_origin`](Self::set_origin).
261    ///
262    /// <p>The start position for the route.</p>
263    pub fn origin(mut self, input: f64) -> Self {
264        self.inner = self.inner.origin(input);
265        self
266    }
267    /// <p>The start position for the route.</p>
268    pub fn set_origin(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
269        self.inner = self.inner.set_origin(input);
270        self
271    }
272    /// <p>The start position for the route.</p>
273    pub fn get_origin(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
274        self.inner.get_origin()
275    }
276    /// <p>Origin related options.</p>
277    pub fn origin_options(mut self, input: crate::types::WaypointOptimizationOriginOptions) -> Self {
278        self.inner = self.inner.origin_options(input);
279        self
280    }
281    /// <p>Origin related options.</p>
282    pub fn set_origin_options(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationOriginOptions>) -> Self {
283        self.inner = self.inner.set_origin_options(input);
284        self
285    }
286    /// <p>Origin related options.</p>
287    pub fn get_origin_options(&self) -> &::std::option::Option<crate::types::WaypointOptimizationOriginOptions> {
288        self.inner.get_origin_options()
289    }
290    /// <p>Traffic-related options.</p>
291    pub fn traffic(mut self, input: crate::types::WaypointOptimizationTrafficOptions) -> Self {
292        self.inner = self.inner.traffic(input);
293        self
294    }
295    /// <p>Traffic-related options.</p>
296    pub fn set_traffic(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationTrafficOptions>) -> Self {
297        self.inner = self.inner.set_traffic(input);
298        self
299    }
300    /// <p>Traffic-related options.</p>
301    pub fn get_traffic(&self) -> &::std::option::Option<crate::types::WaypointOptimizationTrafficOptions> {
302        self.inner.get_traffic()
303    }
304    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
305    /// <p>Default Value: <code>Car</code></p>
306    pub fn travel_mode(mut self, input: crate::types::WaypointOptimizationTravelMode) -> Self {
307        self.inner = self.inner.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.</p>
311    /// <p>Default Value: <code>Car</code></p>
312    pub fn set_travel_mode(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationTravelMode>) -> Self {
313        self.inner = self.inner.set_travel_mode(input);
314        self
315    }
316    /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
317    /// <p>Default Value: <code>Car</code></p>
318    pub fn get_travel_mode(&self) -> &::std::option::Option<crate::types::WaypointOptimizationTravelMode> {
319        self.inner.get_travel_mode()
320    }
321    /// <p>Travel mode related options for the provided travel mode.</p>
322    pub fn travel_mode_options(mut self, input: crate::types::WaypointOptimizationTravelModeOptions) -> Self {
323        self.inner = self.inner.travel_mode_options(input);
324        self
325    }
326    /// <p>Travel mode related options for the provided travel mode.</p>
327    pub fn set_travel_mode_options(mut self, input: ::std::option::Option<crate::types::WaypointOptimizationTravelModeOptions>) -> Self {
328        self.inner = self.inner.set_travel_mode_options(input);
329        self
330    }
331    /// <p>Travel mode related options for the provided travel mode.</p>
332    pub fn get_travel_mode_options(&self) -> &::std::option::Option<crate::types::WaypointOptimizationTravelModeOptions> {
333        self.inner.get_travel_mode_options()
334    }
335    ///
336    /// Appends an item to `Waypoints`.
337    ///
338    /// To override the contents of this collection use [`set_waypoints`](Self::set_waypoints).
339    ///
340    /// <p>List of waypoints between the <code>Origin</code> and <code>Destination</code>.</p>
341    pub fn waypoints(mut self, input: crate::types::WaypointOptimizationWaypoint) -> Self {
342        self.inner = self.inner.waypoints(input);
343        self
344    }
345    /// <p>List of waypoints between the <code>Origin</code> and <code>Destination</code>.</p>
346    pub fn set_waypoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WaypointOptimizationWaypoint>>) -> Self {
347        self.inner = self.inner.set_waypoints(input);
348        self
349    }
350    /// <p>List of waypoints between the <code>Origin</code> and <code>Destination</code>.</p>
351    pub fn get_waypoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WaypointOptimizationWaypoint>> {
352        self.inner.get_waypoints()
353    }
354}