aws_sdk_location/operation/create_map/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_map::_create_map_output::CreateMapOutputBuilder;
3
4pub use crate::operation::create_map::_create_map_input::CreateMapInputBuilder;
5
6impl crate::operation::create_map::builders::CreateMapInputBuilder {
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_map::CreateMapOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_map::CreateMapError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_map();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateMap`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend upgrading to the Maps API V2 unless you require <code>Grab</code> data.</p>
27/// <ul>
28/// <li>
29/// <p><code>CreateMap</code> is part of a previous Amazon Location Service Maps API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The Maps API version 2 has a simplified interface that can be used without creating or managing map resources.</p></li>
32/// <li>
33/// <p>If you are using an AWS SDK or the AWS CLI, note that the Maps API version 2 is found under <code>geo-maps</code> or <code>geo_maps</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since <code>Grab</code> is not yet fully supported in Maps API version 2, we recommend you continue using API version 1 when using <code>Grab</code>.</p></li>
36/// <li>
37/// <p>Start your version 2 API journey with the <a href="https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Maps_V2.html">Maps V2 API Reference</a> or the <a href="https://docs.aws.amazon.com/location/latest/developerguide/maps.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p>Creates a map resource in your Amazon Web Services account, which provides map tiles of different styles sourced from global location data providers.</p><note>
41/// <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>
42/// </note>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct CreateMapFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::create_map::builders::CreateMapInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl crate::client::customize::internal::CustomizableSend<crate::operation::create_map::CreateMapOutput, crate::operation::create_map::CreateMapError>
50    for CreateMapFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<crate::operation::create_map::CreateMapOutput, crate::operation::create_map::CreateMapError>,
57    > {
58        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59    }
60}
61impl CreateMapFluentBuilder {
62    /// Creates a new `CreateMapFluentBuilder`.
63    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64        Self {
65            handle,
66            inner: ::std::default::Default::default(),
67            config_override: ::std::option::Option::None,
68        }
69    }
70    /// Access the CreateMap as a reference.
71    pub fn as_input(&self) -> &crate::operation::create_map::builders::CreateMapInputBuilder {
72        &self.inner
73    }
74    /// Sends the request and returns the response.
75    ///
76    /// If an error occurs, an `SdkError` will be returned with additional details that
77    /// can be matched against.
78    ///
79    /// By default, any retryable failures will be retried twice. Retry behavior
80    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81    /// set when configuring the client.
82    pub async fn send(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::create_map::CreateMapOutput,
86        ::aws_smithy_runtime_api::client::result::SdkError<
87            crate::operation::create_map::CreateMapError,
88            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89        >,
90    > {
91        let input = self
92            .inner
93            .build()
94            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95        let runtime_plugins = crate::operation::create_map::CreateMap::operation_runtime_plugins(
96            self.handle.runtime_plugins.clone(),
97            &self.handle.conf,
98            self.config_override,
99        );
100        crate::operation::create_map::CreateMap::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::create_map::CreateMapOutput,
108        crate::operation::create_map::CreateMapError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    /// <p>The name for the map resource.</p>
123    /// <p>Requirements:</p>
124    /// <ul>
125    /// <li>
126    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
127    /// <li>
128    /// <p>Must be a unique map resource name.</p></li>
129    /// <li>
130    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
131    /// </ul>
132    pub fn map_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.map_name(input.into());
134        self
135    }
136    /// <p>The name for the map resource.</p>
137    /// <p>Requirements:</p>
138    /// <ul>
139    /// <li>
140    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
141    /// <li>
142    /// <p>Must be a unique map resource name.</p></li>
143    /// <li>
144    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
145    /// </ul>
146    pub fn set_map_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_map_name(input);
148        self
149    }
150    /// <p>The name for the map resource.</p>
151    /// <p>Requirements:</p>
152    /// <ul>
153    /// <li>
154    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
155    /// <li>
156    /// <p>Must be a unique map resource name.</p></li>
157    /// <li>
158    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
159    /// </ul>
160    pub fn get_map_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_map_name()
162    }
163    /// <p>Specifies the <code>MapConfiguration</code>, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.</p>
164    pub fn configuration(mut self, input: crate::types::MapConfiguration) -> Self {
165        self.inner = self.inner.configuration(input);
166        self
167    }
168    /// <p>Specifies the <code>MapConfiguration</code>, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.</p>
169    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::MapConfiguration>) -> Self {
170        self.inner = self.inner.set_configuration(input);
171        self
172    }
173    /// <p>Specifies the <code>MapConfiguration</code>, including the map style, for the map resource that you create. The map style defines the look of maps and the data provider for your map resource.</p>
174    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::MapConfiguration> {
175        self.inner.get_configuration()
176    }
177    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
178    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
179    pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
180        self.inner = self.inner.pricing_plan(input);
181        self
182    }
183    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
184    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
185    pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
186        self.inner = self.inner.set_pricing_plan(input);
187        self
188    }
189    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
190    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
191    pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
192        self.inner.get_pricing_plan()
193    }
194    /// <p>An optional description for the map resource.</p>
195    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.description(input.into());
197        self
198    }
199    /// <p>An optional description for the map resource.</p>
200    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_description(input);
202        self
203    }
204    /// <p>An optional description for the map resource.</p>
205    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_description()
207    }
208    ///
209    /// Adds a key-value pair to `Tags`.
210    ///
211    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
212    ///
213    /// <p>Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
214    /// <p>Format: <code>"key" : "value"</code></p>
215    /// <p>Restrictions:</p>
216    /// <ul>
217    /// <li>
218    /// <p>Maximum 50 tags per resource</p></li>
219    /// <li>
220    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
221    /// <li>
222    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
223    /// <li>
224    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
225    /// <li>
226    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
227    /// <li>
228    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
229    /// </ul>
230    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.inner = self.inner.tags(k.into(), v.into());
232        self
233    }
234    /// <p>Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
235    /// <p>Format: <code>"key" : "value"</code></p>
236    /// <p>Restrictions:</p>
237    /// <ul>
238    /// <li>
239    /// <p>Maximum 50 tags per resource</p></li>
240    /// <li>
241    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
242    /// <li>
243    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
244    /// <li>
245    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
246    /// <li>
247    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
248    /// <li>
249    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
250    /// </ul>
251    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
252        self.inner = self.inner.set_tags(input);
253        self
254    }
255    /// <p>Applies one or more tags to the map resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
256    /// <p>Format: <code>"key" : "value"</code></p>
257    /// <p>Restrictions:</p>
258    /// <ul>
259    /// <li>
260    /// <p>Maximum 50 tags per resource</p></li>
261    /// <li>
262    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
263    /// <li>
264    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
265    /// <li>
266    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
267    /// <li>
268    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
269    /// <li>
270    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
271    /// </ul>
272    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
273        self.inner.get_tags()
274    }
275}