Skip to main content

aws_sdk_location/operation/get_device_position_history/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_device_position_history::_get_device_position_history_output::GetDevicePositionHistoryOutputBuilder;
3
4pub use crate::operation::get_device_position_history::_get_device_position_history_input::GetDevicePositionHistoryInputBuilder;
5
6impl crate::operation::get_device_position_history::builders::GetDevicePositionHistoryInputBuilder {
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::get_device_position_history::GetDevicePositionHistoryOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_device_position_history::GetDevicePositionHistoryError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_device_position_history();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetDevicePositionHistory`.
24///
25/// <p>Retrieves the device position history from a tracker resource within a specified range of time.</p><note>
26/// <p>Device positions are deleted after 30 days.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct GetDevicePositionHistoryFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::get_device_position_history::builders::GetDevicePositionHistoryInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::get_device_position_history::GetDevicePositionHistoryOutput,
37        crate::operation::get_device_position_history::GetDevicePositionHistoryError,
38    > for GetDevicePositionHistoryFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::get_device_position_history::GetDevicePositionHistoryOutput,
46            crate::operation::get_device_position_history::GetDevicePositionHistoryError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl GetDevicePositionHistoryFluentBuilder {
53    /// Creates a new `GetDevicePositionHistoryFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the GetDevicePositionHistory as a reference.
62    pub fn as_input(&self) -> &crate::operation::get_device_position_history::builders::GetDevicePositionHistoryInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::get_device_position_history::GetDevicePositionHistoryOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::get_device_position_history::GetDevicePositionHistoryError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::get_device_position_history::GetDevicePositionHistory::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::get_device_position_history::GetDevicePositionHistory::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::get_device_position_history::GetDevicePositionHistoryOutput,
99        crate::operation::get_device_position_history::GetDevicePositionHistoryError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// Create a paginator for this request
114    ///
115    /// Paginators are used by calling [`send().await`](crate::operation::get_device_position_history::paginator::GetDevicePositionHistoryPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116    pub fn into_paginator(self) -> crate::operation::get_device_position_history::paginator::GetDevicePositionHistoryPaginator {
117        crate::operation::get_device_position_history::paginator::GetDevicePositionHistoryPaginator::new(self.handle, self.inner)
118    }
119    /// <p>The tracker resource receiving the request for the device position history.</p>
120    pub fn tracker_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.tracker_name(input.into());
122        self
123    }
124    /// <p>The tracker resource receiving the request for the device position history.</p>
125    pub fn set_tracker_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_tracker_name(input);
127        self
128    }
129    /// <p>The tracker resource receiving the request for the device position history.</p>
130    pub fn get_tracker_name(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_tracker_name()
132    }
133    /// <p>The device whose position history you want to retrieve.</p>
134    pub fn device_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.device_id(input.into());
136        self
137    }
138    /// <p>The device whose position history you want to retrieve.</p>
139    pub fn set_device_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_device_id(input);
141        self
142    }
143    /// <p>The device whose position history you want to retrieve.</p>
144    pub fn get_device_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_device_id()
146    }
147    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
148    /// <p>Default value: <code>null</code></p>
149    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.next_token(input.into());
151        self
152    }
153    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
154    /// <p>Default value: <code>null</code></p>
155    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_next_token(input);
157        self
158    }
159    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
160    /// <p>Default value: <code>null</code></p>
161    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_next_token()
163    }
164    /// <p>Specify the start time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be 24 hours prior to the time that the request is made.</p>
165    /// <p>Requirement:</p>
166    /// <ul>
167    /// <li>
168    /// <p>The time specified for <code>StartTimeInclusive</code> must be before <code>EndTimeExclusive</code>.</p></li>
169    /// </ul>
170    pub fn start_time_inclusive(mut self, input: ::aws_smithy_types::DateTime) -> Self {
171        self.inner = self.inner.start_time_inclusive(input);
172        self
173    }
174    /// <p>Specify the start time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be 24 hours prior to the time that the request is made.</p>
175    /// <p>Requirement:</p>
176    /// <ul>
177    /// <li>
178    /// <p>The time specified for <code>StartTimeInclusive</code> must be before <code>EndTimeExclusive</code>.</p></li>
179    /// </ul>
180    pub fn set_start_time_inclusive(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
181        self.inner = self.inner.set_start_time_inclusive(input);
182        self
183    }
184    /// <p>Specify the start time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be 24 hours prior to the time that the request is made.</p>
185    /// <p>Requirement:</p>
186    /// <ul>
187    /// <li>
188    /// <p>The time specified for <code>StartTimeInclusive</code> must be before <code>EndTimeExclusive</code>.</p></li>
189    /// </ul>
190    pub fn get_start_time_inclusive(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
191        self.inner.get_start_time_inclusive()
192    }
193    /// <p>Specify the end time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be the time that the request is made.</p>
194    /// <p>Requirement:</p>
195    /// <ul>
196    /// <li>
197    /// <p>The time specified for <code>EndTimeExclusive</code> must be after the time for <code>StartTimeInclusive</code>.</p></li>
198    /// </ul>
199    pub fn end_time_exclusive(mut self, input: ::aws_smithy_types::DateTime) -> Self {
200        self.inner = self.inner.end_time_exclusive(input);
201        self
202    }
203    /// <p>Specify the end time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be the time that the request is made.</p>
204    /// <p>Requirement:</p>
205    /// <ul>
206    /// <li>
207    /// <p>The time specified for <code>EndTimeExclusive</code> must be after the time for <code>StartTimeInclusive</code>.</p></li>
208    /// </ul>
209    pub fn set_end_time_exclusive(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210        self.inner = self.inner.set_end_time_exclusive(input);
211        self
212    }
213    /// <p>Specify the end time for the position history in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>. By default, the value will be the time that the request is made.</p>
214    /// <p>Requirement:</p>
215    /// <ul>
216    /// <li>
217    /// <p>The time specified for <code>EndTimeExclusive</code> must be after the time for <code>StartTimeInclusive</code>.</p></li>
218    /// </ul>
219    pub fn get_end_time_exclusive(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
220        self.inner.get_end_time_exclusive()
221    }
222    /// <p>An optional limit for the number of device positions returned in a single call.</p>
223    /// <p>Default value: <code>100</code></p>
224    pub fn max_results(mut self, input: i32) -> Self {
225        self.inner = self.inner.max_results(input);
226        self
227    }
228    /// <p>An optional limit for the number of device positions returned in a single call.</p>
229    /// <p>Default value: <code>100</code></p>
230    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
231        self.inner = self.inner.set_max_results(input);
232        self
233    }
234    /// <p>An optional limit for the number of device positions returned in a single call.</p>
235    /// <p>Default value: <code>100</code></p>
236    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
237        self.inner.get_max_results()
238    }
239}