aws_sdk_location/operation/create_route_calculator/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_route_calculator::_create_route_calculator_output::CreateRouteCalculatorOutputBuilder;
3
4pub use crate::operation::create_route_calculator::_create_route_calculator_input::CreateRouteCalculatorInputBuilder;
5
6impl crate::operation::create_route_calculator::builders::CreateRouteCalculatorInputBuilder {
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::create_route_calculator::CreateRouteCalculatorOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_route_calculator::CreateRouteCalculatorError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_route_calculator();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateRouteCalculator`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the Routes API V2 unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p><code>CreateRouteCalculator</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 Routes API version 2 has a simplified interface that can be used without creating or managing route calculator resources.</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>Creates a route calculator resource in your Amazon Web Services account.</p>
41/// <p>You can send requests to a route calculator resource to estimate travel time, distance, and get directions. A route calculator sources traffic and road network data from your chosen data provider.</p><note>
42/// <p>If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the <a href="http://aws.amazon.com/service-terms">Amazon Web Services service terms</a> for more details.</p>
43/// </note>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct CreateRouteCalculatorFluentBuilder {
46 handle: ::std::sync::Arc<crate::client::Handle>,
47 inner: crate::operation::create_route_calculator::builders::CreateRouteCalculatorInputBuilder,
48 config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51 crate::client::customize::internal::CustomizableSend<
52 crate::operation::create_route_calculator::CreateRouteCalculatorOutput,
53 crate::operation::create_route_calculator::CreateRouteCalculatorError,
54 > for CreateRouteCalculatorFluentBuilder
55{
56 fn send(
57 self,
58 config_override: crate::config::Builder,
59 ) -> crate::client::customize::internal::BoxFuture<
60 crate::client::customize::internal::SendResult<
61 crate::operation::create_route_calculator::CreateRouteCalculatorOutput,
62 crate::operation::create_route_calculator::CreateRouteCalculatorError,
63 >,
64 > {
65 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66 }
67}
68impl CreateRouteCalculatorFluentBuilder {
69 /// Creates a new `CreateRouteCalculatorFluentBuilder`.
70 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71 Self {
72 handle,
73 inner: ::std::default::Default::default(),
74 config_override: ::std::option::Option::None,
75 }
76 }
77 /// Access the CreateRouteCalculator as a reference.
78 pub fn as_input(&self) -> &crate::operation::create_route_calculator::builders::CreateRouteCalculatorInputBuilder {
79 &self.inner
80 }
81 /// Sends the request and returns the response.
82 ///
83 /// If an error occurs, an `SdkError` will be returned with additional details that
84 /// can be matched against.
85 ///
86 /// By default, any retryable failures will be retried twice. Retry behavior
87 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88 /// set when configuring the client.
89 pub async fn send(
90 self,
91 ) -> ::std::result::Result<
92 crate::operation::create_route_calculator::CreateRouteCalculatorOutput,
93 ::aws_smithy_runtime_api::client::result::SdkError<
94 crate::operation::create_route_calculator::CreateRouteCalculatorError,
95 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96 >,
97 > {
98 let input = self
99 .inner
100 .build()
101 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102 let runtime_plugins = crate::operation::create_route_calculator::CreateRouteCalculator::operation_runtime_plugins(
103 self.handle.runtime_plugins.clone(),
104 &self.handle.conf,
105 self.config_override,
106 );
107 crate::operation::create_route_calculator::CreateRouteCalculator::orchestrate(&runtime_plugins, input).await
108 }
109
110 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111 pub fn customize(
112 self,
113 ) -> crate::client::customize::CustomizableOperation<
114 crate::operation::create_route_calculator::CreateRouteCalculatorOutput,
115 crate::operation::create_route_calculator::CreateRouteCalculatorError,
116 Self,
117 > {
118 crate::client::customize::CustomizableOperation::new(self)
119 }
120 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121 self.set_config_override(::std::option::Option::Some(config_override.into()));
122 self
123 }
124
125 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126 self.config_override = config_override;
127 self
128 }
129 /// <p>The name of the route calculator resource.</p>
130 /// <p>Requirements:</p>
131 /// <ul>
132 /// <li>
133 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9) , hyphens (-), periods (.), and underscores (_).</p></li>
134 /// <li>
135 /// <p>Must be a unique Route calculator resource name.</p></li>
136 /// <li>
137 /// <p>No spaces allowed. For example, <code>ExampleRouteCalculator</code>.</p></li>
138 /// </ul>
139 pub fn calculator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.inner = self.inner.calculator_name(input.into());
141 self
142 }
143 /// <p>The name of the route calculator resource.</p>
144 /// <p>Requirements:</p>
145 /// <ul>
146 /// <li>
147 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9) , hyphens (-), periods (.), and underscores (_).</p></li>
148 /// <li>
149 /// <p>Must be a unique Route calculator resource name.</p></li>
150 /// <li>
151 /// <p>No spaces allowed. For example, <code>ExampleRouteCalculator</code>.</p></li>
152 /// </ul>
153 pub fn set_calculator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_calculator_name(input);
155 self
156 }
157 /// <p>The name of the route calculator resource.</p>
158 /// <p>Requirements:</p>
159 /// <ul>
160 /// <li>
161 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9) , hyphens (-), periods (.), and underscores (_).</p></li>
162 /// <li>
163 /// <p>Must be a unique Route calculator resource name.</p></li>
164 /// <li>
165 /// <p>No spaces allowed. For example, <code>ExampleRouteCalculator</code>.</p></li>
166 /// </ul>
167 pub fn get_calculator_name(&self) -> &::std::option::Option<::std::string::String> {
168 self.inner.get_calculator_name()
169 }
170 /// <p>Specifies the data provider of traffic and road network data.</p><note>
171 /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
172 /// </note>
173 /// <p>Valid values include:</p>
174 /// <ul>
175 /// <li>
176 /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://doc.arcgis.com/en/arcgis-online/reference/network-coverage.htm">Esri details on street networks and traffic coverage</a>.</p>
177 /// <p>Route calculators that use Esri as a data source only calculate routes that are shorter than 400 km.</p></li>
178 /// <li>
179 /// <p><code>Grab</code> – Grab provides routing functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
180 /// <li>
181 /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/car-routing.html">HERE car routing coverage</a> and <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/truck-routing.html">HERE truck routing coverage</a>.</p></li>
182 /// </ul>
183 /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service Developer Guide</i>.</p>
184 pub fn data_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.data_source(input.into());
186 self
187 }
188 /// <p>Specifies the data provider of traffic and road network data.</p><note>
189 /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
190 /// </note>
191 /// <p>Valid values include:</p>
192 /// <ul>
193 /// <li>
194 /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://doc.arcgis.com/en/arcgis-online/reference/network-coverage.htm">Esri details on street networks and traffic coverage</a>.</p>
195 /// <p>Route calculators that use Esri as a data source only calculate routes that are shorter than 400 km.</p></li>
196 /// <li>
197 /// <p><code>Grab</code> – Grab provides routing functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
198 /// <li>
199 /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/car-routing.html">HERE car routing coverage</a> and <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/truck-routing.html">HERE truck routing coverage</a>.</p></li>
200 /// </ul>
201 /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service Developer Guide</i>.</p>
202 pub fn set_data_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_data_source(input);
204 self
205 }
206 /// <p>Specifies the data provider of traffic and road network data.</p><note>
207 /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
208 /// </note>
209 /// <p>Valid values include:</p>
210 /// <ul>
211 /// <li>
212 /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://doc.arcgis.com/en/arcgis-online/reference/network-coverage.htm">Esri details on street networks and traffic coverage</a>.</p>
213 /// <p>Route calculators that use Esri as a data source only calculate routes that are shorter than 400 km.</p></li>
214 /// <li>
215 /// <p><code>Grab</code> – Grab provides routing functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
216 /// <li>
217 /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/car-routing.html">HERE car routing coverage</a> and <a href="https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/truck-routing.html">HERE truck routing coverage</a>.</p></li>
218 /// </ul>
219 /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service Developer Guide</i>.</p>
220 pub fn get_data_source(&self) -> &::std::option::Option<::std::string::String> {
221 self.inner.get_data_source()
222 }
223 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
224 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
225 pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
226 self.inner = self.inner.pricing_plan(input);
227 self
228 }
229 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
230 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
231 pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
232 self.inner = self.inner.set_pricing_plan(input);
233 self
234 }
235 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
236 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
237 pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
238 self.inner.get_pricing_plan()
239 }
240 /// <p>The optional description for the route calculator resource.</p>
241 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
242 self.inner = self.inner.description(input.into());
243 self
244 }
245 /// <p>The optional description for the route calculator resource.</p>
246 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247 self.inner = self.inner.set_description(input);
248 self
249 }
250 /// <p>The optional description for the route calculator resource.</p>
251 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
252 self.inner.get_description()
253 }
254 ///
255 /// Adds a key-value pair to `Tags`.
256 ///
257 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
258 ///
259 /// <p>Applies one or more tags to the route calculator resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
260 /// <ul>
261 /// <li>
262 /// <p>For example: { <code>"tag1" : "value1"</code>, <code>"tag2" : "value2"</code>}</p></li>
263 /// </ul>
264 /// <p>Format: <code>"key" : "value"</code></p>
265 /// <p>Restrictions:</p>
266 /// <ul>
267 /// <li>
268 /// <p>Maximum 50 tags per resource</p></li>
269 /// <li>
270 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
271 /// <li>
272 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
273 /// <li>
274 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
275 /// <li>
276 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
277 /// <li>
278 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
279 /// </ul>
280 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
281 self.inner = self.inner.tags(k.into(), v.into());
282 self
283 }
284 /// <p>Applies one or more tags to the route calculator resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
285 /// <ul>
286 /// <li>
287 /// <p>For example: { <code>"tag1" : "value1"</code>, <code>"tag2" : "value2"</code>}</p></li>
288 /// </ul>
289 /// <p>Format: <code>"key" : "value"</code></p>
290 /// <p>Restrictions:</p>
291 /// <ul>
292 /// <li>
293 /// <p>Maximum 50 tags per resource</p></li>
294 /// <li>
295 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
296 /// <li>
297 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
298 /// <li>
299 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
300 /// <li>
301 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
302 /// <li>
303 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
304 /// </ul>
305 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
306 self.inner = self.inner.set_tags(input);
307 self
308 }
309 /// <p>Applies one or more tags to the route calculator resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
310 /// <ul>
311 /// <li>
312 /// <p>For example: { <code>"tag1" : "value1"</code>, <code>"tag2" : "value2"</code>}</p></li>
313 /// </ul>
314 /// <p>Format: <code>"key" : "value"</code></p>
315 /// <p>Restrictions:</p>
316 /// <ul>
317 /// <li>
318 /// <p>Maximum 50 tags per resource</p></li>
319 /// <li>
320 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
321 /// <li>
322 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
323 /// <li>
324 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
325 /// <li>
326 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
327 /// <li>
328 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
329 /// </ul>
330 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
331 self.inner.get_tags()
332 }
333}