aws_sdk_georoutes/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/// <p>Use <code>CalculateRouteMatrix</code> to compute results for all pairs of Origins to Destinations. Each row corresponds to one entry in Origins. Each entry in the row corresponds to the route from that entry in Origins to an entry in Destinations positions.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CalculateRouteMatrixFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::calculate_route_matrix::CalculateRouteMatrixOutput,
35 crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
36 > for CalculateRouteMatrixFluentBuilder
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::calculate_route_matrix::CalculateRouteMatrixOutput,
44 crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CalculateRouteMatrixFluentBuilder {
51 /// Creates a new `CalculateRouteMatrixFluentBuilder`.
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 CalculateRouteMatrix as a reference.
60 pub fn as_input(&self) -> &crate::operation::calculate_route_matrix::builders::CalculateRouteMatrixInputBuilder {
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::calculate_route_matrix::CalculateRouteMatrixOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
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::calculate_route_matrix::CalculateRouteMatrix::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::calculate_route_matrix::CalculateRouteMatrix::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::calculate_route_matrix::CalculateRouteMatrixOutput,
97 crate::operation::calculate_route_matrix::CalculateRouteMatrixError,
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 allowed while calculating a route.</p>
112 pub fn allow(mut self, input: crate::types::RouteMatrixAllowOptions) -> Self {
113 self.inner = self.inner.allow(input);
114 self
115 }
116 /// <p>Features that are allowed while calculating a route.</p>
117 pub fn set_allow(mut self, input: ::std::option::Option<crate::types::RouteMatrixAllowOptions>) -> Self {
118 self.inner = self.inner.set_allow(input);
119 self
120 }
121 /// <p>Features that are allowed while calculating a route.</p>
122 pub fn get_allow(&self) -> &::std::option::Option<crate::types::RouteMatrixAllowOptions> {
123 self.inner.get_allow()
124 }
125 /// <p>Features that are avoided while calculating a route. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, it violates the avoidance and the returned response produces a notice for the violation.</p>
126 pub fn avoid(mut self, input: crate::types::RouteMatrixAvoidanceOptions) -> Self {
127 self.inner = self.inner.avoid(input);
128 self
129 }
130 /// <p>Features that are avoided while calculating a route. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, it violates the avoidance and the returned response produces a notice for the violation.</p>
131 pub fn set_avoid(mut self, input: ::std::option::Option<crate::types::RouteMatrixAvoidanceOptions>) -> Self {
132 self.inner = self.inner.set_avoid(input);
133 self
134 }
135 /// <p>Features that are avoided while calculating a route. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, it violates the avoidance and the returned response produces a notice for the violation.</p>
136 pub fn get_avoid(&self) -> &::std::option::Option<crate::types::RouteMatrixAvoidanceOptions> {
137 self.inner.get_avoid()
138 }
139 /// <p>Uses the current time as the time of departure.</p>
140 pub fn depart_now(mut self, input: bool) -> Self {
141 self.inner = self.inner.depart_now(input);
142 self
143 }
144 /// <p>Uses the current time as the time of departure.</p>
145 pub fn set_depart_now(mut self, input: ::std::option::Option<bool>) -> Self {
146 self.inner = self.inner.set_depart_now(input);
147 self
148 }
149 /// <p>Uses the current time as the time of departure.</p>
150 pub fn get_depart_now(&self) -> &::std::option::Option<bool> {
151 self.inner.get_depart_now()
152 }
153 /// <p>Time of departure from thr origin.</p>
154 /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
155 /// <p>Examples:</p>
156 /// <p><code>2020-04-22T17:57:24Z</code></p>
157 /// <p><code>2020-04-22T17:57:24+02:00</code></p>
158 pub fn departure_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.departure_time(input.into());
160 self
161 }
162 /// <p>Time of departure from thr origin.</p>
163 /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
164 /// <p>Examples:</p>
165 /// <p><code>2020-04-22T17:57:24Z</code></p>
166 /// <p><code>2020-04-22T17:57:24+02:00</code></p>
167 pub fn set_departure_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.inner = self.inner.set_departure_time(input);
169 self
170 }
171 /// <p>Time of departure from thr origin.</p>
172 /// <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code></p>
173 /// <p>Examples:</p>
174 /// <p><code>2020-04-22T17:57:24Z</code></p>
175 /// <p><code>2020-04-22T17:57:24+02:00</code></p>
176 pub fn get_departure_time(&self) -> &::std::option::Option<::std::string::String> {
177 self.inner.get_departure_time()
178 }
179 ///
180 /// Appends an item to `Destinations`.
181 ///
182 /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
183 ///
184 /// <p>List of destinations for the route.</p><note>
185 /// <p>Route calculations are billed for each origin and destination pair. If you use a large matrix of origins and destinations, your costs will increase accordingly. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
186 /// </note>
187 pub fn destinations(mut self, input: crate::types::RouteMatrixDestination) -> Self {
188 self.inner = self.inner.destinations(input);
189 self
190 }
191 /// <p>List of destinations for the route.</p><note>
192 /// <p>Route calculations are billed for each origin and destination pair. If you use a large matrix of origins and destinations, your costs will increase accordingly. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
193 /// </note>
194 pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RouteMatrixDestination>>) -> Self {
195 self.inner = self.inner.set_destinations(input);
196 self
197 }
198 /// <p>List of destinations for the route.</p><note>
199 /// <p>Route calculations are billed for each origin and destination pair. If you use a large matrix of origins and destinations, your costs will increase accordingly. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
200 /// </note>
201 pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteMatrixDestination>> {
202 self.inner.get_destinations()
203 }
204 /// <p>Features to be strictly excluded while calculating the route.</p>
205 pub fn exclude(mut self, input: crate::types::RouteMatrixExclusionOptions) -> Self {
206 self.inner = self.inner.exclude(input);
207 self
208 }
209 /// <p>Features to be strictly excluded while calculating the route.</p>
210 pub fn set_exclude(mut self, input: ::std::option::Option<crate::types::RouteMatrixExclusionOptions>) -> Self {
211 self.inner = self.inner.set_exclude(input);
212 self
213 }
214 /// <p>Features to be strictly excluded while calculating the route.</p>
215 pub fn get_exclude(&self) -> &::std::option::Option<crate::types::RouteMatrixExclusionOptions> {
216 self.inner.get_exclude()
217 }
218 /// <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>
219 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.inner = self.inner.key(input.into());
221 self
222 }
223 /// <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>
224 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.inner = self.inner.set_key(input);
226 self
227 }
228 /// <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>
229 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_key()
231 }
232 /// <p>Specifies the optimization criteria for calculating a route.</p>
233 /// <p>Default Value: <code>FastestRoute</code></p>
234 pub fn optimize_routing_for(mut self, input: crate::types::RoutingObjective) -> Self {
235 self.inner = self.inner.optimize_routing_for(input);
236 self
237 }
238 /// <p>Specifies the optimization criteria for calculating a route.</p>
239 /// <p>Default Value: <code>FastestRoute</code></p>
240 pub fn set_optimize_routing_for(mut self, input: ::std::option::Option<crate::types::RoutingObjective>) -> Self {
241 self.inner = self.inner.set_optimize_routing_for(input);
242 self
243 }
244 /// <p>Specifies the optimization criteria for calculating a route.</p>
245 /// <p>Default Value: <code>FastestRoute</code></p>
246 pub fn get_optimize_routing_for(&self) -> &::std::option::Option<crate::types::RoutingObjective> {
247 self.inner.get_optimize_routing_for()
248 }
249 ///
250 /// Appends an item to `Origins`.
251 ///
252 /// To override the contents of this collection use [`set_origins`](Self::set_origins).
253 ///
254 /// <p>The position in longitude and latitude for the origin.</p><note>
255 /// <p>Route calculations are billed for each origin and destination pair. Using a large amount of Origins in a request can lead you to incur unexpected charges. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
256 /// </note>
257 pub fn origins(mut self, input: crate::types::RouteMatrixOrigin) -> Self {
258 self.inner = self.inner.origins(input);
259 self
260 }
261 /// <p>The position in longitude and latitude for the origin.</p><note>
262 /// <p>Route calculations are billed for each origin and destination pair. Using a large amount of Origins in a request can lead you to incur unexpected charges. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
263 /// </note>
264 pub fn set_origins(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RouteMatrixOrigin>>) -> Self {
265 self.inner = self.inner.set_origins(input);
266 self
267 }
268 /// <p>The position in longitude and latitude for the origin.</p><note>
269 /// <p>Route calculations are billed for each origin and destination pair. Using a large amount of Origins in a request can lead you to incur unexpected charges. See <a href="https://docs.aws.amazon.com/location/latest/developerguide/routes-pricing.html`"> Amazon Location's pricing page</a> for more information.</p>
270 /// </note>
271 pub fn get_origins(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteMatrixOrigin>> {
272 self.inner.get_origins()
273 }
274 /// <p>Boundary within which the matrix is to be calculated. All data, origins and destinations outside the boundary are considered invalid.</p><note>
275 /// <p>When request routing boundary was set as AutoCircle, the response routing boundary will return Circle derived from the AutoCircle settings.</p>
276 /// </note>
277 pub fn routing_boundary(mut self, input: crate::types::RouteMatrixBoundary) -> Self {
278 self.inner = self.inner.routing_boundary(input);
279 self
280 }
281 /// <p>Boundary within which the matrix is to be calculated. All data, origins and destinations outside the boundary are considered invalid.</p><note>
282 /// <p>When request routing boundary was set as AutoCircle, the response routing boundary will return Circle derived from the AutoCircle settings.</p>
283 /// </note>
284 pub fn set_routing_boundary(mut self, input: ::std::option::Option<crate::types::RouteMatrixBoundary>) -> Self {
285 self.inner = self.inner.set_routing_boundary(input);
286 self
287 }
288 /// <p>Boundary within which the matrix is to be calculated. All data, origins and destinations outside the boundary are considered invalid.</p><note>
289 /// <p>When request routing boundary was set as AutoCircle, the response routing boundary will return Circle derived from the AutoCircle settings.</p>
290 /// </note>
291 pub fn get_routing_boundary(&self) -> &::std::option::Option<crate::types::RouteMatrixBoundary> {
292 self.inner.get_routing_boundary()
293 }
294 /// <p>Traffic related options.</p>
295 pub fn traffic(mut self, input: crate::types::RouteMatrixTrafficOptions) -> Self {
296 self.inner = self.inner.traffic(input);
297 self
298 }
299 /// <p>Traffic related options.</p>
300 pub fn set_traffic(mut self, input: ::std::option::Option<crate::types::RouteMatrixTrafficOptions>) -> Self {
301 self.inner = self.inner.set_traffic(input);
302 self
303 }
304 /// <p>Traffic related options.</p>
305 pub fn get_traffic(&self) -> &::std::option::Option<crate::types::RouteMatrixTrafficOptions> {
306 self.inner.get_traffic()
307 }
308 /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
309 /// <p>Default Value: <code>Car</code></p>
310 pub fn travel_mode(mut self, input: crate::types::RouteMatrixTravelMode) -> Self {
311 self.inner = self.inner.travel_mode(input);
312 self
313 }
314 /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
315 /// <p>Default Value: <code>Car</code></p>
316 pub fn set_travel_mode(mut self, input: ::std::option::Option<crate::types::RouteMatrixTravelMode>) -> Self {
317 self.inner = self.inner.set_travel_mode(input);
318 self
319 }
320 /// <p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p>
321 /// <p>Default Value: <code>Car</code></p>
322 pub fn get_travel_mode(&self) -> &::std::option::Option<crate::types::RouteMatrixTravelMode> {
323 self.inner.get_travel_mode()
324 }
325 /// <p>Travel mode related options for the provided travel mode.</p>
326 pub fn travel_mode_options(mut self, input: crate::types::RouteMatrixTravelModeOptions) -> Self {
327 self.inner = self.inner.travel_mode_options(input);
328 self
329 }
330 /// <p>Travel mode related options for the provided travel mode.</p>
331 pub fn set_travel_mode_options(mut self, input: ::std::option::Option<crate::types::RouteMatrixTravelModeOptions>) -> Self {
332 self.inner = self.inner.set_travel_mode_options(input);
333 self
334 }
335 /// <p>Travel mode related options for the provided travel mode.</p>
336 pub fn get_travel_mode_options(&self) -> &::std::option::Option<crate::types::RouteMatrixTravelModeOptions> {
337 self.inner.get_travel_mode_options()
338 }
339}