aws_sdk_location/operation/create_map/
_create_map_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, ::std::fmt::Debug)]
5pub struct CreateMapInput {
6    /// <p>The name for the map resource.</p>
7    /// <p>Requirements:</p>
8    /// <ul>
9    /// <li>
10    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
11    /// <li>
12    /// <p>Must be a unique map resource name.</p></li>
13    /// <li>
14    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
15    /// </ul>
16    pub map_name: ::std::option::Option<::std::string::String>,
17    /// <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>
18    pub configuration: ::std::option::Option<crate::types::MapConfiguration>,
19    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
20    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
21    pub pricing_plan: ::std::option::Option<crate::types::PricingPlan>,
22    /// <p>An optional description for the map resource.</p>
23    pub description: ::std::option::Option<::std::string::String>,
24    /// <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>
25    /// <p>Format: <code>"key" : "value"</code></p>
26    /// <p>Restrictions:</p>
27    /// <ul>
28    /// <li>
29    /// <p>Maximum 50 tags per resource</p></li>
30    /// <li>
31    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
32    /// <li>
33    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
34    /// <li>
35    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
36    /// <li>
37    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
38    /// <li>
39    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
40    /// </ul>
41    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
42}
43impl CreateMapInput {
44    /// <p>The name for the map resource.</p>
45    /// <p>Requirements:</p>
46    /// <ul>
47    /// <li>
48    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
49    /// <li>
50    /// <p>Must be a unique map resource name.</p></li>
51    /// <li>
52    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
53    /// </ul>
54    pub fn map_name(&self) -> ::std::option::Option<&str> {
55        self.map_name.as_deref()
56    }
57    /// <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>
58    pub fn configuration(&self) -> ::std::option::Option<&crate::types::MapConfiguration> {
59        self.configuration.as_ref()
60    }
61    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
62    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
63    pub fn pricing_plan(&self) -> ::std::option::Option<&crate::types::PricingPlan> {
64        self.pricing_plan.as_ref()
65    }
66    /// <p>An optional description for the map resource.</p>
67    pub fn description(&self) -> ::std::option::Option<&str> {
68        self.description.as_deref()
69    }
70    /// <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>
71    /// <p>Format: <code>"key" : "value"</code></p>
72    /// <p>Restrictions:</p>
73    /// <ul>
74    /// <li>
75    /// <p>Maximum 50 tags per resource</p></li>
76    /// <li>
77    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
78    /// <li>
79    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
80    /// <li>
81    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
82    /// <li>
83    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
84    /// <li>
85    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
86    /// </ul>
87    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
88        self.tags.as_ref()
89    }
90}
91impl CreateMapInput {
92    /// Creates a new builder-style object to manufacture [`CreateMapInput`](crate::operation::create_map::CreateMapInput).
93    pub fn builder() -> crate::operation::create_map::builders::CreateMapInputBuilder {
94        crate::operation::create_map::builders::CreateMapInputBuilder::default()
95    }
96}
97
98/// A builder for [`CreateMapInput`](crate::operation::create_map::CreateMapInput).
99#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
100#[non_exhaustive]
101pub struct CreateMapInputBuilder {
102    pub(crate) map_name: ::std::option::Option<::std::string::String>,
103    pub(crate) configuration: ::std::option::Option<crate::types::MapConfiguration>,
104    pub(crate) pricing_plan: ::std::option::Option<crate::types::PricingPlan>,
105    pub(crate) description: ::std::option::Option<::std::string::String>,
106    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
107}
108impl CreateMapInputBuilder {
109    /// <p>The name for the map resource.</p>
110    /// <p>Requirements:</p>
111    /// <ul>
112    /// <li>
113    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
114    /// <li>
115    /// <p>Must be a unique map resource name.</p></li>
116    /// <li>
117    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
118    /// </ul>
119    /// This field is required.
120    pub fn map_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.map_name = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The name for the map resource.</p>
125    /// <p>Requirements:</p>
126    /// <ul>
127    /// <li>
128    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
129    /// <li>
130    /// <p>Must be a unique map resource name.</p></li>
131    /// <li>
132    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
133    /// </ul>
134    pub fn set_map_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.map_name = input;
136        self
137    }
138    /// <p>The name for the map resource.</p>
139    /// <p>Requirements:</p>
140    /// <ul>
141    /// <li>
142    /// <p>Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
143    /// <li>
144    /// <p>Must be a unique map resource name.</p></li>
145    /// <li>
146    /// <p>No spaces allowed. For example, <code>ExampleMap</code>.</p></li>
147    /// </ul>
148    pub fn get_map_name(&self) -> &::std::option::Option<::std::string::String> {
149        &self.map_name
150    }
151    /// <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>
152    /// This field is required.
153    pub fn configuration(mut self, input: crate::types::MapConfiguration) -> Self {
154        self.configuration = ::std::option::Option::Some(input);
155        self
156    }
157    /// <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>
158    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::MapConfiguration>) -> Self {
159        self.configuration = input;
160        self
161    }
162    /// <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>
163    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::MapConfiguration> {
164        &self.configuration
165    }
166    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
167    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
168    pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
169        self.pricing_plan = ::std::option::Option::Some(input);
170        self
171    }
172    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
173    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
174    pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
175        self.pricing_plan = input;
176        self
177    }
178    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
179    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
180    pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
181        &self.pricing_plan
182    }
183    /// <p>An optional description for the map resource.</p>
184    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.description = ::std::option::Option::Some(input.into());
186        self
187    }
188    /// <p>An optional description for the map resource.</p>
189    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.description = input;
191        self
192    }
193    /// <p>An optional description for the map resource.</p>
194    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
195        &self.description
196    }
197    /// Adds a key-value pair to `tags`.
198    ///
199    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
200    ///
201    /// <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>
202    /// <p>Format: <code>"key" : "value"</code></p>
203    /// <p>Restrictions:</p>
204    /// <ul>
205    /// <li>
206    /// <p>Maximum 50 tags per resource</p></li>
207    /// <li>
208    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
209    /// <li>
210    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
211    /// <li>
212    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
213    /// <li>
214    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
215    /// <li>
216    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
217    /// </ul>
218    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
219        let mut hash_map = self.tags.unwrap_or_default();
220        hash_map.insert(k.into(), v.into());
221        self.tags = ::std::option::Option::Some(hash_map);
222        self
223    }
224    /// <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>
225    /// <p>Format: <code>"key" : "value"</code></p>
226    /// <p>Restrictions:</p>
227    /// <ul>
228    /// <li>
229    /// <p>Maximum 50 tags per resource</p></li>
230    /// <li>
231    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
232    /// <li>
233    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
234    /// <li>
235    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
236    /// <li>
237    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
238    /// <li>
239    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
240    /// </ul>
241    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
242        self.tags = input;
243        self
244    }
245    /// <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>
246    /// <p>Format: <code>"key" : "value"</code></p>
247    /// <p>Restrictions:</p>
248    /// <ul>
249    /// <li>
250    /// <p>Maximum 50 tags per resource</p></li>
251    /// <li>
252    /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
253    /// <li>
254    /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
255    /// <li>
256    /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
257    /// <li>
258    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
259    /// <li>
260    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
261    /// </ul>
262    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
263        &self.tags
264    }
265    /// Consumes the builder and constructs a [`CreateMapInput`](crate::operation::create_map::CreateMapInput).
266    pub fn build(self) -> ::std::result::Result<crate::operation::create_map::CreateMapInput, ::aws_smithy_types::error::operation::BuildError> {
267        ::std::result::Result::Ok(crate::operation::create_map::CreateMapInput {
268            map_name: self.map_name,
269            configuration: self.configuration,
270            pricing_plan: self.pricing_plan,
271            description: self.description,
272            tags: self.tags,
273        })
274    }
275}