aws_sdk_location/operation/update_tracker/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_tracker::_update_tracker_output::UpdateTrackerOutputBuilder;
3
4pub use crate::operation::update_tracker::_update_tracker_input::UpdateTrackerInputBuilder;
5
6impl crate::operation::update_tracker::builders::UpdateTrackerInputBuilder {
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::update_tracker::UpdateTrackerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_tracker::UpdateTrackerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_tracker();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateTracker`.
24///
25/// <p>Updates the specified properties of a given tracker resource.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateTrackerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_tracker::builders::UpdateTrackerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_tracker::UpdateTrackerOutput,
35        crate::operation::update_tracker::UpdateTrackerError,
36    > for UpdateTrackerFluentBuilder
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::update_tracker::UpdateTrackerOutput,
44            crate::operation::update_tracker::UpdateTrackerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateTrackerFluentBuilder {
51    /// Creates a new `UpdateTrackerFluentBuilder`.
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 UpdateTracker as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_tracker::builders::UpdateTrackerInputBuilder {
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::update_tracker::UpdateTrackerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_tracker::UpdateTrackerError,
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::update_tracker::UpdateTracker::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_tracker::UpdateTracker::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::update_tracker::UpdateTrackerOutput,
97        crate::operation::update_tracker::UpdateTrackerError,
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 of the tracker resource to update.</p>
112    pub fn tracker_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.tracker_name(input.into());
114        self
115    }
116    /// <p>The name of the tracker resource to update.</p>
117    pub fn set_tracker_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_tracker_name(input);
119        self
120    }
121    /// <p>The name of the tracker resource to update.</p>
122    pub fn get_tracker_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_tracker_name()
124    }
125    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
126    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
127    pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
128        self.inner = self.inner.pricing_plan(input);
129        self
130    }
131    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
132    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
133    pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
134        self.inner = self.inner.set_pricing_plan(input);
135        self
136    }
137    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
138    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
139    pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
140        self.inner.get_pricing_plan()
141    }
142    /// <p>This parameter is no longer used.</p>
143    #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
144    pub fn pricing_plan_data_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.pricing_plan_data_source(input.into());
146        self
147    }
148    /// <p>This parameter is no longer used.</p>
149    #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
150    pub fn set_pricing_plan_data_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_pricing_plan_data_source(input);
152        self
153    }
154    /// <p>This parameter is no longer used.</p>
155    #[deprecated(note = "Deprecated. No longer allowed.", since = "2022-02-01")]
156    pub fn get_pricing_plan_data_source(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_pricing_plan_data_source()
158    }
159    /// <p>Updates the description for the tracker resource.</p>
160    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.description(input.into());
162        self
163    }
164    /// <p>Updates the description for the tracker resource.</p>
165    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_description(input);
167        self
168    }
169    /// <p>Updates the description for the tracker resource.</p>
170    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_description()
172    }
173    /// <p>Updates the position filtering for the tracker resource.</p>
174    /// <p>Valid values:</p>
175    /// <ul>
176    /// <li>
177    /// <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>
178    /// <li>
179    /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this distance 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>
180    /// <li>
181    /// <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 helps educe the effects of GPS noise when displaying device trajectories on a map, and can help control costs by reducing the number of geofence evaluations.</p></li>
182    /// </ul>
183    pub fn position_filtering(mut self, input: crate::types::PositionFiltering) -> Self {
184        self.inner = self.inner.position_filtering(input);
185        self
186    }
187    /// <p>Updates the position filtering for the tracker resource.</p>
188    /// <p>Valid values:</p>
189    /// <ul>
190    /// <li>
191    /// <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>
192    /// <li>
193    /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this distance 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>
194    /// <li>
195    /// <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 helps educe the effects of GPS noise when displaying device trajectories on a map, and can help control costs by reducing the number of geofence evaluations.</p></li>
196    /// </ul>
197    pub fn set_position_filtering(mut self, input: ::std::option::Option<crate::types::PositionFiltering>) -> Self {
198        self.inner = self.inner.set_position_filtering(input);
199        self
200    }
201    /// <p>Updates the position filtering for the tracker resource.</p>
202    /// <p>Valid values:</p>
203    /// <ul>
204    /// <li>
205    /// <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>
206    /// <li>
207    /// <p><code>DistanceBased</code> - If the device has moved less than 30 m (98.4 ft), location updates are ignored. Location updates within this distance 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>
208    /// <li>
209    /// <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 helps educe the effects of GPS noise when displaying device trajectories on a map, and can help control costs by reducing the number of geofence evaluations.</p></li>
210    /// </ul>
211    pub fn get_position_filtering(&self) -> &::std::option::Option<crate::types::PositionFiltering> {
212        self.inner.get_position_filtering()
213    }
214    /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
215    /// <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>
216    /// </note>
217    pub fn event_bridge_enabled(mut self, input: bool) -> Self {
218        self.inner = self.inner.event_bridge_enabled(input);
219        self
220    }
221    /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
222    /// <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>
223    /// </note>
224    pub fn set_event_bridge_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
225        self.inner = self.inner.set_event_bridge_enabled(input);
226        self
227    }
228    /// <p>Whether to enable position <code>UPDATE</code> events from this tracker to be sent to EventBridge.</p><note>
229    /// <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>
230    /// </note>
231    pub fn get_event_bridge_enabled(&self) -> &::std::option::Option<bool> {
232        self.inner.get_event_bridge_enabled()
233    }
234    /// <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>
235    /// <p>This parameter is only used if you are using a KMS customer managed key.</p>
236    pub fn kms_key_enable_geospatial_queries(mut self, input: bool) -> Self {
237        self.inner = self.inner.kms_key_enable_geospatial_queries(input);
238        self
239    }
240    /// <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>
241    /// <p>This parameter is only used if you are using a KMS customer managed key.</p>
242    pub fn set_kms_key_enable_geospatial_queries(mut self, input: ::std::option::Option<bool>) -> Self {
243        self.inner = self.inner.set_kms_key_enable_geospatial_queries(input);
244        self
245    }
246    /// <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>
247    /// <p>This parameter is only used if you are using a KMS customer managed key.</p>
248    pub fn get_kms_key_enable_geospatial_queries(&self) -> &::std::option::Option<bool> {
249        self.inner.get_kms_key_enable_geospatial_queries()
250    }
251}