Skip to main content

aws_sdk_cognitosync/operation/list_records/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_records::_list_records_input::ListRecordsInputBuilder;
3
4pub use crate::operation::list_records::_list_records_output::ListRecordsOutputBuilder;
5
6impl crate::operation::list_records::builders::ListRecordsInputBuilder {
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::list_records::ListRecordsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_records::ListRecordsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_records();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListRecords`.
24///
25/// <p>Gets paginated records, optionally changed after a particular sync count for a dataset and identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.</p>
26/// <p>ListRecords can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.</p><examples>
27/// <example>
28/// <name>
29/// ListRecords
30/// </name>
31/// <description>
32/// The following examples have been edited for readability.
33/// </description>
34/// <request>
35/// POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZN-REQUESTID: b3d2e31e-d6b7-4612-8e84-c9ba288dab5d X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.ListRecords HOST: cognito-sync.us-east-1.amazonaws.com:443 X-AMZ-DATE: 20141111T183230Z AUTHORIZATION: AWS4-HMAC-SHA256 Credential=
36/// <credential>
37/// , SignedHeaders=content-type;host;x-amz-date;x-amz-target;x-amzn-requestid, Signature=
38/// <signature>
39/// { "Operation": "com.amazonaws.cognito.sync.model#ListRecords", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "IDENTITY_POOL_ID", "IdentityId": "IDENTITY_ID", "DatasetName": "newDataSet" } }
40/// </signature>
41/// </credential>
42/// </request>
43/// <response>
44/// 1.1 200 OK x-amzn-requestid: b3d2e31e-d6b7-4612-8e84-c9ba288dab5d content-type: application/json content-length: 623 date: Tue, 11 Nov 2014 18:32:30 GMT { "Output": { "__type": "com.amazonaws.cognito.sync.model#ListRecordsResponse", "Count": 0, "DatasetDeletedAfterRequestedSyncCount": false, "DatasetExists": false, "DatasetSyncCount": 0, "LastModifiedBy": null, "MergedDatasetNames": null, "NextToken": null, "Records": \[\], "SyncSessionToken": "SYNC_SESSION_TOKEN" }, "Version": "1.0" }
45/// </response>
46/// </example>
47/// </examples>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct ListRecordsFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::list_records::builders::ListRecordsInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::list_records::ListRecordsOutput,
57        crate::operation::list_records::ListRecordsError,
58    > for ListRecordsFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::list_records::ListRecordsOutput,
66            crate::operation::list_records::ListRecordsError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl ListRecordsFluentBuilder {
73    /// Creates a new `ListRecordsFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the ListRecords as a reference.
82    pub fn as_input(&self) -> &crate::operation::list_records::builders::ListRecordsInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::list_records::ListRecordsOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::list_records::ListRecordsError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::list_records::ListRecords::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::list_records::ListRecords::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::list_records::ListRecordsOutput,
119        crate::operation::list_records::ListRecordsError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
134    pub fn identity_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.identity_pool_id(input.into());
136        self
137    }
138    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
139    pub fn set_identity_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_identity_pool_id(input);
141        self
142    }
143    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
144    pub fn get_identity_pool_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_identity_pool_id()
146    }
147    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
148    pub fn identity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.identity_id(input.into());
150        self
151    }
152    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
153    pub fn set_identity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_identity_id(input);
155        self
156    }
157    /// A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
158    pub fn get_identity_id(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_identity_id()
160    }
161    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
162    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.dataset_name(input.into());
164        self
165    }
166    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
167    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_dataset_name(input);
169        self
170    }
171    /// A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
172    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_dataset_name()
174    }
175    /// The last server sync count for this record.
176    pub fn last_sync_count(mut self, input: i64) -> Self {
177        self.inner = self.inner.last_sync_count(input);
178        self
179    }
180    /// The last server sync count for this record.
181    pub fn set_last_sync_count(mut self, input: ::std::option::Option<i64>) -> Self {
182        self.inner = self.inner.set_last_sync_count(input);
183        self
184    }
185    /// The last server sync count for this record.
186    pub fn get_last_sync_count(&self) -> &::std::option::Option<i64> {
187        self.inner.get_last_sync_count()
188    }
189    /// A pagination token for obtaining the next page of results.
190    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.next_token(input.into());
192        self
193    }
194    /// A pagination token for obtaining the next page of results.
195    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_next_token(input);
197        self
198    }
199    /// A pagination token for obtaining the next page of results.
200    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_next_token()
202    }
203    /// The maximum number of results to be returned.
204    pub fn max_results(mut self, input: i32) -> Self {
205        self.inner = self.inner.max_results(input);
206        self
207    }
208    /// The maximum number of results to be returned.
209    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
210        self.inner = self.inner.set_max_results(input);
211        self
212    }
213    /// The maximum number of results to be returned.
214    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
215        self.inner.get_max_results()
216    }
217    /// A token containing a session ID, identity ID, and expiration.
218    pub fn sync_session_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.inner = self.inner.sync_session_token(input.into());
220        self
221    }
222    /// A token containing a session ID, identity ID, and expiration.
223    pub fn set_sync_session_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.inner = self.inner.set_sync_session_token(input);
225        self
226    }
227    /// A token containing a session ID, identity ID, and expiration.
228    pub fn get_sync_session_token(&self) -> &::std::option::Option<::std::string::String> {
229        self.inner.get_sync_session_token()
230    }
231}