aws_sdk_location/types/_api_key_restrictions.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>API Restrictions on the allowed actions, resources, and referers for an API key resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ApiKeyRestrictions {
7 /// <p>A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.</p>
8 /// <p>The following are valid values for the actions.</p>
9 /// <ul>
10 /// <li>
11 /// <p><b>Map actions</b></p>
12 /// <ul>
13 /// <li>
14 /// <p><code>geo:GetMap*</code> - Allows all actions needed for map rendering.</p></li>
15 /// <li>
16 /// <p><code>geo-maps:GetTile</code> - Allows retrieving map tiles.</p></li>
17 /// <li>
18 /// <p><code>geo-maps:GetStaticMap</code> - Allows retrieving static map images.</p></li>
19 /// <li>
20 /// <p><code>geo-maps:*</code> - Allows all actions related to map functionalities.</p></li>
21 /// </ul></li>
22 /// <li>
23 /// <p><b>Place actions</b></p>
24 /// <ul>
25 /// <li>
26 /// <p><code>geo:SearchPlaceIndexForText</code> - Allows geocoding.</p></li>
27 /// <li>
28 /// <p><code>geo:SearchPlaceIndexForPosition</code> - Allows reverse geocoding.</p></li>
29 /// <li>
30 /// <p><code>geo:SearchPlaceIndexForSuggestions</code> - Allows generating suggestions from text.</p></li>
31 /// <li>
32 /// <p><code>GetPlace</code> - Allows finding a place by place ID.</p></li>
33 /// <li>
34 /// <p><code>geo-places:Geocode</code> - Allows geocoding using place information.</p></li>
35 /// <li>
36 /// <p><code>geo-places:ReverseGeocode</code> - Allows reverse geocoding from location coordinates.</p></li>
37 /// <li>
38 /// <p><code>geo-places:SearchNearby</code> - Allows searching for places near a location.</p></li>
39 /// <li>
40 /// <p><code>geo-places:SearchText</code> - Allows searching for places based on text input.</p></li>
41 /// <li>
42 /// <p><code>geo-places:Autocomplete</code> - Allows auto-completion of place names based on text input.</p></li>
43 /// <li>
44 /// <p><code>geo-places:Suggest</code> - Allows generating suggestions for places based on partial input.</p></li>
45 /// <li>
46 /// <p><code>geo-places:GetPlace</code> - Allows finding a place by its ID.</p></li>
47 /// <li>
48 /// <p><code>geo-places:*</code> - Allows all actions related to place services.</p></li>
49 /// </ul></li>
50 /// <li>
51 /// <p><b>Route actions</b></p>
52 /// <ul>
53 /// <li>
54 /// <p><code>geo:CalculateRoute</code> - Allows point to point routing.</p></li>
55 /// <li>
56 /// <p><code>geo:CalculateRouteMatrix</code> - Allows calculating a matrix of routes.</p></li>
57 /// <li>
58 /// <p><code>geo-routes:CalculateRoutes</code> - Allows calculating multiple routes between points.</p></li>
59 /// <li>
60 /// <p><code>geo-routes:CalculateRouteMatrix</code> - Allows calculating a matrix of routes between points.</p></li>
61 /// <li>
62 /// <p><code>geo-routes:CalculateIsolines</code> - Allows calculating isolines for a given area.</p></li>
63 /// <li>
64 /// <p><code>geo-routes:OptimizeWaypoints</code> - Allows optimizing the order of waypoints in a route.</p></li>
65 /// <li>
66 /// <p><code>geo-routes:SnapToRoads</code> - Allows snapping a route to the nearest roads.</p></li>
67 /// <li>
68 /// <p><code>geo-routes:*</code> - Allows all actions related to routing functionalities.</p></li>
69 /// </ul></li>
70 /// </ul><note>
71 /// <p>You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>\["geo:GetMap*"\]</code> is valid but <code>\["geo:GetMapTile"\]</code> is not. Similarly, you cannot use <code>\["geo:SearchPlaceIndexFor*"\]</code> - you must list each of the Place actions separately.</p>
72 /// </note>
73 pub allow_actions: ::std::vec::Vec<::std::string::String>,
74 /// <p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>
75 /// <ul>
76 /// <li>
77 /// <p>The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.</p></li>
78 /// <li>
79 /// <p>The resources must be in the same <code>partition</code>, <code>region</code>, and <code>account-id</code> as the key that is being created.</p></li>
80 /// <li>
81 /// <p>Other than wildcards, you must include the full ARN, including the <code>arn</code>, <code>partition</code>, <code>service</code>, <code>region</code>, <code>account-id</code> and <code>resource-id</code> delimited by colons (:).</p></li>
82 /// <li>
83 /// <p>No spaces allowed, even with wildcards. For example, <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p></li>
84 /// </ul>
85 /// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
86 pub allow_resources: ::std::vec::Vec<::std::string::String>,
87 /// <p>An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.</p>
88 /// <p>Requirements:</p>
89 /// <ul>
90 /// <li>
91 /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list <code>$\-._+!*`(),;/?:@=&</code></p></li>
92 /// <li>
93 /// <p>May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.</p></li>
94 /// <li>
95 /// <p>May contain wildcard characters question mark (?) and asterisk (*).</p>
96 /// <p>Question mark (?) will replace any single character (including hexadecimal digits).</p>
97 /// <p>Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).</p></li>
98 /// <li>
99 /// <p>No spaces allowed. For example, <code>https://example.com</code>.</p></li>
100 /// </ul>
101 pub allow_referers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
102 /// <p>An optional list of allowed Android applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
103 pub allow_android_apps: ::std::option::Option<::std::vec::Vec<crate::types::AndroidApp>>,
104 /// <p>An optional list of allowed Apple applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
105 pub allow_apple_apps: ::std::option::Option<::std::vec::Vec<crate::types::AppleApp>>,
106}
107impl ApiKeyRestrictions {
108 /// <p>A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.</p>
109 /// <p>The following are valid values for the actions.</p>
110 /// <ul>
111 /// <li>
112 /// <p><b>Map actions</b></p>
113 /// <ul>
114 /// <li>
115 /// <p><code>geo:GetMap*</code> - Allows all actions needed for map rendering.</p></li>
116 /// <li>
117 /// <p><code>geo-maps:GetTile</code> - Allows retrieving map tiles.</p></li>
118 /// <li>
119 /// <p><code>geo-maps:GetStaticMap</code> - Allows retrieving static map images.</p></li>
120 /// <li>
121 /// <p><code>geo-maps:*</code> - Allows all actions related to map functionalities.</p></li>
122 /// </ul></li>
123 /// <li>
124 /// <p><b>Place actions</b></p>
125 /// <ul>
126 /// <li>
127 /// <p><code>geo:SearchPlaceIndexForText</code> - Allows geocoding.</p></li>
128 /// <li>
129 /// <p><code>geo:SearchPlaceIndexForPosition</code> - Allows reverse geocoding.</p></li>
130 /// <li>
131 /// <p><code>geo:SearchPlaceIndexForSuggestions</code> - Allows generating suggestions from text.</p></li>
132 /// <li>
133 /// <p><code>GetPlace</code> - Allows finding a place by place ID.</p></li>
134 /// <li>
135 /// <p><code>geo-places:Geocode</code> - Allows geocoding using place information.</p></li>
136 /// <li>
137 /// <p><code>geo-places:ReverseGeocode</code> - Allows reverse geocoding from location coordinates.</p></li>
138 /// <li>
139 /// <p><code>geo-places:SearchNearby</code> - Allows searching for places near a location.</p></li>
140 /// <li>
141 /// <p><code>geo-places:SearchText</code> - Allows searching for places based on text input.</p></li>
142 /// <li>
143 /// <p><code>geo-places:Autocomplete</code> - Allows auto-completion of place names based on text input.</p></li>
144 /// <li>
145 /// <p><code>geo-places:Suggest</code> - Allows generating suggestions for places based on partial input.</p></li>
146 /// <li>
147 /// <p><code>geo-places:GetPlace</code> - Allows finding a place by its ID.</p></li>
148 /// <li>
149 /// <p><code>geo-places:*</code> - Allows all actions related to place services.</p></li>
150 /// </ul></li>
151 /// <li>
152 /// <p><b>Route actions</b></p>
153 /// <ul>
154 /// <li>
155 /// <p><code>geo:CalculateRoute</code> - Allows point to point routing.</p></li>
156 /// <li>
157 /// <p><code>geo:CalculateRouteMatrix</code> - Allows calculating a matrix of routes.</p></li>
158 /// <li>
159 /// <p><code>geo-routes:CalculateRoutes</code> - Allows calculating multiple routes between points.</p></li>
160 /// <li>
161 /// <p><code>geo-routes:CalculateRouteMatrix</code> - Allows calculating a matrix of routes between points.</p></li>
162 /// <li>
163 /// <p><code>geo-routes:CalculateIsolines</code> - Allows calculating isolines for a given area.</p></li>
164 /// <li>
165 /// <p><code>geo-routes:OptimizeWaypoints</code> - Allows optimizing the order of waypoints in a route.</p></li>
166 /// <li>
167 /// <p><code>geo-routes:SnapToRoads</code> - Allows snapping a route to the nearest roads.</p></li>
168 /// <li>
169 /// <p><code>geo-routes:*</code> - Allows all actions related to routing functionalities.</p></li>
170 /// </ul></li>
171 /// </ul><note>
172 /// <p>You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>\["geo:GetMap*"\]</code> is valid but <code>\["geo:GetMapTile"\]</code> is not. Similarly, you cannot use <code>\["geo:SearchPlaceIndexFor*"\]</code> - you must list each of the Place actions separately.</p>
173 /// </note>
174 pub fn allow_actions(&self) -> &[::std::string::String] {
175 use std::ops::Deref;
176 self.allow_actions.deref()
177 }
178 /// <p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>
179 /// <ul>
180 /// <li>
181 /// <p>The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.</p></li>
182 /// <li>
183 /// <p>The resources must be in the same <code>partition</code>, <code>region</code>, and <code>account-id</code> as the key that is being created.</p></li>
184 /// <li>
185 /// <p>Other than wildcards, you must include the full ARN, including the <code>arn</code>, <code>partition</code>, <code>service</code>, <code>region</code>, <code>account-id</code> and <code>resource-id</code> delimited by colons (:).</p></li>
186 /// <li>
187 /// <p>No spaces allowed, even with wildcards. For example, <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p></li>
188 /// </ul>
189 /// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
190 pub fn allow_resources(&self) -> &[::std::string::String] {
191 use std::ops::Deref;
192 self.allow_resources.deref()
193 }
194 /// <p>An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.</p>
195 /// <p>Requirements:</p>
196 /// <ul>
197 /// <li>
198 /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list <code>$\-._+!*`(),;/?:@=&</code></p></li>
199 /// <li>
200 /// <p>May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.</p></li>
201 /// <li>
202 /// <p>May contain wildcard characters question mark (?) and asterisk (*).</p>
203 /// <p>Question mark (?) will replace any single character (including hexadecimal digits).</p>
204 /// <p>Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).</p></li>
205 /// <li>
206 /// <p>No spaces allowed. For example, <code>https://example.com</code>.</p></li>
207 /// </ul>
208 ///
209 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.allow_referers.is_none()`.
210 pub fn allow_referers(&self) -> &[::std::string::String] {
211 self.allow_referers.as_deref().unwrap_or_default()
212 }
213 /// <p>An optional list of allowed Android applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
214 ///
215 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.allow_android_apps.is_none()`.
216 pub fn allow_android_apps(&self) -> &[crate::types::AndroidApp] {
217 self.allow_android_apps.as_deref().unwrap_or_default()
218 }
219 /// <p>An optional list of allowed Apple applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
220 ///
221 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.allow_apple_apps.is_none()`.
222 pub fn allow_apple_apps(&self) -> &[crate::types::AppleApp] {
223 self.allow_apple_apps.as_deref().unwrap_or_default()
224 }
225}
226impl ApiKeyRestrictions {
227 /// Creates a new builder-style object to manufacture [`ApiKeyRestrictions`](crate::types::ApiKeyRestrictions).
228 pub fn builder() -> crate::types::builders::ApiKeyRestrictionsBuilder {
229 crate::types::builders::ApiKeyRestrictionsBuilder::default()
230 }
231}
232
233/// A builder for [`ApiKeyRestrictions`](crate::types::ApiKeyRestrictions).
234#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
235#[non_exhaustive]
236pub struct ApiKeyRestrictionsBuilder {
237 pub(crate) allow_actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
238 pub(crate) allow_resources: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
239 pub(crate) allow_referers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
240 pub(crate) allow_android_apps: ::std::option::Option<::std::vec::Vec<crate::types::AndroidApp>>,
241 pub(crate) allow_apple_apps: ::std::option::Option<::std::vec::Vec<crate::types::AppleApp>>,
242}
243impl ApiKeyRestrictionsBuilder {
244 /// Appends an item to `allow_actions`.
245 ///
246 /// To override the contents of this collection use [`set_allow_actions`](Self::set_allow_actions).
247 ///
248 /// <p>A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.</p>
249 /// <p>The following are valid values for the actions.</p>
250 /// <ul>
251 /// <li>
252 /// <p><b>Map actions</b></p>
253 /// <ul>
254 /// <li>
255 /// <p><code>geo:GetMap*</code> - Allows all actions needed for map rendering.</p></li>
256 /// <li>
257 /// <p><code>geo-maps:GetTile</code> - Allows retrieving map tiles.</p></li>
258 /// <li>
259 /// <p><code>geo-maps:GetStaticMap</code> - Allows retrieving static map images.</p></li>
260 /// <li>
261 /// <p><code>geo-maps:*</code> - Allows all actions related to map functionalities.</p></li>
262 /// </ul></li>
263 /// <li>
264 /// <p><b>Place actions</b></p>
265 /// <ul>
266 /// <li>
267 /// <p><code>geo:SearchPlaceIndexForText</code> - Allows geocoding.</p></li>
268 /// <li>
269 /// <p><code>geo:SearchPlaceIndexForPosition</code> - Allows reverse geocoding.</p></li>
270 /// <li>
271 /// <p><code>geo:SearchPlaceIndexForSuggestions</code> - Allows generating suggestions from text.</p></li>
272 /// <li>
273 /// <p><code>GetPlace</code> - Allows finding a place by place ID.</p></li>
274 /// <li>
275 /// <p><code>geo-places:Geocode</code> - Allows geocoding using place information.</p></li>
276 /// <li>
277 /// <p><code>geo-places:ReverseGeocode</code> - Allows reverse geocoding from location coordinates.</p></li>
278 /// <li>
279 /// <p><code>geo-places:SearchNearby</code> - Allows searching for places near a location.</p></li>
280 /// <li>
281 /// <p><code>geo-places:SearchText</code> - Allows searching for places based on text input.</p></li>
282 /// <li>
283 /// <p><code>geo-places:Autocomplete</code> - Allows auto-completion of place names based on text input.</p></li>
284 /// <li>
285 /// <p><code>geo-places:Suggest</code> - Allows generating suggestions for places based on partial input.</p></li>
286 /// <li>
287 /// <p><code>geo-places:GetPlace</code> - Allows finding a place by its ID.</p></li>
288 /// <li>
289 /// <p><code>geo-places:*</code> - Allows all actions related to place services.</p></li>
290 /// </ul></li>
291 /// <li>
292 /// <p><b>Route actions</b></p>
293 /// <ul>
294 /// <li>
295 /// <p><code>geo:CalculateRoute</code> - Allows point to point routing.</p></li>
296 /// <li>
297 /// <p><code>geo:CalculateRouteMatrix</code> - Allows calculating a matrix of routes.</p></li>
298 /// <li>
299 /// <p><code>geo-routes:CalculateRoutes</code> - Allows calculating multiple routes between points.</p></li>
300 /// <li>
301 /// <p><code>geo-routes:CalculateRouteMatrix</code> - Allows calculating a matrix of routes between points.</p></li>
302 /// <li>
303 /// <p><code>geo-routes:CalculateIsolines</code> - Allows calculating isolines for a given area.</p></li>
304 /// <li>
305 /// <p><code>geo-routes:OptimizeWaypoints</code> - Allows optimizing the order of waypoints in a route.</p></li>
306 /// <li>
307 /// <p><code>geo-routes:SnapToRoads</code> - Allows snapping a route to the nearest roads.</p></li>
308 /// <li>
309 /// <p><code>geo-routes:*</code> - Allows all actions related to routing functionalities.</p></li>
310 /// </ul></li>
311 /// </ul><note>
312 /// <p>You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>\["geo:GetMap*"\]</code> is valid but <code>\["geo:GetMapTile"\]</code> is not. Similarly, you cannot use <code>\["geo:SearchPlaceIndexFor*"\]</code> - you must list each of the Place actions separately.</p>
313 /// </note>
314 pub fn allow_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315 let mut v = self.allow_actions.unwrap_or_default();
316 v.push(input.into());
317 self.allow_actions = ::std::option::Option::Some(v);
318 self
319 }
320 /// <p>A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.</p>
321 /// <p>The following are valid values for the actions.</p>
322 /// <ul>
323 /// <li>
324 /// <p><b>Map actions</b></p>
325 /// <ul>
326 /// <li>
327 /// <p><code>geo:GetMap*</code> - Allows all actions needed for map rendering.</p></li>
328 /// <li>
329 /// <p><code>geo-maps:GetTile</code> - Allows retrieving map tiles.</p></li>
330 /// <li>
331 /// <p><code>geo-maps:GetStaticMap</code> - Allows retrieving static map images.</p></li>
332 /// <li>
333 /// <p><code>geo-maps:*</code> - Allows all actions related to map functionalities.</p></li>
334 /// </ul></li>
335 /// <li>
336 /// <p><b>Place actions</b></p>
337 /// <ul>
338 /// <li>
339 /// <p><code>geo:SearchPlaceIndexForText</code> - Allows geocoding.</p></li>
340 /// <li>
341 /// <p><code>geo:SearchPlaceIndexForPosition</code> - Allows reverse geocoding.</p></li>
342 /// <li>
343 /// <p><code>geo:SearchPlaceIndexForSuggestions</code> - Allows generating suggestions from text.</p></li>
344 /// <li>
345 /// <p><code>GetPlace</code> - Allows finding a place by place ID.</p></li>
346 /// <li>
347 /// <p><code>geo-places:Geocode</code> - Allows geocoding using place information.</p></li>
348 /// <li>
349 /// <p><code>geo-places:ReverseGeocode</code> - Allows reverse geocoding from location coordinates.</p></li>
350 /// <li>
351 /// <p><code>geo-places:SearchNearby</code> - Allows searching for places near a location.</p></li>
352 /// <li>
353 /// <p><code>geo-places:SearchText</code> - Allows searching for places based on text input.</p></li>
354 /// <li>
355 /// <p><code>geo-places:Autocomplete</code> - Allows auto-completion of place names based on text input.</p></li>
356 /// <li>
357 /// <p><code>geo-places:Suggest</code> - Allows generating suggestions for places based on partial input.</p></li>
358 /// <li>
359 /// <p><code>geo-places:GetPlace</code> - Allows finding a place by its ID.</p></li>
360 /// <li>
361 /// <p><code>geo-places:*</code> - Allows all actions related to place services.</p></li>
362 /// </ul></li>
363 /// <li>
364 /// <p><b>Route actions</b></p>
365 /// <ul>
366 /// <li>
367 /// <p><code>geo:CalculateRoute</code> - Allows point to point routing.</p></li>
368 /// <li>
369 /// <p><code>geo:CalculateRouteMatrix</code> - Allows calculating a matrix of routes.</p></li>
370 /// <li>
371 /// <p><code>geo-routes:CalculateRoutes</code> - Allows calculating multiple routes between points.</p></li>
372 /// <li>
373 /// <p><code>geo-routes:CalculateRouteMatrix</code> - Allows calculating a matrix of routes between points.</p></li>
374 /// <li>
375 /// <p><code>geo-routes:CalculateIsolines</code> - Allows calculating isolines for a given area.</p></li>
376 /// <li>
377 /// <p><code>geo-routes:OptimizeWaypoints</code> - Allows optimizing the order of waypoints in a route.</p></li>
378 /// <li>
379 /// <p><code>geo-routes:SnapToRoads</code> - Allows snapping a route to the nearest roads.</p></li>
380 /// <li>
381 /// <p><code>geo-routes:*</code> - Allows all actions related to routing functionalities.</p></li>
382 /// </ul></li>
383 /// </ul><note>
384 /// <p>You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>\["geo:GetMap*"\]</code> is valid but <code>\["geo:GetMapTile"\]</code> is not. Similarly, you cannot use <code>\["geo:SearchPlaceIndexFor*"\]</code> - you must list each of the Place actions separately.</p>
385 /// </note>
386 pub fn set_allow_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
387 self.allow_actions = input;
388 self
389 }
390 /// <p>A list of allowed actions that an API key resource grants permissions to perform. You must have at least one action for each type of resource. For example, if you have a place resource, you must include at least one place action.</p>
391 /// <p>The following are valid values for the actions.</p>
392 /// <ul>
393 /// <li>
394 /// <p><b>Map actions</b></p>
395 /// <ul>
396 /// <li>
397 /// <p><code>geo:GetMap*</code> - Allows all actions needed for map rendering.</p></li>
398 /// <li>
399 /// <p><code>geo-maps:GetTile</code> - Allows retrieving map tiles.</p></li>
400 /// <li>
401 /// <p><code>geo-maps:GetStaticMap</code> - Allows retrieving static map images.</p></li>
402 /// <li>
403 /// <p><code>geo-maps:*</code> - Allows all actions related to map functionalities.</p></li>
404 /// </ul></li>
405 /// <li>
406 /// <p><b>Place actions</b></p>
407 /// <ul>
408 /// <li>
409 /// <p><code>geo:SearchPlaceIndexForText</code> - Allows geocoding.</p></li>
410 /// <li>
411 /// <p><code>geo:SearchPlaceIndexForPosition</code> - Allows reverse geocoding.</p></li>
412 /// <li>
413 /// <p><code>geo:SearchPlaceIndexForSuggestions</code> - Allows generating suggestions from text.</p></li>
414 /// <li>
415 /// <p><code>GetPlace</code> - Allows finding a place by place ID.</p></li>
416 /// <li>
417 /// <p><code>geo-places:Geocode</code> - Allows geocoding using place information.</p></li>
418 /// <li>
419 /// <p><code>geo-places:ReverseGeocode</code> - Allows reverse geocoding from location coordinates.</p></li>
420 /// <li>
421 /// <p><code>geo-places:SearchNearby</code> - Allows searching for places near a location.</p></li>
422 /// <li>
423 /// <p><code>geo-places:SearchText</code> - Allows searching for places based on text input.</p></li>
424 /// <li>
425 /// <p><code>geo-places:Autocomplete</code> - Allows auto-completion of place names based on text input.</p></li>
426 /// <li>
427 /// <p><code>geo-places:Suggest</code> - Allows generating suggestions for places based on partial input.</p></li>
428 /// <li>
429 /// <p><code>geo-places:GetPlace</code> - Allows finding a place by its ID.</p></li>
430 /// <li>
431 /// <p><code>geo-places:*</code> - Allows all actions related to place services.</p></li>
432 /// </ul></li>
433 /// <li>
434 /// <p><b>Route actions</b></p>
435 /// <ul>
436 /// <li>
437 /// <p><code>geo:CalculateRoute</code> - Allows point to point routing.</p></li>
438 /// <li>
439 /// <p><code>geo:CalculateRouteMatrix</code> - Allows calculating a matrix of routes.</p></li>
440 /// <li>
441 /// <p><code>geo-routes:CalculateRoutes</code> - Allows calculating multiple routes between points.</p></li>
442 /// <li>
443 /// <p><code>geo-routes:CalculateRouteMatrix</code> - Allows calculating a matrix of routes between points.</p></li>
444 /// <li>
445 /// <p><code>geo-routes:CalculateIsolines</code> - Allows calculating isolines for a given area.</p></li>
446 /// <li>
447 /// <p><code>geo-routes:OptimizeWaypoints</code> - Allows optimizing the order of waypoints in a route.</p></li>
448 /// <li>
449 /// <p><code>geo-routes:SnapToRoads</code> - Allows snapping a route to the nearest roads.</p></li>
450 /// <li>
451 /// <p><code>geo-routes:*</code> - Allows all actions related to routing functionalities.</p></li>
452 /// </ul></li>
453 /// </ul><note>
454 /// <p>You must use these strings exactly. For example, to provide access to map rendering, the only valid action is <code>geo:GetMap*</code> as an input to the list. <code>\["geo:GetMap*"\]</code> is valid but <code>\["geo:GetMapTile"\]</code> is not. Similarly, you cannot use <code>\["geo:SearchPlaceIndexFor*"\]</code> - you must list each of the Place actions separately.</p>
455 /// </note>
456 pub fn get_allow_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
457 &self.allow_actions
458 }
459 /// Appends an item to `allow_resources`.
460 ///
461 /// To override the contents of this collection use [`set_allow_resources`](Self::set_allow_resources).
462 ///
463 /// <p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>
464 /// <ul>
465 /// <li>
466 /// <p>The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.</p></li>
467 /// <li>
468 /// <p>The resources must be in the same <code>partition</code>, <code>region</code>, and <code>account-id</code> as the key that is being created.</p></li>
469 /// <li>
470 /// <p>Other than wildcards, you must include the full ARN, including the <code>arn</code>, <code>partition</code>, <code>service</code>, <code>region</code>, <code>account-id</code> and <code>resource-id</code> delimited by colons (:).</p></li>
471 /// <li>
472 /// <p>No spaces allowed, even with wildcards. For example, <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p></li>
473 /// </ul>
474 /// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
475 pub fn allow_resources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
476 let mut v = self.allow_resources.unwrap_or_default();
477 v.push(input.into());
478 self.allow_resources = ::std::option::Option::Some(v);
479 self
480 }
481 /// <p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>
482 /// <ul>
483 /// <li>
484 /// <p>The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.</p></li>
485 /// <li>
486 /// <p>The resources must be in the same <code>partition</code>, <code>region</code>, and <code>account-id</code> as the key that is being created.</p></li>
487 /// <li>
488 /// <p>Other than wildcards, you must include the full ARN, including the <code>arn</code>, <code>partition</code>, <code>service</code>, <code>region</code>, <code>account-id</code> and <code>resource-id</code> delimited by colons (:).</p></li>
489 /// <li>
490 /// <p>No spaces allowed, even with wildcards. For example, <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p></li>
491 /// </ul>
492 /// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
493 pub fn set_allow_resources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
494 self.allow_resources = input;
495 self
496 }
497 /// <p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>
498 /// <ul>
499 /// <li>
500 /// <p>The ARN must be the correct ARN for a map, place, or route ARN. You may include wildcards in the resource-id to match multiple resources of the same type.</p></li>
501 /// <li>
502 /// <p>The resources must be in the same <code>partition</code>, <code>region</code>, and <code>account-id</code> as the key that is being created.</p></li>
503 /// <li>
504 /// <p>Other than wildcards, you must include the full ARN, including the <code>arn</code>, <code>partition</code>, <code>service</code>, <code>region</code>, <code>account-id</code> and <code>resource-id</code> delimited by colons (:).</p></li>
505 /// <li>
506 /// <p>No spaces allowed, even with wildcards. For example, <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p></li>
507 /// </ul>
508 /// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
509 pub fn get_allow_resources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
510 &self.allow_resources
511 }
512 /// Appends an item to `allow_referers`.
513 ///
514 /// To override the contents of this collection use [`set_allow_referers`](Self::set_allow_referers).
515 ///
516 /// <p>An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.</p>
517 /// <p>Requirements:</p>
518 /// <ul>
519 /// <li>
520 /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list <code>$\-._+!*`(),;/?:@=&</code></p></li>
521 /// <li>
522 /// <p>May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.</p></li>
523 /// <li>
524 /// <p>May contain wildcard characters question mark (?) and asterisk (*).</p>
525 /// <p>Question mark (?) will replace any single character (including hexadecimal digits).</p>
526 /// <p>Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).</p></li>
527 /// <li>
528 /// <p>No spaces allowed. For example, <code>https://example.com</code>.</p></li>
529 /// </ul>
530 pub fn allow_referers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
531 let mut v = self.allow_referers.unwrap_or_default();
532 v.push(input.into());
533 self.allow_referers = ::std::option::Option::Some(v);
534 self
535 }
536 /// <p>An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.</p>
537 /// <p>Requirements:</p>
538 /// <ul>
539 /// <li>
540 /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list <code>$\-._+!*`(),;/?:@=&</code></p></li>
541 /// <li>
542 /// <p>May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.</p></li>
543 /// <li>
544 /// <p>May contain wildcard characters question mark (?) and asterisk (*).</p>
545 /// <p>Question mark (?) will replace any single character (including hexadecimal digits).</p>
546 /// <p>Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).</p></li>
547 /// <li>
548 /// <p>No spaces allowed. For example, <code>https://example.com</code>.</p></li>
549 /// </ul>
550 pub fn set_allow_referers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
551 self.allow_referers = input;
552 self
553 }
554 /// <p>An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.</p>
555 /// <p>Requirements:</p>
556 /// <ul>
557 /// <li>
558 /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list <code>$\-._+!*`(),;/?:@=&</code></p></li>
559 /// <li>
560 /// <p>May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.</p></li>
561 /// <li>
562 /// <p>May contain wildcard characters question mark (?) and asterisk (*).</p>
563 /// <p>Question mark (?) will replace any single character (including hexadecimal digits).</p>
564 /// <p>Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).</p></li>
565 /// <li>
566 /// <p>No spaces allowed. For example, <code>https://example.com</code>.</p></li>
567 /// </ul>
568 pub fn get_allow_referers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
569 &self.allow_referers
570 }
571 /// Appends an item to `allow_android_apps`.
572 ///
573 /// To override the contents of this collection use [`set_allow_android_apps`](Self::set_allow_android_apps).
574 ///
575 /// <p>An optional list of allowed Android applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
576 pub fn allow_android_apps(mut self, input: crate::types::AndroidApp) -> Self {
577 let mut v = self.allow_android_apps.unwrap_or_default();
578 v.push(input);
579 self.allow_android_apps = ::std::option::Option::Some(v);
580 self
581 }
582 /// <p>An optional list of allowed Android applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
583 pub fn set_allow_android_apps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AndroidApp>>) -> Self {
584 self.allow_android_apps = input;
585 self
586 }
587 /// <p>An optional list of allowed Android applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
588 pub fn get_allow_android_apps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AndroidApp>> {
589 &self.allow_android_apps
590 }
591 /// Appends an item to `allow_apple_apps`.
592 ///
593 /// To override the contents of this collection use [`set_allow_apple_apps`](Self::set_allow_apple_apps).
594 ///
595 /// <p>An optional list of allowed Apple applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
596 pub fn allow_apple_apps(mut self, input: crate::types::AppleApp) -> Self {
597 let mut v = self.allow_apple_apps.unwrap_or_default();
598 v.push(input);
599 self.allow_apple_apps = ::std::option::Option::Some(v);
600 self
601 }
602 /// <p>An optional list of allowed Apple applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
603 pub fn set_allow_apple_apps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AppleApp>>) -> Self {
604 self.allow_apple_apps = input;
605 self
606 }
607 /// <p>An optional list of allowed Apple applications for which requests must originate from. Requests using this API key from other sources will not be allowed.</p>
608 pub fn get_allow_apple_apps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AppleApp>> {
609 &self.allow_apple_apps
610 }
611 /// Consumes the builder and constructs a [`ApiKeyRestrictions`](crate::types::ApiKeyRestrictions).
612 /// This method will fail if any of the following fields are not set:
613 /// - [`allow_actions`](crate::types::builders::ApiKeyRestrictionsBuilder::allow_actions)
614 /// - [`allow_resources`](crate::types::builders::ApiKeyRestrictionsBuilder::allow_resources)
615 pub fn build(self) -> ::std::result::Result<crate::types::ApiKeyRestrictions, ::aws_smithy_types::error::operation::BuildError> {
616 ::std::result::Result::Ok(crate::types::ApiKeyRestrictions {
617 allow_actions: self.allow_actions.ok_or_else(|| {
618 ::aws_smithy_types::error::operation::BuildError::missing_field(
619 "allow_actions",
620 "allow_actions was not specified but it is required when building ApiKeyRestrictions",
621 )
622 })?,
623 allow_resources: self.allow_resources.ok_or_else(|| {
624 ::aws_smithy_types::error::operation::BuildError::missing_field(
625 "allow_resources",
626 "allow_resources was not specified but it is required when building ApiKeyRestrictions",
627 )
628 })?,
629 allow_referers: self.allow_referers,
630 allow_android_apps: self.allow_android_apps,
631 allow_apple_apps: self.allow_apple_apps,
632 })
633 }
634}