aws_sdk_location/operation/create_tracker/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_tracker::_create_tracker_output::CreateTrackerOutputBuilder;
3
4pub use crate::operation::create_tracker::_create_tracker_input::CreateTrackerInputBuilder;
5
6impl crate::operation::create_tracker::builders::CreateTrackerInputBuilder {
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_tracker::CreateTrackerOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_tracker::CreateTrackerError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_tracker();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateTracker`.
24///
25/// <p>Creates a tracker resource in your Amazon Web Services account, which lets you retrieve current and historical location of devices.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateTrackerFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_tracker::builders::CreateTrackerInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_tracker::CreateTrackerOutput,
35 crate::operation::create_tracker::CreateTrackerError,
36 > for CreateTrackerFluentBuilder
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::create_tracker::CreateTrackerOutput,
44 crate::operation::create_tracker::CreateTrackerError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateTrackerFluentBuilder {
51 /// Creates a new `CreateTrackerFluentBuilder`.
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 CreateTracker as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_tracker::builders::CreateTrackerInputBuilder {
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::create_tracker::CreateTrackerOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_tracker::CreateTrackerError,
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::create_tracker::CreateTracker::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_tracker::CreateTracker::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::create_tracker::CreateTrackerOutput,
97 crate::operation::create_tracker::CreateTrackerError,
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>The name for the tracker resource.</p>
112 /// <p>Requirements:</p>
113 /// <ul>
114 /// <li>
115 /// <p>Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).</p></li>
116 /// <li>
117 /// <p>Must be a unique tracker resource name.</p></li>
118 /// <li>
119 /// <p>No spaces allowed. For example, <code>ExampleTracker</code>.</p></li>
120 /// </ul>
121 pub fn tracker_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.tracker_name(input.into());
123 self
124 }
125 /// <p>The name for the tracker resource.</p>
126 /// <p>Requirements:</p>
127 /// <ul>
128 /// <li>
129 /// <p>Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).</p></li>
130 /// <li>
131 /// <p>Must be a unique tracker resource name.</p></li>
132 /// <li>
133 /// <p>No spaces allowed. For example, <code>ExampleTracker</code>.</p></li>
134 /// </ul>
135 pub fn set_tracker_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_tracker_name(input);
137 self
138 }
139 /// <p>The name for the tracker resource.</p>
140 /// <p>Requirements:</p>
141 /// <ul>
142 /// <li>
143 /// <p>Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).</p></li>
144 /// <li>
145 /// <p>Must be a unique tracker resource name.</p></li>
146 /// <li>
147 /// <p>No spaces allowed. For example, <code>ExampleTracker</code>.</p></li>
148 /// </ul>
149 pub fn get_tracker_name(&self) -> &::std::option::Option<::std::string::String> {
150 self.inner.get_tracker_name()
151 }
152 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
153 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
154 pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
155 self.inner = self.inner.pricing_plan(input);
156 self
157 }
158 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
159 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
160 pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
161 self.inner = self.inner.set_pricing_plan(input);
162 self
163 }
164 /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
165 #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
166 pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
167 self.inner.get_pricing_plan()
168 }
169 /// <p>A key identifier for an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>. Enter a key ID, key ARN, alias name, or alias ARN.</p>
170 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.kms_key_id(input.into());
172 self
173 }
174 /// <p>A key identifier for an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>. Enter a key ID, key ARN, alias name, or alias ARN.</p>
175 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.inner = self.inner.set_kms_key_id(input);
177 self
178 }
179 /// <p>A key identifier for an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>. Enter a key ID, key ARN, alias name, or alias ARN.</p>
180 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_kms_key_id()
182 }
183 /// <p>This parameter is no longer used.</p>
184 #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
185 pub fn pricing_plan_data_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.pricing_plan_data_source(input.into());
187 self
188 }
189 /// <p>This parameter is no longer used.</p>
190 #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
191 pub fn set_pricing_plan_data_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.inner = self.inner.set_pricing_plan_data_source(input);
193 self
194 }
195 /// <p>This parameter is no longer used.</p>
196 #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
197 pub fn get_pricing_plan_data_source(&self) -> &::std::option::Option<::std::string::String> {
198 self.inner.get_pricing_plan_data_source()
199 }
200 /// <p>An optional description for the tracker resource.</p>
201 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.inner = self.inner.description(input.into());
203 self
204 }
205 /// <p>An optional description for the tracker resource.</p>
206 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.inner = self.inner.set_description(input);
208 self
209 }
210 /// <p>An optional description for the tracker resource.</p>
211 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
212 self.inner.get_description()
213 }
214 ///
215 /// Adds a key-value pair to `Tags`.
216 ///
217 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
218 ///
219 /// <p>Applies one or more tags to the tracker resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
220 /// <p>Format: <code>"key" : "value"</code></p>
221 /// <p>Restrictions:</p>
222 /// <ul>
223 /// <li>
224 /// <p>Maximum 50 tags per resource</p></li>
225 /// <li>
226 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
227 /// <li>
228 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
229 /// <li>
230 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
231 /// <li>
232 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
233 /// <li>
234 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
235 /// </ul>
236 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
237 self.inner = self.inner.tags(k.into(), v.into());
238 self
239 }
240 /// <p>Applies one or more tags to the tracker resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
241 /// <p>Format: <code>"key" : "value"</code></p>
242 /// <p>Restrictions:</p>
243 /// <ul>
244 /// <li>
245 /// <p>Maximum 50 tags per resource</p></li>
246 /// <li>
247 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
248 /// <li>
249 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
250 /// <li>
251 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
252 /// <li>
253 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
254 /// <li>
255 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
256 /// </ul>
257 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
258 self.inner = self.inner.set_tags(input);
259 self
260 }
261 /// <p>Applies one or more tags to the tracker resource. A tag is a key-value pair helps manage, identify, search, and filter your resources by labelling them.</p>
262 /// <p>Format: <code>"key" : "value"</code></p>
263 /// <p>Restrictions:</p>
264 /// <ul>
265 /// <li>
266 /// <p>Maximum 50 tags per resource</p></li>
267 /// <li>
268 /// <p>Each resource tag must be unique with a maximum of one value.</p></li>
269 /// <li>
270 /// <p>Maximum key length: 128 Unicode characters in UTF-8</p></li>
271 /// <li>
272 /// <p>Maximum value length: 256 Unicode characters in UTF-8</p></li>
273 /// <li>
274 /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.</p></li>
275 /// <li>
276 /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
277 /// </ul>
278 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
279 self.inner.get_tags()
280 }
281 /// <p>Specifies the position filtering for the tracker resource.</p>
282 /// <p>Valid values:</p>
283 /// <ul>
284 /// <li>
285 /// <p><code>TimeBased</code> - Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID.</p></li>
286 /// <li>
287 /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map.</p></li>
288 /// <li>
289 /// <p><code>AccuracyBased</code> - If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.</p></li>
290 /// </ul>
291 /// <p>This field is optional. If not specified, the default value is <code>TimeBased</code>.</p>
292 pub fn position_filtering(mut self, input: crate::types::PositionFiltering) -> Self {
293 self.inner = self.inner.position_filtering(input);
294 self
295 }
296 /// <p>Specifies the position filtering for the tracker resource.</p>
297 /// <p>Valid values:</p>
298 /// <ul>
299 /// <li>
300 /// <p><code>TimeBased</code> - Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID.</p></li>
301 /// <li>
302 /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map.</p></li>
303 /// <li>
304 /// <p><code>AccuracyBased</code> - If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.</p></li>
305 /// </ul>
306 /// <p>This field is optional. If not specified, the default value is <code>TimeBased</code>.</p>
307 pub fn set_position_filtering(mut self, input: ::std::option::Option<crate::types::PositionFiltering>) -> Self {
308 self.inner = self.inner.set_position_filtering(input);
309 self
310 }
311 /// <p>Specifies the position filtering for the tracker resource.</p>
312 /// <p>Valid values:</p>
313 /// <ul>
314 /// <li>
315 /// <p><code>TimeBased</code> - Location updates are evaluated against linked geofence collections, but not every location update is stored. If your update frequency is more often than 30 seconds, only one update per 30 seconds is stored for each unique device ID.</p></li>
316 /// <li>
317 /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this area are neither evaluated against linked geofence collections, nor stored. This helps control costs by reducing the number of geofence evaluations and historical device positions to paginate through. Distance-based filtering can also reduce the effects of GPS noise when displaying device trajectories on a map.</p></li>
318 /// <li>
319 /// <p><code>AccuracyBased</code> - If the device has moved less than the measured accuracy, location updates are ignored. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is ignored if the device has moved less than 15 m. Ignored location updates are neither evaluated against linked geofence collections, nor stored. This can reduce the effects of GPS noise when displaying device trajectories on a map, and can help control your costs by reducing the number of geofence evaluations.</p></li>
320 /// </ul>
321 /// <p>This field is optional. If not specified, the default value is <code>TimeBased</code>.</p>
322 pub fn get_position_filtering(&self) -> &::std::option::Option<crate::types::PositionFiltering> {
323 self.inner.get_position_filtering()
324 }
325 /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
326 /// <p>You do not need enable this feature to get <code>ENTER</code> and <code>EXIT</code> events for geofences with this tracker. Those events are always sent to EventBridge.</p>
327 /// </note>
328 pub fn event_bridge_enabled(mut self, input: bool) -> Self {
329 self.inner = self.inner.event_bridge_enabled(input);
330 self
331 }
332 /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
333 /// <p>You do not need enable this feature to get <code>ENTER</code> and <code>EXIT</code> events for geofences with this tracker. Those events are always sent to EventBridge.</p>
334 /// </note>
335 pub fn set_event_bridge_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
336 self.inner = self.inner.set_event_bridge_enabled(input);
337 self
338 }
339 /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
340 /// <p>You do not need enable this feature to get <code>ENTER</code> and <code>EXIT</code> events for geofences with this tracker. Those events are always sent to EventBridge.</p>
341 /// </note>
342 pub fn get_event_bridge_enabled(&self) -> &::std::option::Option<bool> {
343 self.inner.get_event_bridge_enabled()
344 }
345 /// <p>Enables <code>GeospatialQueries</code> for a tracker that uses a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>.</p>
346 /// <p>This parameter is only used if you are using a KMS customer managed key.</p><note>
347 /// <p>If you wish to encrypt your data using your own KMS customer managed key, then the Bounding Polygon Queries feature will be disabled by default. This is because by using this feature, a representation of your device positions will not be encrypted using the your KMS managed key. The exact device position, however; is still encrypted using your managed key.</p>
348 /// <p>You can choose to opt-in to the Bounding Polygon Quseries feature. This is done by setting the <code>KmsKeyEnableGeospatialQueries</code> parameter to true when creating or updating a Tracker.</p>
349 /// </note>
350 pub fn kms_key_enable_geospatial_queries(mut self, input: bool) -> Self {
351 self.inner = self.inner.kms_key_enable_geospatial_queries(input);
352 self
353 }
354 /// <p>Enables <code>GeospatialQueries</code> for a tracker that uses a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>.</p>
355 /// <p>This parameter is only used if you are using a KMS customer managed key.</p><note>
356 /// <p>If you wish to encrypt your data using your own KMS customer managed key, then the Bounding Polygon Queries feature will be disabled by default. This is because by using this feature, a representation of your device positions will not be encrypted using the your KMS managed key. The exact device position, however; is still encrypted using your managed key.</p>
357 /// <p>You can choose to opt-in to the Bounding Polygon Quseries feature. This is done by setting the <code>KmsKeyEnableGeospatialQueries</code> parameter to true when creating or updating a Tracker.</p>
358 /// </note>
359 pub fn set_kms_key_enable_geospatial_queries(mut self, input: ::std::option::Option<bool>) -> Self {
360 self.inner = self.inner.set_kms_key_enable_geospatial_queries(input);
361 self
362 }
363 /// <p>Enables <code>GeospatialQueries</code> for a tracker that uses a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html">Amazon Web Services KMS customer managed key</a>.</p>
364 /// <p>This parameter is only used if you are using a KMS customer managed key.</p><note>
365 /// <p>If you wish to encrypt your data using your own KMS customer managed key, then the Bounding Polygon Queries feature will be disabled by default. This is because by using this feature, a representation of your device positions will not be encrypted using the your KMS managed key. The exact device position, however; is still encrypted using your managed key.</p>
366 /// <p>You can choose to opt-in to the Bounding Polygon Quseries feature. This is done by setting the <code>KmsKeyEnableGeospatialQueries</code> parameter to true when creating or updating a Tracker.</p>
367 /// </note>
368 pub fn get_kms_key_enable_geospatial_queries(&self) -> &::std::option::Option<bool> {
369 self.inner.get_kms_key_enable_geospatial_queries()
370 }
371}