rusoto_cognito_sync/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28/// <p>The input for the BulkPublish operation.</p>
29#[derive(Clone, Debug, Default, PartialEq, Serialize)]
30#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
31pub struct BulkPublishRequest {
32    /// <p>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.</p>
33    #[serde(rename = "IdentityPoolId")]
34    pub identity_pool_id: String,
35}
36
37/// <p>The output for the BulkPublish operation.</p>
38#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
39#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
40pub struct BulkPublishResponse {
41    /// <p>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.</p>
42    #[serde(rename = "IdentityPoolId")]
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub identity_pool_id: Option<String>,
45}
46
47/// <p>Configuration options for configure Cognito streams.</p>
48#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
49pub struct CognitoStreams {
50    /// <p>The ARN of the role Amazon Cognito can assume in order to publish to the stream. This role must grant access to Amazon Cognito (cognito-sync) to invoke PutRecord on your Cognito stream.</p>
51    #[serde(rename = "RoleArn")]
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub role_arn: Option<String>,
54    /// <p>The name of the Cognito stream to receive updates. This stream must be in the developers account and in the same region as the identity pool.</p>
55    #[serde(rename = "StreamName")]
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub stream_name: Option<String>,
58    /// <p>Status of the Cognito streams. Valid values are: <p>ENABLED - Streaming of updates to identity pool is enabled.</p> <p>DISABLED - Streaming of updates to identity pool is disabled. Bulk publish will also fail if StreamingStatus is DISABLED.</p></p>
59    #[serde(rename = "StreamingStatus")]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub streaming_status: Option<String>,
62}
63
64/// <p>A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don&#39;t exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.</p>
65#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
66#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
67pub struct Dataset {
68    /// <p>Date on which the dataset was created.</p>
69    #[serde(rename = "CreationDate")]
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub creation_date: Option<f64>,
72    /// <p>Total size in bytes of the records in this dataset.</p>
73    #[serde(rename = "DataStorage")]
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub data_storage: Option<i64>,
76    /// <p>A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (dash), and &#39;.&#39; (dot).</p>
77    #[serde(rename = "DatasetName")]
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub dataset_name: Option<String>,
80    /// <p>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.</p>
81    #[serde(rename = "IdentityId")]
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub identity_id: Option<String>,
84    /// <p>The device that made the last change to this dataset.</p>
85    #[serde(rename = "LastModifiedBy")]
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub last_modified_by: Option<String>,
88    /// <p>Date when the dataset was last modified.</p>
89    #[serde(rename = "LastModifiedDate")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub last_modified_date: Option<f64>,
92    /// <p>Number of records in this dataset.</p>
93    #[serde(rename = "NumRecords")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub num_records: Option<i64>,
96}
97
98/// <p>A request to delete the specific dataset.</p>
99#[derive(Clone, Debug, Default, PartialEq, Serialize)]
100#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
101pub struct DeleteDatasetRequest {
102    /// <p>A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (dash), and &#39;.&#39; (dot).</p>
103    #[serde(rename = "DatasetName")]
104    pub dataset_name: String,
105    /// <p>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.</p>
106    #[serde(rename = "IdentityId")]
107    pub identity_id: String,
108    /// <p>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.</p>
109    #[serde(rename = "IdentityPoolId")]
110    pub identity_pool_id: String,
111}
112
113/// <p>Response to a successful DeleteDataset request.</p>
114#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
115#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
116pub struct DeleteDatasetResponse {
117    /// <p>A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don&#39;t exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.</p>
118    #[serde(rename = "Dataset")]
119    #[serde(skip_serializing_if = "Option::is_none")]
120    pub dataset: Option<Dataset>,
121}
122
123/// <p>A request for meta data about a dataset (creation date, number of records, size) by owner and dataset name.</p>
124#[derive(Clone, Debug, Default, PartialEq, Serialize)]
125#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
126pub struct DescribeDatasetRequest {
127    /// <p>A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (dash), and &#39;.&#39; (dot).</p>
128    #[serde(rename = "DatasetName")]
129    pub dataset_name: String,
130    /// <p>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.</p>
131    #[serde(rename = "IdentityId")]
132    pub identity_id: String,
133    /// <p>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.</p>
134    #[serde(rename = "IdentityPoolId")]
135    pub identity_pool_id: String,
136}
137
138/// <p>Response to a successful DescribeDataset request.</p>
139#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
140#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
141pub struct DescribeDatasetResponse {
142    /// <p>Meta data for a collection of data for an identity. An identity can have multiple datasets. A dataset can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don&#39;t exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.</p>
143    #[serde(rename = "Dataset")]
144    #[serde(skip_serializing_if = "Option::is_none")]
145    pub dataset: Option<Dataset>,
146}
147
148/// <p>A request for usage information about the identity pool.</p>
149#[derive(Clone, Debug, Default, PartialEq, Serialize)]
150#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
151pub struct DescribeIdentityPoolUsageRequest {
152    /// <p>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.</p>
153    #[serde(rename = "IdentityPoolId")]
154    pub identity_pool_id: String,
155}
156
157/// <p>Response to a successful DescribeIdentityPoolUsage request.</p>
158#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
159#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
160pub struct DescribeIdentityPoolUsageResponse {
161    /// <p>Information about the usage of the identity pool.</p>
162    #[serde(rename = "IdentityPoolUsage")]
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub identity_pool_usage: Option<IdentityPoolUsage>,
165}
166
167/// <p>A request for information about the usage of an identity pool.</p>
168#[derive(Clone, Debug, Default, PartialEq, Serialize)]
169#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
170pub struct DescribeIdentityUsageRequest {
171    /// <p>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.</p>
172    #[serde(rename = "IdentityId")]
173    pub identity_id: String,
174    /// <p>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.</p>
175    #[serde(rename = "IdentityPoolId")]
176    pub identity_pool_id: String,
177}
178
179/// <p>The response to a successful DescribeIdentityUsage request.</p>
180#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
181#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
182pub struct DescribeIdentityUsageResponse {
183    /// <p>Usage information for the identity.</p>
184    #[serde(rename = "IdentityUsage")]
185    #[serde(skip_serializing_if = "Option::is_none")]
186    pub identity_usage: Option<IdentityUsage>,
187}
188
189/// <p>The input for the GetBulkPublishDetails operation.</p>
190#[derive(Clone, Debug, Default, PartialEq, Serialize)]
191#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
192pub struct GetBulkPublishDetailsRequest {
193    /// <p>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.</p>
194    #[serde(rename = "IdentityPoolId")]
195    pub identity_pool_id: String,
196}
197
198/// <p>The output for the GetBulkPublishDetails operation.</p>
199#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
200#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
201pub struct GetBulkPublishDetailsResponse {
202    /// <p>If BulkPublishStatus is SUCCEEDED, the time the last bulk publish operation completed.</p>
203    #[serde(rename = "BulkPublishCompleteTime")]
204    #[serde(skip_serializing_if = "Option::is_none")]
205    pub bulk_publish_complete_time: Option<f64>,
206    /// <p>The date/time at which the last bulk publish was initiated.</p>
207    #[serde(rename = "BulkPublishStartTime")]
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub bulk_publish_start_time: Option<f64>,
210    /// <p>Status of the last bulk publish operation, valid values are: <p>NOT<em>STARTED - No bulk publish has been requested for this identity pool</p> <p>IN</em>PROGRESS - Data is being published to the configured stream</p> <p>SUCCEEDED - All data for the identity pool has been published to the configured stream</p> <p>FAILED - Some portion of the data has failed to publish, check FailureMessage for the cause.</p></p>
211    #[serde(rename = "BulkPublishStatus")]
212    #[serde(skip_serializing_if = "Option::is_none")]
213    pub bulk_publish_status: Option<String>,
214    /// <p>If BulkPublishStatus is FAILED this field will contain the error message that caused the bulk publish to fail.</p>
215    #[serde(rename = "FailureMessage")]
216    #[serde(skip_serializing_if = "Option::is_none")]
217    pub failure_message: Option<String>,
218    /// <p>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.</p>
219    #[serde(rename = "IdentityPoolId")]
220    #[serde(skip_serializing_if = "Option::is_none")]
221    pub identity_pool_id: Option<String>,
222}
223
224/// <p>A request for a list of the configured Cognito Events</p>
225#[derive(Clone, Debug, Default, PartialEq, Serialize)]
226#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
227pub struct GetCognitoEventsRequest {
228    /// <p>The Cognito Identity Pool ID for the request</p>
229    #[serde(rename = "IdentityPoolId")]
230    pub identity_pool_id: String,
231}
232
233/// <p>The response from the GetCognitoEvents request</p>
234#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
235#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
236pub struct GetCognitoEventsResponse {
237    /// <p>The Cognito Events returned from the GetCognitoEvents request</p>
238    #[serde(rename = "Events")]
239    #[serde(skip_serializing_if = "Option::is_none")]
240    pub events: Option<::std::collections::HashMap<String, String>>,
241}
242
243/// <p>The input for the GetIdentityPoolConfiguration operation.</p>
244#[derive(Clone, Debug, Default, PartialEq, Serialize)]
245#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
246pub struct GetIdentityPoolConfigurationRequest {
247    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.</p>
248    #[serde(rename = "IdentityPoolId")]
249    pub identity_pool_id: String,
250}
251
252/// <p>The output for the GetIdentityPoolConfiguration operation.</p>
253#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
254#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
255pub struct GetIdentityPoolConfigurationResponse {
256    /// <p>Options to apply to this identity pool for Amazon Cognito streams.</p>
257    #[serde(rename = "CognitoStreams")]
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub cognito_streams: Option<CognitoStreams>,
260    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.</p>
261    #[serde(rename = "IdentityPoolId")]
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub identity_pool_id: Option<String>,
264    /// <p>Options to apply to this identity pool for push synchronization.</p>
265    #[serde(rename = "PushSync")]
266    #[serde(skip_serializing_if = "Option::is_none")]
267    pub push_sync: Option<PushSync>,
268}
269
270/// <p>Usage information for the identity pool.</p>
271#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
272#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
273pub struct IdentityPoolUsage {
274    /// <p>Data storage information for the identity pool.</p>
275    #[serde(rename = "DataStorage")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub data_storage: Option<i64>,
278    /// <p>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.</p>
279    #[serde(rename = "IdentityPoolId")]
280    #[serde(skip_serializing_if = "Option::is_none")]
281    pub identity_pool_id: Option<String>,
282    /// <p>Date on which the identity pool was last modified.</p>
283    #[serde(rename = "LastModifiedDate")]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub last_modified_date: Option<f64>,
286    /// <p>Number of sync sessions for the identity pool.</p>
287    #[serde(rename = "SyncSessionsCount")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub sync_sessions_count: Option<i64>,
290}
291
292/// <p>Usage information for the identity.</p>
293#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
294#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
295pub struct IdentityUsage {
296    /// <p>Total data storage for this identity.</p>
297    #[serde(rename = "DataStorage")]
298    #[serde(skip_serializing_if = "Option::is_none")]
299    pub data_storage: Option<i64>,
300    /// <p>Number of datasets for the identity.</p>
301    #[serde(rename = "DatasetCount")]
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub dataset_count: Option<i64>,
304    /// <p>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.</p>
305    #[serde(rename = "IdentityId")]
306    #[serde(skip_serializing_if = "Option::is_none")]
307    pub identity_id: Option<String>,
308    /// <p>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.</p>
309    #[serde(rename = "IdentityPoolId")]
310    #[serde(skip_serializing_if = "Option::is_none")]
311    pub identity_pool_id: Option<String>,
312    /// <p>Date on which the identity was last modified.</p>
313    #[serde(rename = "LastModifiedDate")]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub last_modified_date: Option<f64>,
316}
317
318/// <p>Request for a list of datasets for an identity.</p>
319#[derive(Clone, Debug, Default, PartialEq, Serialize)]
320#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
321pub struct ListDatasetsRequest {
322    /// <p>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.</p>
323    #[serde(rename = "IdentityId")]
324    pub identity_id: String,
325    /// <p>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.</p>
326    #[serde(rename = "IdentityPoolId")]
327    pub identity_pool_id: String,
328    /// <p>The maximum number of results to be returned.</p>
329    #[serde(rename = "MaxResults")]
330    #[serde(skip_serializing_if = "Option::is_none")]
331    pub max_results: Option<i64>,
332    /// <p>A pagination token for obtaining the next page of results.</p>
333    #[serde(rename = "NextToken")]
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub next_token: Option<String>,
336}
337
338/// <p>Returned for a successful ListDatasets request.</p>
339#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
340#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
341pub struct ListDatasetsResponse {
342    /// <p>Number of datasets returned.</p>
343    #[serde(rename = "Count")]
344    #[serde(skip_serializing_if = "Option::is_none")]
345    pub count: Option<i64>,
346    /// <p>A set of datasets.</p>
347    #[serde(rename = "Datasets")]
348    #[serde(skip_serializing_if = "Option::is_none")]
349    pub datasets: Option<Vec<Dataset>>,
350    /// <p>A pagination token for obtaining the next page of results.</p>
351    #[serde(rename = "NextToken")]
352    #[serde(skip_serializing_if = "Option::is_none")]
353    pub next_token: Option<String>,
354}
355
356/// <p>A request for usage information on an identity pool.</p>
357#[derive(Clone, Debug, Default, PartialEq, Serialize)]
358#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
359pub struct ListIdentityPoolUsageRequest {
360    /// <p>The maximum number of results to be returned.</p>
361    #[serde(rename = "MaxResults")]
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub max_results: Option<i64>,
364    /// <p>A pagination token for obtaining the next page of results.</p>
365    #[serde(rename = "NextToken")]
366    #[serde(skip_serializing_if = "Option::is_none")]
367    pub next_token: Option<String>,
368}
369
370/// <p>Returned for a successful ListIdentityPoolUsage request.</p>
371#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
372#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
373pub struct ListIdentityPoolUsageResponse {
374    /// <p>Total number of identities for the identity pool.</p>
375    #[serde(rename = "Count")]
376    #[serde(skip_serializing_if = "Option::is_none")]
377    pub count: Option<i64>,
378    /// <p>Usage information for the identity pools.</p>
379    #[serde(rename = "IdentityPoolUsages")]
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub identity_pool_usages: Option<Vec<IdentityPoolUsage>>,
382    /// <p>The maximum number of results to be returned.</p>
383    #[serde(rename = "MaxResults")]
384    #[serde(skip_serializing_if = "Option::is_none")]
385    pub max_results: Option<i64>,
386    /// <p>A pagination token for obtaining the next page of results.</p>
387    #[serde(rename = "NextToken")]
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub next_token: Option<String>,
390}
391
392/// <p>A request for a list of records.</p>
393#[derive(Clone, Debug, Default, PartialEq, Serialize)]
394#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
395pub struct ListRecordsRequest {
396    /// <p>A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (dash), and &#39;.&#39; (dot).</p>
397    #[serde(rename = "DatasetName")]
398    pub dataset_name: String,
399    /// <p>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.</p>
400    #[serde(rename = "IdentityId")]
401    pub identity_id: String,
402    /// <p>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.</p>
403    #[serde(rename = "IdentityPoolId")]
404    pub identity_pool_id: String,
405    /// <p>The last server sync count for this record.</p>
406    #[serde(rename = "LastSyncCount")]
407    #[serde(skip_serializing_if = "Option::is_none")]
408    pub last_sync_count: Option<i64>,
409    /// <p>The maximum number of results to be returned.</p>
410    #[serde(rename = "MaxResults")]
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub max_results: Option<i64>,
413    /// <p>A pagination token for obtaining the next page of results.</p>
414    #[serde(rename = "NextToken")]
415    #[serde(skip_serializing_if = "Option::is_none")]
416    pub next_token: Option<String>,
417    /// <p>A token containing a session ID, identity ID, and expiration.</p>
418    #[serde(rename = "SyncSessionToken")]
419    #[serde(skip_serializing_if = "Option::is_none")]
420    pub sync_session_token: Option<String>,
421}
422
423/// <p>Returned for a successful ListRecordsRequest.</p>
424#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
425#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
426pub struct ListRecordsResponse {
427    /// <p>Total number of records.</p>
428    #[serde(rename = "Count")]
429    #[serde(skip_serializing_if = "Option::is_none")]
430    pub count: Option<i64>,
431    /// <p>A boolean value specifying whether to delete the dataset locally.</p>
432    #[serde(rename = "DatasetDeletedAfterRequestedSyncCount")]
433    #[serde(skip_serializing_if = "Option::is_none")]
434    pub dataset_deleted_after_requested_sync_count: Option<bool>,
435    /// <p>Indicates whether the dataset exists.</p>
436    #[serde(rename = "DatasetExists")]
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub dataset_exists: Option<bool>,
439    /// <p>Server sync count for this dataset.</p>
440    #[serde(rename = "DatasetSyncCount")]
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub dataset_sync_count: Option<i64>,
443    /// <p>The user/device that made the last change to this record.</p>
444    #[serde(rename = "LastModifiedBy")]
445    #[serde(skip_serializing_if = "Option::is_none")]
446    pub last_modified_by: Option<String>,
447    /// <p>Names of merged datasets.</p>
448    #[serde(rename = "MergedDatasetNames")]
449    #[serde(skip_serializing_if = "Option::is_none")]
450    pub merged_dataset_names: Option<Vec<String>>,
451    /// <p>A pagination token for obtaining the next page of results.</p>
452    #[serde(rename = "NextToken")]
453    #[serde(skip_serializing_if = "Option::is_none")]
454    pub next_token: Option<String>,
455    /// <p>A list of all records.</p>
456    #[serde(rename = "Records")]
457    #[serde(skip_serializing_if = "Option::is_none")]
458    pub records: Option<Vec<Record>>,
459    /// <p>A token containing a session ID, identity ID, and expiration.</p>
460    #[serde(rename = "SyncSessionToken")]
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub sync_session_token: Option<String>,
463}
464
465/// <p>Configuration options to be applied to the identity pool.</p>
466#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
467pub struct PushSync {
468    /// <p>List of SNS platform application ARNs that could be used by clients.</p>
469    #[serde(rename = "ApplicationArns")]
470    #[serde(skip_serializing_if = "Option::is_none")]
471    pub application_arns: Option<Vec<String>>,
472    /// <p>A role configured to allow Cognito to call SNS on behalf of the developer.</p>
473    #[serde(rename = "RoleArn")]
474    #[serde(skip_serializing_if = "Option::is_none")]
475    pub role_arn: Option<String>,
476}
477
478/// <p>The basic data structure of a dataset.</p>
479#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
480#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
481pub struct Record {
482    /// <p>The last modified date of the client device.</p>
483    #[serde(rename = "DeviceLastModifiedDate")]
484    #[serde(skip_serializing_if = "Option::is_none")]
485    pub device_last_modified_date: Option<f64>,
486    /// <p>The key for the record.</p>
487    #[serde(rename = "Key")]
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub key: Option<String>,
490    /// <p>The user/device that made the last change to this record.</p>
491    #[serde(rename = "LastModifiedBy")]
492    #[serde(skip_serializing_if = "Option::is_none")]
493    pub last_modified_by: Option<String>,
494    /// <p>The date on which the record was last modified.</p>
495    #[serde(rename = "LastModifiedDate")]
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub last_modified_date: Option<f64>,
498    /// <p>The server sync count for this record.</p>
499    #[serde(rename = "SyncCount")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub sync_count: Option<i64>,
502    /// <p>The value for the record.</p>
503    #[serde(rename = "Value")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub value: Option<String>,
506}
507
508/// <p>An update operation for a record.</p>
509#[derive(Clone, Debug, Default, PartialEq, Serialize)]
510#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
511pub struct RecordPatch {
512    /// <p>The last modified date of the client device.</p>
513    #[serde(rename = "DeviceLastModifiedDate")]
514    #[serde(skip_serializing_if = "Option::is_none")]
515    pub device_last_modified_date: Option<f64>,
516    /// <p>The key associated with the record patch.</p>
517    #[serde(rename = "Key")]
518    pub key: String,
519    /// <p>An operation, either replace or remove.</p>
520    #[serde(rename = "Op")]
521    pub op: String,
522    /// <p>Last known server sync count for this record. Set to 0 if unknown.</p>
523    #[serde(rename = "SyncCount")]
524    pub sync_count: i64,
525    /// <p>The value associated with the record patch.</p>
526    #[serde(rename = "Value")]
527    #[serde(skip_serializing_if = "Option::is_none")]
528    pub value: Option<String>,
529}
530
531/// <p>A request to RegisterDevice.</p>
532#[derive(Clone, Debug, Default, PartialEq, Serialize)]
533#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
534pub struct RegisterDeviceRequest {
535    /// <p>The unique ID for this identity.</p>
536    #[serde(rename = "IdentityId")]
537    pub identity_id: String,
538    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. Here, the ID of the pool that the identity belongs to.</p>
539    #[serde(rename = "IdentityPoolId")]
540    pub identity_pool_id: String,
541    /// <p>The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).</p>
542    #[serde(rename = "Platform")]
543    pub platform: String,
544    /// <p>The push token.</p>
545    #[serde(rename = "Token")]
546    pub token: String,
547}
548
549/// <p>Response to a RegisterDevice request.</p>
550#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
551#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
552pub struct RegisterDeviceResponse {
553    /// <p>The unique ID generated for this device by Cognito.</p>
554    #[serde(rename = "DeviceId")]
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub device_id: Option<String>,
557}
558
559/// <p>A request to configure Cognito Events</p>
560#[derive(Clone, Debug, Default, PartialEq, Serialize)]
561#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
562pub struct SetCognitoEventsRequest {
563    /// <p>The events to configure</p>
564    #[serde(rename = "Events")]
565    pub events: ::std::collections::HashMap<String, String>,
566    /// <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
567    #[serde(rename = "IdentityPoolId")]
568    pub identity_pool_id: String,
569}
570
571/// <p>The input for the SetIdentityPoolConfiguration operation.</p>
572#[derive(Clone, Debug, Default, PartialEq, Serialize)]
573#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
574pub struct SetIdentityPoolConfigurationRequest {
575    /// <p>Options to apply to this identity pool for Amazon Cognito streams.</p>
576    #[serde(rename = "CognitoStreams")]
577    #[serde(skip_serializing_if = "Option::is_none")]
578    pub cognito_streams: Option<CognitoStreams>,
579    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.</p>
580    #[serde(rename = "IdentityPoolId")]
581    pub identity_pool_id: String,
582    /// <p>Options to apply to this identity pool for push synchronization.</p>
583    #[serde(rename = "PushSync")]
584    #[serde(skip_serializing_if = "Option::is_none")]
585    pub push_sync: Option<PushSync>,
586}
587
588/// <p>The output for the SetIdentityPoolConfiguration operation</p>
589#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
590#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
591pub struct SetIdentityPoolConfigurationResponse {
592    /// <p>Options to apply to this identity pool for Amazon Cognito streams.</p>
593    #[serde(rename = "CognitoStreams")]
594    #[serde(skip_serializing_if = "Option::is_none")]
595    pub cognito_streams: Option<CognitoStreams>,
596    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.</p>
597    #[serde(rename = "IdentityPoolId")]
598    #[serde(skip_serializing_if = "Option::is_none")]
599    pub identity_pool_id: Option<String>,
600    /// <p>Options to apply to this identity pool for push synchronization.</p>
601    #[serde(rename = "PushSync")]
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub push_sync: Option<PushSync>,
604}
605
606/// <p>A request to SubscribeToDatasetRequest.</p>
607#[derive(Clone, Debug, Default, PartialEq, Serialize)]
608#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
609pub struct SubscribeToDatasetRequest {
610    /// <p>The name of the dataset to subcribe to.</p>
611    #[serde(rename = "DatasetName")]
612    pub dataset_name: String,
613    /// <p>The unique ID generated for this device by Cognito.</p>
614    #[serde(rename = "DeviceId")]
615    pub device_id: String,
616    /// <p>Unique ID for this identity.</p>
617    #[serde(rename = "IdentityId")]
618    pub identity_id: String,
619    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.</p>
620    #[serde(rename = "IdentityPoolId")]
621    pub identity_pool_id: String,
622}
623
624/// <p>Response to a SubscribeToDataset request.</p>
625#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
626#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
627pub struct SubscribeToDatasetResponse {}
628
629/// <p>A request to UnsubscribeFromDataset.</p>
630#[derive(Clone, Debug, Default, PartialEq, Serialize)]
631#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
632pub struct UnsubscribeFromDatasetRequest {
633    /// <p>The name of the dataset from which to unsubcribe.</p>
634    #[serde(rename = "DatasetName")]
635    pub dataset_name: String,
636    /// <p>The unique ID generated for this device by Cognito.</p>
637    #[serde(rename = "DeviceId")]
638    pub device_id: String,
639    /// <p>Unique ID for this identity.</p>
640    #[serde(rename = "IdentityId")]
641    pub identity_id: String,
642    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which this identity belongs.</p>
643    #[serde(rename = "IdentityPoolId")]
644    pub identity_pool_id: String,
645}
646
647/// <p>Response to an UnsubscribeFromDataset request.</p>
648#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
649#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
650pub struct UnsubscribeFromDatasetResponse {}
651
652/// <p>A request to post updates to records or add and delete records for a dataset and user.</p>
653#[derive(Clone, Debug, Default, PartialEq, Serialize)]
654#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
655pub struct UpdateRecordsRequest {
656    /// <p>Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.</p>
657    #[serde(rename = "ClientContext")]
658    #[serde(skip_serializing_if = "Option::is_none")]
659    pub client_context: Option<String>,
660    /// <p>A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (dash), and &#39;.&#39; (dot).</p>
661    #[serde(rename = "DatasetName")]
662    pub dataset_name: String,
663    /// <p>The unique ID generated for this device by Cognito.</p>
664    #[serde(rename = "DeviceId")]
665    #[serde(skip_serializing_if = "Option::is_none")]
666    pub device_id: Option<String>,
667    /// <p>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.</p>
668    #[serde(rename = "IdentityId")]
669    pub identity_id: String,
670    /// <p>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.</p>
671    #[serde(rename = "IdentityPoolId")]
672    pub identity_pool_id: String,
673    /// <p>A list of patch operations.</p>
674    #[serde(rename = "RecordPatches")]
675    #[serde(skip_serializing_if = "Option::is_none")]
676    pub record_patches: Option<Vec<RecordPatch>>,
677    /// <p>The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.</p>
678    #[serde(rename = "SyncSessionToken")]
679    pub sync_session_token: String,
680}
681
682/// <p>Returned for a successful UpdateRecordsRequest.</p>
683#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
684#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
685pub struct UpdateRecordsResponse {
686    /// <p>A list of records that have been updated.</p>
687    #[serde(rename = "Records")]
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub records: Option<Vec<Record>>,
690}
691
692/// Errors returned by BulkPublish
693#[derive(Debug, PartialEq)]
694pub enum BulkPublishError {
695    /// <p>An exception thrown when a bulk publish operation is requested less than 24 hours after a previous bulk publish operation completed successfully.</p>
696    AlreadyStreamed(String),
697    /// <p>An exception thrown when there is an IN_PROGRESS bulk publish operation for the given identity pool.</p>
698    DuplicateRequest(String),
699    /// <p>Indicates an internal service error.</p>
700    InternalError(String),
701    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
702    InvalidParameter(String),
703    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
704    NotAuthorized(String),
705    /// <p>Thrown if the resource doesn&#39;t exist.</p>
706    ResourceNotFound(String),
707}
708
709impl BulkPublishError {
710    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BulkPublishError> {
711        if let Some(err) = proto::json::Error::parse_rest(&res) {
712            match err.typ.as_str() {
713                "AlreadyStreamedException" => {
714                    return RusotoError::Service(BulkPublishError::AlreadyStreamed(err.msg))
715                }
716                "DuplicateRequestException" => {
717                    return RusotoError::Service(BulkPublishError::DuplicateRequest(err.msg))
718                }
719                "InternalErrorException" => {
720                    return RusotoError::Service(BulkPublishError::InternalError(err.msg))
721                }
722                "InvalidParameterException" => {
723                    return RusotoError::Service(BulkPublishError::InvalidParameter(err.msg))
724                }
725                "NotAuthorizedException" => {
726                    return RusotoError::Service(BulkPublishError::NotAuthorized(err.msg))
727                }
728                "ResourceNotFoundException" => {
729                    return RusotoError::Service(BulkPublishError::ResourceNotFound(err.msg))
730                }
731                "ValidationException" => return RusotoError::Validation(err.msg),
732                _ => {}
733            }
734        }
735        RusotoError::Unknown(res)
736    }
737}
738impl fmt::Display for BulkPublishError {
739    #[allow(unused_variables)]
740    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
741        match *self {
742            BulkPublishError::AlreadyStreamed(ref cause) => write!(f, "{}", cause),
743            BulkPublishError::DuplicateRequest(ref cause) => write!(f, "{}", cause),
744            BulkPublishError::InternalError(ref cause) => write!(f, "{}", cause),
745            BulkPublishError::InvalidParameter(ref cause) => write!(f, "{}", cause),
746            BulkPublishError::NotAuthorized(ref cause) => write!(f, "{}", cause),
747            BulkPublishError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
748        }
749    }
750}
751impl Error for BulkPublishError {}
752/// Errors returned by DeleteDataset
753#[derive(Debug, PartialEq)]
754pub enum DeleteDatasetError {
755    /// <p>Indicates an internal service error.</p>
756    InternalError(String),
757    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
758    InvalidParameter(String),
759    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
760    NotAuthorized(String),
761    /// <p>Thrown if an update can&#39;t be applied because the resource was changed by another call and this would result in a conflict.</p>
762    ResourceConflict(String),
763    /// <p>Thrown if the resource doesn&#39;t exist.</p>
764    ResourceNotFound(String),
765    /// <p>Thrown if the request is throttled.</p>
766    TooManyRequests(String),
767}
768
769impl DeleteDatasetError {
770    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDatasetError> {
771        if let Some(err) = proto::json::Error::parse_rest(&res) {
772            match err.typ.as_str() {
773                "InternalErrorException" => {
774                    return RusotoError::Service(DeleteDatasetError::InternalError(err.msg))
775                }
776                "InvalidParameterException" => {
777                    return RusotoError::Service(DeleteDatasetError::InvalidParameter(err.msg))
778                }
779                "NotAuthorizedException" => {
780                    return RusotoError::Service(DeleteDatasetError::NotAuthorized(err.msg))
781                }
782                "ResourceConflictException" => {
783                    return RusotoError::Service(DeleteDatasetError::ResourceConflict(err.msg))
784                }
785                "ResourceNotFoundException" => {
786                    return RusotoError::Service(DeleteDatasetError::ResourceNotFound(err.msg))
787                }
788                "TooManyRequestsException" => {
789                    return RusotoError::Service(DeleteDatasetError::TooManyRequests(err.msg))
790                }
791                "ValidationException" => return RusotoError::Validation(err.msg),
792                _ => {}
793            }
794        }
795        RusotoError::Unknown(res)
796    }
797}
798impl fmt::Display for DeleteDatasetError {
799    #[allow(unused_variables)]
800    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
801        match *self {
802            DeleteDatasetError::InternalError(ref cause) => write!(f, "{}", cause),
803            DeleteDatasetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
804            DeleteDatasetError::NotAuthorized(ref cause) => write!(f, "{}", cause),
805            DeleteDatasetError::ResourceConflict(ref cause) => write!(f, "{}", cause),
806            DeleteDatasetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
807            DeleteDatasetError::TooManyRequests(ref cause) => write!(f, "{}", cause),
808        }
809    }
810}
811impl Error for DeleteDatasetError {}
812/// Errors returned by DescribeDataset
813#[derive(Debug, PartialEq)]
814pub enum DescribeDatasetError {
815    /// <p>Indicates an internal service error.</p>
816    InternalError(String),
817    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
818    InvalidParameter(String),
819    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
820    NotAuthorized(String),
821    /// <p>Thrown if the resource doesn&#39;t exist.</p>
822    ResourceNotFound(String),
823    /// <p>Thrown if the request is throttled.</p>
824    TooManyRequests(String),
825}
826
827impl DescribeDatasetError {
828    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDatasetError> {
829        if let Some(err) = proto::json::Error::parse_rest(&res) {
830            match err.typ.as_str() {
831                "InternalErrorException" => {
832                    return RusotoError::Service(DescribeDatasetError::InternalError(err.msg))
833                }
834                "InvalidParameterException" => {
835                    return RusotoError::Service(DescribeDatasetError::InvalidParameter(err.msg))
836                }
837                "NotAuthorizedException" => {
838                    return RusotoError::Service(DescribeDatasetError::NotAuthorized(err.msg))
839                }
840                "ResourceNotFoundException" => {
841                    return RusotoError::Service(DescribeDatasetError::ResourceNotFound(err.msg))
842                }
843                "TooManyRequestsException" => {
844                    return RusotoError::Service(DescribeDatasetError::TooManyRequests(err.msg))
845                }
846                "ValidationException" => return RusotoError::Validation(err.msg),
847                _ => {}
848            }
849        }
850        RusotoError::Unknown(res)
851    }
852}
853impl fmt::Display for DescribeDatasetError {
854    #[allow(unused_variables)]
855    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
856        match *self {
857            DescribeDatasetError::InternalError(ref cause) => write!(f, "{}", cause),
858            DescribeDatasetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
859            DescribeDatasetError::NotAuthorized(ref cause) => write!(f, "{}", cause),
860            DescribeDatasetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
861            DescribeDatasetError::TooManyRequests(ref cause) => write!(f, "{}", cause),
862        }
863    }
864}
865impl Error for DescribeDatasetError {}
866/// Errors returned by DescribeIdentityPoolUsage
867#[derive(Debug, PartialEq)]
868pub enum DescribeIdentityPoolUsageError {
869    /// <p>Indicates an internal service error.</p>
870    InternalError(String),
871    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
872    InvalidParameter(String),
873    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
874    NotAuthorized(String),
875    /// <p>Thrown if the resource doesn&#39;t exist.</p>
876    ResourceNotFound(String),
877    /// <p>Thrown if the request is throttled.</p>
878    TooManyRequests(String),
879}
880
881impl DescribeIdentityPoolUsageError {
882    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeIdentityPoolUsageError> {
883        if let Some(err) = proto::json::Error::parse_rest(&res) {
884            match err.typ.as_str() {
885                "InternalErrorException" => {
886                    return RusotoError::Service(DescribeIdentityPoolUsageError::InternalError(
887                        err.msg,
888                    ))
889                }
890                "InvalidParameterException" => {
891                    return RusotoError::Service(DescribeIdentityPoolUsageError::InvalidParameter(
892                        err.msg,
893                    ))
894                }
895                "NotAuthorizedException" => {
896                    return RusotoError::Service(DescribeIdentityPoolUsageError::NotAuthorized(
897                        err.msg,
898                    ))
899                }
900                "ResourceNotFoundException" => {
901                    return RusotoError::Service(DescribeIdentityPoolUsageError::ResourceNotFound(
902                        err.msg,
903                    ))
904                }
905                "TooManyRequestsException" => {
906                    return RusotoError::Service(DescribeIdentityPoolUsageError::TooManyRequests(
907                        err.msg,
908                    ))
909                }
910                "ValidationException" => return RusotoError::Validation(err.msg),
911                _ => {}
912            }
913        }
914        RusotoError::Unknown(res)
915    }
916}
917impl fmt::Display for DescribeIdentityPoolUsageError {
918    #[allow(unused_variables)]
919    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
920        match *self {
921            DescribeIdentityPoolUsageError::InternalError(ref cause) => write!(f, "{}", cause),
922            DescribeIdentityPoolUsageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
923            DescribeIdentityPoolUsageError::NotAuthorized(ref cause) => write!(f, "{}", cause),
924            DescribeIdentityPoolUsageError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
925            DescribeIdentityPoolUsageError::TooManyRequests(ref cause) => write!(f, "{}", cause),
926        }
927    }
928}
929impl Error for DescribeIdentityPoolUsageError {}
930/// Errors returned by DescribeIdentityUsage
931#[derive(Debug, PartialEq)]
932pub enum DescribeIdentityUsageError {
933    /// <p>Indicates an internal service error.</p>
934    InternalError(String),
935    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
936    InvalidParameter(String),
937    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
938    NotAuthorized(String),
939    /// <p>Thrown if the resource doesn&#39;t exist.</p>
940    ResourceNotFound(String),
941    /// <p>Thrown if the request is throttled.</p>
942    TooManyRequests(String),
943}
944
945impl DescribeIdentityUsageError {
946    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeIdentityUsageError> {
947        if let Some(err) = proto::json::Error::parse_rest(&res) {
948            match err.typ.as_str() {
949                "InternalErrorException" => {
950                    return RusotoError::Service(DescribeIdentityUsageError::InternalError(err.msg))
951                }
952                "InvalidParameterException" => {
953                    return RusotoError::Service(DescribeIdentityUsageError::InvalidParameter(
954                        err.msg,
955                    ))
956                }
957                "NotAuthorizedException" => {
958                    return RusotoError::Service(DescribeIdentityUsageError::NotAuthorized(err.msg))
959                }
960                "ResourceNotFoundException" => {
961                    return RusotoError::Service(DescribeIdentityUsageError::ResourceNotFound(
962                        err.msg,
963                    ))
964                }
965                "TooManyRequestsException" => {
966                    return RusotoError::Service(DescribeIdentityUsageError::TooManyRequests(
967                        err.msg,
968                    ))
969                }
970                "ValidationException" => return RusotoError::Validation(err.msg),
971                _ => {}
972            }
973        }
974        RusotoError::Unknown(res)
975    }
976}
977impl fmt::Display for DescribeIdentityUsageError {
978    #[allow(unused_variables)]
979    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
980        match *self {
981            DescribeIdentityUsageError::InternalError(ref cause) => write!(f, "{}", cause),
982            DescribeIdentityUsageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
983            DescribeIdentityUsageError::NotAuthorized(ref cause) => write!(f, "{}", cause),
984            DescribeIdentityUsageError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
985            DescribeIdentityUsageError::TooManyRequests(ref cause) => write!(f, "{}", cause),
986        }
987    }
988}
989impl Error for DescribeIdentityUsageError {}
990/// Errors returned by GetBulkPublishDetails
991#[derive(Debug, PartialEq)]
992pub enum GetBulkPublishDetailsError {
993    /// <p>Indicates an internal service error.</p>
994    InternalError(String),
995    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
996    InvalidParameter(String),
997    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
998    NotAuthorized(String),
999    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1000    ResourceNotFound(String),
1001}
1002
1003impl GetBulkPublishDetailsError {
1004    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetBulkPublishDetailsError> {
1005        if let Some(err) = proto::json::Error::parse_rest(&res) {
1006            match err.typ.as_str() {
1007                "InternalErrorException" => {
1008                    return RusotoError::Service(GetBulkPublishDetailsError::InternalError(err.msg))
1009                }
1010                "InvalidParameterException" => {
1011                    return RusotoError::Service(GetBulkPublishDetailsError::InvalidParameter(
1012                        err.msg,
1013                    ))
1014                }
1015                "NotAuthorizedException" => {
1016                    return RusotoError::Service(GetBulkPublishDetailsError::NotAuthorized(err.msg))
1017                }
1018                "ResourceNotFoundException" => {
1019                    return RusotoError::Service(GetBulkPublishDetailsError::ResourceNotFound(
1020                        err.msg,
1021                    ))
1022                }
1023                "ValidationException" => return RusotoError::Validation(err.msg),
1024                _ => {}
1025            }
1026        }
1027        RusotoError::Unknown(res)
1028    }
1029}
1030impl fmt::Display for GetBulkPublishDetailsError {
1031    #[allow(unused_variables)]
1032    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1033        match *self {
1034            GetBulkPublishDetailsError::InternalError(ref cause) => write!(f, "{}", cause),
1035            GetBulkPublishDetailsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1036            GetBulkPublishDetailsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1037            GetBulkPublishDetailsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1038        }
1039    }
1040}
1041impl Error for GetBulkPublishDetailsError {}
1042/// Errors returned by GetCognitoEvents
1043#[derive(Debug, PartialEq)]
1044pub enum GetCognitoEventsError {
1045    /// <p>Indicates an internal service error.</p>
1046    InternalError(String),
1047    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1048    InvalidParameter(String),
1049    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1050    NotAuthorized(String),
1051    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1052    ResourceNotFound(String),
1053    /// <p>Thrown if the request is throttled.</p>
1054    TooManyRequests(String),
1055}
1056
1057impl GetCognitoEventsError {
1058    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCognitoEventsError> {
1059        if let Some(err) = proto::json::Error::parse_rest(&res) {
1060            match err.typ.as_str() {
1061                "InternalErrorException" => {
1062                    return RusotoError::Service(GetCognitoEventsError::InternalError(err.msg))
1063                }
1064                "InvalidParameterException" => {
1065                    return RusotoError::Service(GetCognitoEventsError::InvalidParameter(err.msg))
1066                }
1067                "NotAuthorizedException" => {
1068                    return RusotoError::Service(GetCognitoEventsError::NotAuthorized(err.msg))
1069                }
1070                "ResourceNotFoundException" => {
1071                    return RusotoError::Service(GetCognitoEventsError::ResourceNotFound(err.msg))
1072                }
1073                "TooManyRequestsException" => {
1074                    return RusotoError::Service(GetCognitoEventsError::TooManyRequests(err.msg))
1075                }
1076                "ValidationException" => return RusotoError::Validation(err.msg),
1077                _ => {}
1078            }
1079        }
1080        RusotoError::Unknown(res)
1081    }
1082}
1083impl fmt::Display for GetCognitoEventsError {
1084    #[allow(unused_variables)]
1085    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1086        match *self {
1087            GetCognitoEventsError::InternalError(ref cause) => write!(f, "{}", cause),
1088            GetCognitoEventsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1089            GetCognitoEventsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1090            GetCognitoEventsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1091            GetCognitoEventsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1092        }
1093    }
1094}
1095impl Error for GetCognitoEventsError {}
1096/// Errors returned by GetIdentityPoolConfiguration
1097#[derive(Debug, PartialEq)]
1098pub enum GetIdentityPoolConfigurationError {
1099    /// <p>Indicates an internal service error.</p>
1100    InternalError(String),
1101    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1102    InvalidParameter(String),
1103    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1104    NotAuthorized(String),
1105    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1106    ResourceNotFound(String),
1107    /// <p>Thrown if the request is throttled.</p>
1108    TooManyRequests(String),
1109}
1110
1111impl GetIdentityPoolConfigurationError {
1112    pub fn from_response(
1113        res: BufferedHttpResponse,
1114    ) -> RusotoError<GetIdentityPoolConfigurationError> {
1115        if let Some(err) = proto::json::Error::parse_rest(&res) {
1116            match err.typ.as_str() {
1117                "InternalErrorException" => {
1118                    return RusotoError::Service(GetIdentityPoolConfigurationError::InternalError(
1119                        err.msg,
1120                    ))
1121                }
1122                "InvalidParameterException" => {
1123                    return RusotoError::Service(
1124                        GetIdentityPoolConfigurationError::InvalidParameter(err.msg),
1125                    )
1126                }
1127                "NotAuthorizedException" => {
1128                    return RusotoError::Service(GetIdentityPoolConfigurationError::NotAuthorized(
1129                        err.msg,
1130                    ))
1131                }
1132                "ResourceNotFoundException" => {
1133                    return RusotoError::Service(
1134                        GetIdentityPoolConfigurationError::ResourceNotFound(err.msg),
1135                    )
1136                }
1137                "TooManyRequestsException" => {
1138                    return RusotoError::Service(
1139                        GetIdentityPoolConfigurationError::TooManyRequests(err.msg),
1140                    )
1141                }
1142                "ValidationException" => return RusotoError::Validation(err.msg),
1143                _ => {}
1144            }
1145        }
1146        RusotoError::Unknown(res)
1147    }
1148}
1149impl fmt::Display for GetIdentityPoolConfigurationError {
1150    #[allow(unused_variables)]
1151    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1152        match *self {
1153            GetIdentityPoolConfigurationError::InternalError(ref cause) => write!(f, "{}", cause),
1154            GetIdentityPoolConfigurationError::InvalidParameter(ref cause) => {
1155                write!(f, "{}", cause)
1156            }
1157            GetIdentityPoolConfigurationError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1158            GetIdentityPoolConfigurationError::ResourceNotFound(ref cause) => {
1159                write!(f, "{}", cause)
1160            }
1161            GetIdentityPoolConfigurationError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1162        }
1163    }
1164}
1165impl Error for GetIdentityPoolConfigurationError {}
1166/// Errors returned by ListDatasets
1167#[derive(Debug, PartialEq)]
1168pub enum ListDatasetsError {
1169    /// <p>Indicates an internal service error.</p>
1170    InternalError(String),
1171    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1172    InvalidParameter(String),
1173    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1174    NotAuthorized(String),
1175    /// <p>Thrown if the request is throttled.</p>
1176    TooManyRequests(String),
1177}
1178
1179impl ListDatasetsError {
1180    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDatasetsError> {
1181        if let Some(err) = proto::json::Error::parse_rest(&res) {
1182            match err.typ.as_str() {
1183                "InternalErrorException" => {
1184                    return RusotoError::Service(ListDatasetsError::InternalError(err.msg))
1185                }
1186                "InvalidParameterException" => {
1187                    return RusotoError::Service(ListDatasetsError::InvalidParameter(err.msg))
1188                }
1189                "NotAuthorizedException" => {
1190                    return RusotoError::Service(ListDatasetsError::NotAuthorized(err.msg))
1191                }
1192                "TooManyRequestsException" => {
1193                    return RusotoError::Service(ListDatasetsError::TooManyRequests(err.msg))
1194                }
1195                "ValidationException" => return RusotoError::Validation(err.msg),
1196                _ => {}
1197            }
1198        }
1199        RusotoError::Unknown(res)
1200    }
1201}
1202impl fmt::Display for ListDatasetsError {
1203    #[allow(unused_variables)]
1204    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1205        match *self {
1206            ListDatasetsError::InternalError(ref cause) => write!(f, "{}", cause),
1207            ListDatasetsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1208            ListDatasetsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1209            ListDatasetsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1210        }
1211    }
1212}
1213impl Error for ListDatasetsError {}
1214/// Errors returned by ListIdentityPoolUsage
1215#[derive(Debug, PartialEq)]
1216pub enum ListIdentityPoolUsageError {
1217    /// <p>Indicates an internal service error.</p>
1218    InternalError(String),
1219    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1220    InvalidParameter(String),
1221    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1222    NotAuthorized(String),
1223    /// <p>Thrown if the request is throttled.</p>
1224    TooManyRequests(String),
1225}
1226
1227impl ListIdentityPoolUsageError {
1228    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListIdentityPoolUsageError> {
1229        if let Some(err) = proto::json::Error::parse_rest(&res) {
1230            match err.typ.as_str() {
1231                "InternalErrorException" => {
1232                    return RusotoError::Service(ListIdentityPoolUsageError::InternalError(err.msg))
1233                }
1234                "InvalidParameterException" => {
1235                    return RusotoError::Service(ListIdentityPoolUsageError::InvalidParameter(
1236                        err.msg,
1237                    ))
1238                }
1239                "NotAuthorizedException" => {
1240                    return RusotoError::Service(ListIdentityPoolUsageError::NotAuthorized(err.msg))
1241                }
1242                "TooManyRequestsException" => {
1243                    return RusotoError::Service(ListIdentityPoolUsageError::TooManyRequests(
1244                        err.msg,
1245                    ))
1246                }
1247                "ValidationException" => return RusotoError::Validation(err.msg),
1248                _ => {}
1249            }
1250        }
1251        RusotoError::Unknown(res)
1252    }
1253}
1254impl fmt::Display for ListIdentityPoolUsageError {
1255    #[allow(unused_variables)]
1256    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1257        match *self {
1258            ListIdentityPoolUsageError::InternalError(ref cause) => write!(f, "{}", cause),
1259            ListIdentityPoolUsageError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1260            ListIdentityPoolUsageError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1261            ListIdentityPoolUsageError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1262        }
1263    }
1264}
1265impl Error for ListIdentityPoolUsageError {}
1266/// Errors returned by ListRecords
1267#[derive(Debug, PartialEq)]
1268pub enum ListRecordsError {
1269    /// <p>Indicates an internal service error.</p>
1270    InternalError(String),
1271    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1272    InvalidParameter(String),
1273    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1274    NotAuthorized(String),
1275    /// <p>Thrown if the request is throttled.</p>
1276    TooManyRequests(String),
1277}
1278
1279impl ListRecordsError {
1280    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRecordsError> {
1281        if let Some(err) = proto::json::Error::parse_rest(&res) {
1282            match err.typ.as_str() {
1283                "InternalErrorException" => {
1284                    return RusotoError::Service(ListRecordsError::InternalError(err.msg))
1285                }
1286                "InvalidParameterException" => {
1287                    return RusotoError::Service(ListRecordsError::InvalidParameter(err.msg))
1288                }
1289                "NotAuthorizedException" => {
1290                    return RusotoError::Service(ListRecordsError::NotAuthorized(err.msg))
1291                }
1292                "TooManyRequestsException" => {
1293                    return RusotoError::Service(ListRecordsError::TooManyRequests(err.msg))
1294                }
1295                "ValidationException" => return RusotoError::Validation(err.msg),
1296                _ => {}
1297            }
1298        }
1299        RusotoError::Unknown(res)
1300    }
1301}
1302impl fmt::Display for ListRecordsError {
1303    #[allow(unused_variables)]
1304    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1305        match *self {
1306            ListRecordsError::InternalError(ref cause) => write!(f, "{}", cause),
1307            ListRecordsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1308            ListRecordsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1309            ListRecordsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1310        }
1311    }
1312}
1313impl Error for ListRecordsError {}
1314/// Errors returned by RegisterDevice
1315#[derive(Debug, PartialEq)]
1316pub enum RegisterDeviceError {
1317    /// <p>Indicates an internal service error.</p>
1318    InternalError(String),
1319
1320    InvalidConfiguration(String),
1321    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1322    InvalidParameter(String),
1323    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1324    NotAuthorized(String),
1325    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1326    ResourceNotFound(String),
1327    /// <p>Thrown if the request is throttled.</p>
1328    TooManyRequests(String),
1329}
1330
1331impl RegisterDeviceError {
1332    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RegisterDeviceError> {
1333        if let Some(err) = proto::json::Error::parse_rest(&res) {
1334            match err.typ.as_str() {
1335                "InternalErrorException" => {
1336                    return RusotoError::Service(RegisterDeviceError::InternalError(err.msg))
1337                }
1338                "InvalidConfigurationException" => {
1339                    return RusotoError::Service(RegisterDeviceError::InvalidConfiguration(err.msg))
1340                }
1341                "InvalidParameterException" => {
1342                    return RusotoError::Service(RegisterDeviceError::InvalidParameter(err.msg))
1343                }
1344                "NotAuthorizedException" => {
1345                    return RusotoError::Service(RegisterDeviceError::NotAuthorized(err.msg))
1346                }
1347                "ResourceNotFoundException" => {
1348                    return RusotoError::Service(RegisterDeviceError::ResourceNotFound(err.msg))
1349                }
1350                "TooManyRequestsException" => {
1351                    return RusotoError::Service(RegisterDeviceError::TooManyRequests(err.msg))
1352                }
1353                "ValidationException" => return RusotoError::Validation(err.msg),
1354                _ => {}
1355            }
1356        }
1357        RusotoError::Unknown(res)
1358    }
1359}
1360impl fmt::Display for RegisterDeviceError {
1361    #[allow(unused_variables)]
1362    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1363        match *self {
1364            RegisterDeviceError::InternalError(ref cause) => write!(f, "{}", cause),
1365            RegisterDeviceError::InvalidConfiguration(ref cause) => write!(f, "{}", cause),
1366            RegisterDeviceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1367            RegisterDeviceError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1368            RegisterDeviceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1369            RegisterDeviceError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1370        }
1371    }
1372}
1373impl Error for RegisterDeviceError {}
1374/// Errors returned by SetCognitoEvents
1375#[derive(Debug, PartialEq)]
1376pub enum SetCognitoEventsError {
1377    /// <p>Indicates an internal service error.</p>
1378    InternalError(String),
1379    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1380    InvalidParameter(String),
1381    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1382    NotAuthorized(String),
1383    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1384    ResourceNotFound(String),
1385    /// <p>Thrown if the request is throttled.</p>
1386    TooManyRequests(String),
1387}
1388
1389impl SetCognitoEventsError {
1390    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetCognitoEventsError> {
1391        if let Some(err) = proto::json::Error::parse_rest(&res) {
1392            match err.typ.as_str() {
1393                "InternalErrorException" => {
1394                    return RusotoError::Service(SetCognitoEventsError::InternalError(err.msg))
1395                }
1396                "InvalidParameterException" => {
1397                    return RusotoError::Service(SetCognitoEventsError::InvalidParameter(err.msg))
1398                }
1399                "NotAuthorizedException" => {
1400                    return RusotoError::Service(SetCognitoEventsError::NotAuthorized(err.msg))
1401                }
1402                "ResourceNotFoundException" => {
1403                    return RusotoError::Service(SetCognitoEventsError::ResourceNotFound(err.msg))
1404                }
1405                "TooManyRequestsException" => {
1406                    return RusotoError::Service(SetCognitoEventsError::TooManyRequests(err.msg))
1407                }
1408                "ValidationException" => return RusotoError::Validation(err.msg),
1409                _ => {}
1410            }
1411        }
1412        RusotoError::Unknown(res)
1413    }
1414}
1415impl fmt::Display for SetCognitoEventsError {
1416    #[allow(unused_variables)]
1417    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1418        match *self {
1419            SetCognitoEventsError::InternalError(ref cause) => write!(f, "{}", cause),
1420            SetCognitoEventsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1421            SetCognitoEventsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1422            SetCognitoEventsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1423            SetCognitoEventsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1424        }
1425    }
1426}
1427impl Error for SetCognitoEventsError {}
1428/// Errors returned by SetIdentityPoolConfiguration
1429#[derive(Debug, PartialEq)]
1430pub enum SetIdentityPoolConfigurationError {
1431    /// <p>Thrown if there are parallel requests to modify a resource.</p>
1432    ConcurrentModification(String),
1433    /// <p>Indicates an internal service error.</p>
1434    InternalError(String),
1435    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1436    InvalidParameter(String),
1437    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1438    NotAuthorized(String),
1439    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1440    ResourceNotFound(String),
1441    /// <p>Thrown if the request is throttled.</p>
1442    TooManyRequests(String),
1443}
1444
1445impl SetIdentityPoolConfigurationError {
1446    pub fn from_response(
1447        res: BufferedHttpResponse,
1448    ) -> RusotoError<SetIdentityPoolConfigurationError> {
1449        if let Some(err) = proto::json::Error::parse_rest(&res) {
1450            match err.typ.as_str() {
1451                "ConcurrentModificationException" => {
1452                    return RusotoError::Service(
1453                        SetIdentityPoolConfigurationError::ConcurrentModification(err.msg),
1454                    )
1455                }
1456                "InternalErrorException" => {
1457                    return RusotoError::Service(SetIdentityPoolConfigurationError::InternalError(
1458                        err.msg,
1459                    ))
1460                }
1461                "InvalidParameterException" => {
1462                    return RusotoError::Service(
1463                        SetIdentityPoolConfigurationError::InvalidParameter(err.msg),
1464                    )
1465                }
1466                "NotAuthorizedException" => {
1467                    return RusotoError::Service(SetIdentityPoolConfigurationError::NotAuthorized(
1468                        err.msg,
1469                    ))
1470                }
1471                "ResourceNotFoundException" => {
1472                    return RusotoError::Service(
1473                        SetIdentityPoolConfigurationError::ResourceNotFound(err.msg),
1474                    )
1475                }
1476                "TooManyRequestsException" => {
1477                    return RusotoError::Service(
1478                        SetIdentityPoolConfigurationError::TooManyRequests(err.msg),
1479                    )
1480                }
1481                "ValidationException" => return RusotoError::Validation(err.msg),
1482                _ => {}
1483            }
1484        }
1485        RusotoError::Unknown(res)
1486    }
1487}
1488impl fmt::Display for SetIdentityPoolConfigurationError {
1489    #[allow(unused_variables)]
1490    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1491        match *self {
1492            SetIdentityPoolConfigurationError::ConcurrentModification(ref cause) => {
1493                write!(f, "{}", cause)
1494            }
1495            SetIdentityPoolConfigurationError::InternalError(ref cause) => write!(f, "{}", cause),
1496            SetIdentityPoolConfigurationError::InvalidParameter(ref cause) => {
1497                write!(f, "{}", cause)
1498            }
1499            SetIdentityPoolConfigurationError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1500            SetIdentityPoolConfigurationError::ResourceNotFound(ref cause) => {
1501                write!(f, "{}", cause)
1502            }
1503            SetIdentityPoolConfigurationError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1504        }
1505    }
1506}
1507impl Error for SetIdentityPoolConfigurationError {}
1508/// Errors returned by SubscribeToDataset
1509#[derive(Debug, PartialEq)]
1510pub enum SubscribeToDatasetError {
1511    /// <p>Indicates an internal service error.</p>
1512    InternalError(String),
1513
1514    InvalidConfiguration(String),
1515    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1516    InvalidParameter(String),
1517    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1518    NotAuthorized(String),
1519    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1520    ResourceNotFound(String),
1521    /// <p>Thrown if the request is throttled.</p>
1522    TooManyRequests(String),
1523}
1524
1525impl SubscribeToDatasetError {
1526    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SubscribeToDatasetError> {
1527        if let Some(err) = proto::json::Error::parse_rest(&res) {
1528            match err.typ.as_str() {
1529                "InternalErrorException" => {
1530                    return RusotoError::Service(SubscribeToDatasetError::InternalError(err.msg))
1531                }
1532                "InvalidConfigurationException" => {
1533                    return RusotoError::Service(SubscribeToDatasetError::InvalidConfiguration(
1534                        err.msg,
1535                    ))
1536                }
1537                "InvalidParameterException" => {
1538                    return RusotoError::Service(SubscribeToDatasetError::InvalidParameter(err.msg))
1539                }
1540                "NotAuthorizedException" => {
1541                    return RusotoError::Service(SubscribeToDatasetError::NotAuthorized(err.msg))
1542                }
1543                "ResourceNotFoundException" => {
1544                    return RusotoError::Service(SubscribeToDatasetError::ResourceNotFound(err.msg))
1545                }
1546                "TooManyRequestsException" => {
1547                    return RusotoError::Service(SubscribeToDatasetError::TooManyRequests(err.msg))
1548                }
1549                "ValidationException" => return RusotoError::Validation(err.msg),
1550                _ => {}
1551            }
1552        }
1553        RusotoError::Unknown(res)
1554    }
1555}
1556impl fmt::Display for SubscribeToDatasetError {
1557    #[allow(unused_variables)]
1558    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1559        match *self {
1560            SubscribeToDatasetError::InternalError(ref cause) => write!(f, "{}", cause),
1561            SubscribeToDatasetError::InvalidConfiguration(ref cause) => write!(f, "{}", cause),
1562            SubscribeToDatasetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1563            SubscribeToDatasetError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1564            SubscribeToDatasetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1565            SubscribeToDatasetError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1566        }
1567    }
1568}
1569impl Error for SubscribeToDatasetError {}
1570/// Errors returned by UnsubscribeFromDataset
1571#[derive(Debug, PartialEq)]
1572pub enum UnsubscribeFromDatasetError {
1573    /// <p>Indicates an internal service error.</p>
1574    InternalError(String),
1575
1576    InvalidConfiguration(String),
1577    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1578    InvalidParameter(String),
1579    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1580    NotAuthorized(String),
1581    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1582    ResourceNotFound(String),
1583    /// <p>Thrown if the request is throttled.</p>
1584    TooManyRequests(String),
1585}
1586
1587impl UnsubscribeFromDatasetError {
1588    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnsubscribeFromDatasetError> {
1589        if let Some(err) = proto::json::Error::parse_rest(&res) {
1590            match err.typ.as_str() {
1591                "InternalErrorException" => {
1592                    return RusotoError::Service(UnsubscribeFromDatasetError::InternalError(
1593                        err.msg,
1594                    ))
1595                }
1596                "InvalidConfigurationException" => {
1597                    return RusotoError::Service(UnsubscribeFromDatasetError::InvalidConfiguration(
1598                        err.msg,
1599                    ))
1600                }
1601                "InvalidParameterException" => {
1602                    return RusotoError::Service(UnsubscribeFromDatasetError::InvalidParameter(
1603                        err.msg,
1604                    ))
1605                }
1606                "NotAuthorizedException" => {
1607                    return RusotoError::Service(UnsubscribeFromDatasetError::NotAuthorized(
1608                        err.msg,
1609                    ))
1610                }
1611                "ResourceNotFoundException" => {
1612                    return RusotoError::Service(UnsubscribeFromDatasetError::ResourceNotFound(
1613                        err.msg,
1614                    ))
1615                }
1616                "TooManyRequestsException" => {
1617                    return RusotoError::Service(UnsubscribeFromDatasetError::TooManyRequests(
1618                        err.msg,
1619                    ))
1620                }
1621                "ValidationException" => return RusotoError::Validation(err.msg),
1622                _ => {}
1623            }
1624        }
1625        RusotoError::Unknown(res)
1626    }
1627}
1628impl fmt::Display for UnsubscribeFromDatasetError {
1629    #[allow(unused_variables)]
1630    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1631        match *self {
1632            UnsubscribeFromDatasetError::InternalError(ref cause) => write!(f, "{}", cause),
1633            UnsubscribeFromDatasetError::InvalidConfiguration(ref cause) => write!(f, "{}", cause),
1634            UnsubscribeFromDatasetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1635            UnsubscribeFromDatasetError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1636            UnsubscribeFromDatasetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1637            UnsubscribeFromDatasetError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1638        }
1639    }
1640}
1641impl Error for UnsubscribeFromDatasetError {}
1642/// Errors returned by UpdateRecords
1643#[derive(Debug, PartialEq)]
1644pub enum UpdateRecordsError {
1645    /// <p>Indicates an internal service error.</p>
1646    InternalError(String),
1647    /// <p>The AWS Lambda function returned invalid output or an exception.</p>
1648    InvalidLambdaFunctionOutput(String),
1649    /// <p>Thrown when a request parameter does not comply with the associated constraints.</p>
1650    InvalidParameter(String),
1651    /// <p>AWS Lambda throttled your account, please contact AWS Support</p>
1652    LambdaThrottled(String),
1653    /// <p>Thrown when the limit on the number of objects or operations has been exceeded.</p>
1654    LimitExceeded(String),
1655    /// <p>Thrown when a user is not authorized to access the requested resource.</p>
1656    NotAuthorized(String),
1657    /// <p>Thrown if an update can&#39;t be applied because the resource was changed by another call and this would result in a conflict.</p>
1658    ResourceConflict(String),
1659    /// <p>Thrown if the resource doesn&#39;t exist.</p>
1660    ResourceNotFound(String),
1661    /// <p>Thrown if the request is throttled.</p>
1662    TooManyRequests(String),
1663}
1664
1665impl UpdateRecordsError {
1666    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRecordsError> {
1667        if let Some(err) = proto::json::Error::parse_rest(&res) {
1668            match err.typ.as_str() {
1669                "InternalErrorException" => {
1670                    return RusotoError::Service(UpdateRecordsError::InternalError(err.msg))
1671                }
1672                "InvalidLambdaFunctionOutputException" => {
1673                    return RusotoError::Service(UpdateRecordsError::InvalidLambdaFunctionOutput(
1674                        err.msg,
1675                    ))
1676                }
1677                "InvalidParameterException" => {
1678                    return RusotoError::Service(UpdateRecordsError::InvalidParameter(err.msg))
1679                }
1680                "LambdaThrottledException" => {
1681                    return RusotoError::Service(UpdateRecordsError::LambdaThrottled(err.msg))
1682                }
1683                "LimitExceededException" => {
1684                    return RusotoError::Service(UpdateRecordsError::LimitExceeded(err.msg))
1685                }
1686                "NotAuthorizedException" => {
1687                    return RusotoError::Service(UpdateRecordsError::NotAuthorized(err.msg))
1688                }
1689                "ResourceConflictException" => {
1690                    return RusotoError::Service(UpdateRecordsError::ResourceConflict(err.msg))
1691                }
1692                "ResourceNotFoundException" => {
1693                    return RusotoError::Service(UpdateRecordsError::ResourceNotFound(err.msg))
1694                }
1695                "TooManyRequestsException" => {
1696                    return RusotoError::Service(UpdateRecordsError::TooManyRequests(err.msg))
1697                }
1698                "ValidationException" => return RusotoError::Validation(err.msg),
1699                _ => {}
1700            }
1701        }
1702        RusotoError::Unknown(res)
1703    }
1704}
1705impl fmt::Display for UpdateRecordsError {
1706    #[allow(unused_variables)]
1707    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1708        match *self {
1709            UpdateRecordsError::InternalError(ref cause) => write!(f, "{}", cause),
1710            UpdateRecordsError::InvalidLambdaFunctionOutput(ref cause) => write!(f, "{}", cause),
1711            UpdateRecordsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1712            UpdateRecordsError::LambdaThrottled(ref cause) => write!(f, "{}", cause),
1713            UpdateRecordsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1714            UpdateRecordsError::NotAuthorized(ref cause) => write!(f, "{}", cause),
1715            UpdateRecordsError::ResourceConflict(ref cause) => write!(f, "{}", cause),
1716            UpdateRecordsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1717            UpdateRecordsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
1718        }
1719    }
1720}
1721impl Error for UpdateRecordsError {}
1722/// Trait representing the capabilities of the Amazon Cognito Sync API. Amazon Cognito Sync clients implement this trait.
1723#[async_trait]
1724pub trait CognitoSync {
1725    /// <p>Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream. Customers are limited to one successful bulk publish per 24 hours. Bulk publish is an asynchronous request, customers can see the status of the request via the GetBulkPublishDetails operation.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1726    async fn bulk_publish(
1727        &self,
1728        input: BulkPublishRequest,
1729    ) -> Result<BulkPublishResponse, RusotoError<BulkPublishError>>;
1730
1731    /// <p>Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
1732    async fn delete_dataset(
1733        &self,
1734        input: DeleteDatasetRequest,
1735    ) -> Result<DeleteDatasetResponse, RusotoError<DeleteDatasetError>>;
1736
1737    /// <p>Gets meta data about a dataset by identity and dataset name. 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> <p>This API 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>
1738    async fn describe_dataset(
1739        &self,
1740        input: DescribeDatasetRequest,
1741    ) -> Result<DescribeDatasetResponse, RusotoError<DescribeDatasetError>>;
1742
1743    /// <p>Gets usage details (for example, data storage) about a particular identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1744    async fn describe_identity_pool_usage(
1745        &self,
1746        input: DescribeIdentityPoolUsageRequest,
1747    ) -> Result<DescribeIdentityPoolUsageResponse, RusotoError<DescribeIdentityPoolUsageError>>;
1748
1749    /// <p>Gets usage information for an identity, including number of datasets and data usage.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
1750    async fn describe_identity_usage(
1751        &self,
1752        input: DescribeIdentityUsageRequest,
1753    ) -> Result<DescribeIdentityUsageResponse, RusotoError<DescribeIdentityUsageError>>;
1754
1755    /// <p>Get the status of the last BulkPublish operation for an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1756    async fn get_bulk_publish_details(
1757        &self,
1758        input: GetBulkPublishDetailsRequest,
1759    ) -> Result<GetBulkPublishDetailsResponse, RusotoError<GetBulkPublishDetailsError>>;
1760
1761    /// <p>Gets the events and the corresponding Lambda functions associated with an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1762    async fn get_cognito_events(
1763        &self,
1764        input: GetCognitoEventsRequest,
1765    ) -> Result<GetCognitoEventsResponse, RusotoError<GetCognitoEventsError>>;
1766
1767    /// <p>Gets the configuration settings of an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1768    async fn get_identity_pool_configuration(
1769        &self,
1770        input: GetIdentityPoolConfigurationRequest,
1771    ) -> Result<GetIdentityPoolConfigurationResponse, RusotoError<GetIdentityPoolConfigurationError>>;
1772
1773    /// <p>Lists datasets for an 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> <p>ListDatasets can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use the Cognito Identity credentials to make this API call.</p>
1774    async fn list_datasets(
1775        &self,
1776        input: ListDatasetsRequest,
1777    ) -> Result<ListDatasetsResponse, RusotoError<ListDatasetsError>>;
1778
1779    /// <p>Gets a list of identity pools registered with Cognito.</p> <p>ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.</p>
1780    async fn list_identity_pool_usage(
1781        &self,
1782        input: ListIdentityPoolUsageRequest,
1783    ) -> Result<ListIdentityPoolUsageResponse, RusotoError<ListIdentityPoolUsageError>>;
1784
1785    /// <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> <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>
1786    async fn list_records(
1787        &self,
1788        input: ListRecordsRequest,
1789    ) -> Result<ListRecordsResponse, RusotoError<ListRecordsError>>;
1790
1791    /// <p>Registers a device to receive push sync notifications.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
1792    async fn register_device(
1793        &self,
1794        input: RegisterDeviceRequest,
1795    ) -> Result<RegisterDeviceResponse, RusotoError<RegisterDeviceError>>;
1796
1797    /// <p>Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1798    async fn set_cognito_events(
1799        &self,
1800        input: SetCognitoEventsRequest,
1801    ) -> Result<(), RusotoError<SetCognitoEventsError>>;
1802
1803    /// <p>Sets the necessary configuration for push sync.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1804    async fn set_identity_pool_configuration(
1805        &self,
1806        input: SetIdentityPoolConfigurationRequest,
1807    ) -> Result<SetIdentityPoolConfigurationResponse, RusotoError<SetIdentityPoolConfigurationError>>;
1808
1809    /// <p>Subscribes to receive notifications when a dataset is modified by another device.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
1810    async fn subscribe_to_dataset(
1811        &self,
1812        input: SubscribeToDatasetRequest,
1813    ) -> Result<SubscribeToDatasetResponse, RusotoError<SubscribeToDatasetError>>;
1814
1815    /// <p>Unsubscribes from receiving notifications when a dataset is modified by another device.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
1816    async fn unsubscribe_from_dataset(
1817        &self,
1818        input: UnsubscribeFromDatasetRequest,
1819    ) -> Result<UnsubscribeFromDatasetResponse, RusotoError<UnsubscribeFromDatasetError>>;
1820
1821    /// <p>Posts updates to records and adds and deletes records for a dataset and user.</p> <p>The sync count in the record patch is your last known sync count for that record. The server will reject an UpdateRecords request with a ResourceConflictException if you try to patch a record with a new value but a stale sync count.</p> <p>For example, if the sync count on the server is 5 for a key called highScore and you try and submit a new highScore with sync count of 4, the request will be rejected. To obtain the current sync count for a record, call ListRecords. On a successful update of the record, the response returns the new sync count for that record. You should present that sync count the next time you try to update that same record. When the record does not exist, specify the sync count as 0.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
1822    async fn update_records(
1823        &self,
1824        input: UpdateRecordsRequest,
1825    ) -> Result<UpdateRecordsResponse, RusotoError<UpdateRecordsError>>;
1826}
1827/// A client for the Amazon Cognito Sync API.
1828#[derive(Clone)]
1829pub struct CognitoSyncClient {
1830    client: Client,
1831    region: region::Region,
1832}
1833
1834impl CognitoSyncClient {
1835    /// Creates a client backed by the default tokio event loop.
1836    ///
1837    /// The client will use the default credentials provider and tls client.
1838    pub fn new(region: region::Region) -> CognitoSyncClient {
1839        CognitoSyncClient {
1840            client: Client::shared(),
1841            region,
1842        }
1843    }
1844
1845    pub fn new_with<P, D>(
1846        request_dispatcher: D,
1847        credentials_provider: P,
1848        region: region::Region,
1849    ) -> CognitoSyncClient
1850    where
1851        P: ProvideAwsCredentials + Send + Sync + 'static,
1852        D: DispatchSignedRequest + Send + Sync + 'static,
1853    {
1854        CognitoSyncClient {
1855            client: Client::new_with(credentials_provider, request_dispatcher),
1856            region,
1857        }
1858    }
1859
1860    pub fn new_with_client(client: Client, region: region::Region) -> CognitoSyncClient {
1861        CognitoSyncClient { client, region }
1862    }
1863}
1864
1865#[async_trait]
1866impl CognitoSync for CognitoSyncClient {
1867    /// <p>Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream. Customers are limited to one successful bulk publish per 24 hours. Bulk publish is an asynchronous request, customers can see the status of the request via the GetBulkPublishDetails operation.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1868    #[allow(unused_mut)]
1869    async fn bulk_publish(
1870        &self,
1871        input: BulkPublishRequest,
1872    ) -> Result<BulkPublishResponse, RusotoError<BulkPublishError>> {
1873        let request_uri = format!(
1874            "/identitypools/{identity_pool_id}/bulkpublish",
1875            identity_pool_id = input.identity_pool_id
1876        );
1877
1878        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
1879        request.set_content_type("application/x-amz-json-1.1".to_owned());
1880
1881        let mut response = self
1882            .client
1883            .sign_and_dispatch(request)
1884            .await
1885            .map_err(RusotoError::from)?;
1886        if response.status.as_u16() == 200 {
1887            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1888            let result = proto::json::ResponsePayload::new(&response)
1889                .deserialize::<BulkPublishResponse, _>()?;
1890
1891            Ok(result)
1892        } else {
1893            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1894            Err(BulkPublishError::from_response(response))
1895        }
1896    }
1897
1898    /// <p>Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
1899    #[allow(unused_mut)]
1900    async fn delete_dataset(
1901        &self,
1902        input: DeleteDatasetRequest,
1903    ) -> Result<DeleteDatasetResponse, RusotoError<DeleteDatasetError>> {
1904        let request_uri = format!(
1905            "/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}",
1906            dataset_name = input.dataset_name,
1907            identity_id = input.identity_id,
1908            identity_pool_id = input.identity_pool_id
1909        );
1910
1911        let mut request = SignedRequest::new("DELETE", "cognito-sync", &self.region, &request_uri);
1912        request.set_content_type("application/x-amz-json-1.1".to_owned());
1913
1914        let mut response = self
1915            .client
1916            .sign_and_dispatch(request)
1917            .await
1918            .map_err(RusotoError::from)?;
1919        if response.status.as_u16() == 200 {
1920            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1921            let result = proto::json::ResponsePayload::new(&response)
1922                .deserialize::<DeleteDatasetResponse, _>()?;
1923
1924            Ok(result)
1925        } else {
1926            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1927            Err(DeleteDatasetError::from_response(response))
1928        }
1929    }
1930
1931    /// <p>Gets meta data about a dataset by identity and dataset name. 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> <p>This API 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>
1932    #[allow(unused_mut)]
1933    async fn describe_dataset(
1934        &self,
1935        input: DescribeDatasetRequest,
1936    ) -> Result<DescribeDatasetResponse, RusotoError<DescribeDatasetError>> {
1937        let request_uri = format!(
1938            "/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}",
1939            dataset_name = input.dataset_name,
1940            identity_id = input.identity_id,
1941            identity_pool_id = input.identity_pool_id
1942        );
1943
1944        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
1945        request.set_content_type("application/x-amz-json-1.1".to_owned());
1946
1947        let mut response = self
1948            .client
1949            .sign_and_dispatch(request)
1950            .await
1951            .map_err(RusotoError::from)?;
1952        if response.status.as_u16() == 200 {
1953            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1954            let result = proto::json::ResponsePayload::new(&response)
1955                .deserialize::<DescribeDatasetResponse, _>()?;
1956
1957            Ok(result)
1958        } else {
1959            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1960            Err(DescribeDatasetError::from_response(response))
1961        }
1962    }
1963
1964    /// <p>Gets usage details (for example, data storage) about a particular identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
1965    #[allow(unused_mut)]
1966    async fn describe_identity_pool_usage(
1967        &self,
1968        input: DescribeIdentityPoolUsageRequest,
1969    ) -> Result<DescribeIdentityPoolUsageResponse, RusotoError<DescribeIdentityPoolUsageError>>
1970    {
1971        let request_uri = format!(
1972            "/identitypools/{identity_pool_id}",
1973            identity_pool_id = input.identity_pool_id
1974        );
1975
1976        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
1977        request.set_content_type("application/x-amz-json-1.1".to_owned());
1978
1979        let mut response = self
1980            .client
1981            .sign_and_dispatch(request)
1982            .await
1983            .map_err(RusotoError::from)?;
1984        if response.status.as_u16() == 200 {
1985            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1986            let result = proto::json::ResponsePayload::new(&response)
1987                .deserialize::<DescribeIdentityPoolUsageResponse, _>()?;
1988
1989            Ok(result)
1990        } else {
1991            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1992            Err(DescribeIdentityPoolUsageError::from_response(response))
1993        }
1994    }
1995
1996    /// <p>Gets usage information for an identity, including number of datasets and data usage.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
1997    #[allow(unused_mut)]
1998    async fn describe_identity_usage(
1999        &self,
2000        input: DescribeIdentityUsageRequest,
2001    ) -> Result<DescribeIdentityUsageResponse, RusotoError<DescribeIdentityUsageError>> {
2002        let request_uri = format!(
2003            "/identitypools/{identity_pool_id}/identities/{identity_id}",
2004            identity_id = input.identity_id,
2005            identity_pool_id = input.identity_pool_id
2006        );
2007
2008        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2009        request.set_content_type("application/x-amz-json-1.1".to_owned());
2010
2011        let mut response = self
2012            .client
2013            .sign_and_dispatch(request)
2014            .await
2015            .map_err(RusotoError::from)?;
2016        if response.status.as_u16() == 200 {
2017            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2018            let result = proto::json::ResponsePayload::new(&response)
2019                .deserialize::<DescribeIdentityUsageResponse, _>()?;
2020
2021            Ok(result)
2022        } else {
2023            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2024            Err(DescribeIdentityUsageError::from_response(response))
2025        }
2026    }
2027
2028    /// <p>Get the status of the last BulkPublish operation for an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
2029    #[allow(unused_mut)]
2030    async fn get_bulk_publish_details(
2031        &self,
2032        input: GetBulkPublishDetailsRequest,
2033    ) -> Result<GetBulkPublishDetailsResponse, RusotoError<GetBulkPublishDetailsError>> {
2034        let request_uri = format!(
2035            "/identitypools/{identity_pool_id}/getBulkPublishDetails",
2036            identity_pool_id = input.identity_pool_id
2037        );
2038
2039        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2040        request.set_content_type("application/x-amz-json-1.1".to_owned());
2041
2042        let mut response = self
2043            .client
2044            .sign_and_dispatch(request)
2045            .await
2046            .map_err(RusotoError::from)?;
2047        if response.status.as_u16() == 200 {
2048            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2049            let result = proto::json::ResponsePayload::new(&response)
2050                .deserialize::<GetBulkPublishDetailsResponse, _>()?;
2051
2052            Ok(result)
2053        } else {
2054            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2055            Err(GetBulkPublishDetailsError::from_response(response))
2056        }
2057    }
2058
2059    /// <p>Gets the events and the corresponding Lambda functions associated with an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
2060    #[allow(unused_mut)]
2061    async fn get_cognito_events(
2062        &self,
2063        input: GetCognitoEventsRequest,
2064    ) -> Result<GetCognitoEventsResponse, RusotoError<GetCognitoEventsError>> {
2065        let request_uri = format!(
2066            "/identitypools/{identity_pool_id}/events",
2067            identity_pool_id = input.identity_pool_id
2068        );
2069
2070        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2071        request.set_content_type("application/x-amz-json-1.1".to_owned());
2072
2073        let mut response = self
2074            .client
2075            .sign_and_dispatch(request)
2076            .await
2077            .map_err(RusotoError::from)?;
2078        if response.status.as_u16() == 200 {
2079            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2080            let result = proto::json::ResponsePayload::new(&response)
2081                .deserialize::<GetCognitoEventsResponse, _>()?;
2082
2083            Ok(result)
2084        } else {
2085            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2086            Err(GetCognitoEventsError::from_response(response))
2087        }
2088    }
2089
2090    /// <p>Gets the configuration settings of an identity pool.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
2091    #[allow(unused_mut)]
2092    async fn get_identity_pool_configuration(
2093        &self,
2094        input: GetIdentityPoolConfigurationRequest,
2095    ) -> Result<GetIdentityPoolConfigurationResponse, RusotoError<GetIdentityPoolConfigurationError>>
2096    {
2097        let request_uri = format!(
2098            "/identitypools/{identity_pool_id}/configuration",
2099            identity_pool_id = input.identity_pool_id
2100        );
2101
2102        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2103        request.set_content_type("application/x-amz-json-1.1".to_owned());
2104
2105        let mut response = self
2106            .client
2107            .sign_and_dispatch(request)
2108            .await
2109            .map_err(RusotoError::from)?;
2110        if response.status.as_u16() == 200 {
2111            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2112            let result = proto::json::ResponsePayload::new(&response)
2113                .deserialize::<GetIdentityPoolConfigurationResponse, _>()?;
2114
2115            Ok(result)
2116        } else {
2117            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2118            Err(GetIdentityPoolConfigurationError::from_response(response))
2119        }
2120    }
2121
2122    /// <p>Lists datasets for an 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> <p>ListDatasets can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use the Cognito Identity credentials to make this API call.</p>
2123    #[allow(unused_mut)]
2124    async fn list_datasets(
2125        &self,
2126        input: ListDatasetsRequest,
2127    ) -> Result<ListDatasetsResponse, RusotoError<ListDatasetsError>> {
2128        let request_uri = format!(
2129            "/identitypools/{identity_pool_id}/identities/{identity_id}/datasets",
2130            identity_id = input.identity_id,
2131            identity_pool_id = input.identity_pool_id
2132        );
2133
2134        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2135        request.set_content_type("application/x-amz-json-1.1".to_owned());
2136
2137        let mut params = Params::new();
2138        if let Some(ref x) = input.max_results {
2139            params.put("maxResults", x);
2140        }
2141        if let Some(ref x) = input.next_token {
2142            params.put("nextToken", x);
2143        }
2144        request.set_params(params);
2145
2146        let mut response = self
2147            .client
2148            .sign_and_dispatch(request)
2149            .await
2150            .map_err(RusotoError::from)?;
2151        if response.status.as_u16() == 200 {
2152            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2153            let result = proto::json::ResponsePayload::new(&response)
2154                .deserialize::<ListDatasetsResponse, _>()?;
2155
2156            Ok(result)
2157        } else {
2158            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2159            Err(ListDatasetsError::from_response(response))
2160        }
2161    }
2162
2163    /// <p>Gets a list of identity pools registered with Cognito.</p> <p>ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.</p>
2164    #[allow(unused_mut)]
2165    async fn list_identity_pool_usage(
2166        &self,
2167        input: ListIdentityPoolUsageRequest,
2168    ) -> Result<ListIdentityPoolUsageResponse, RusotoError<ListIdentityPoolUsageError>> {
2169        let request_uri = "/identitypools";
2170
2171        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2172        request.set_content_type("application/x-amz-json-1.1".to_owned());
2173
2174        let mut params = Params::new();
2175        if let Some(ref x) = input.max_results {
2176            params.put("maxResults", x);
2177        }
2178        if let Some(ref x) = input.next_token {
2179            params.put("nextToken", x);
2180        }
2181        request.set_params(params);
2182
2183        let mut response = self
2184            .client
2185            .sign_and_dispatch(request)
2186            .await
2187            .map_err(RusotoError::from)?;
2188        if response.status.as_u16() == 200 {
2189            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2190            let result = proto::json::ResponsePayload::new(&response)
2191                .deserialize::<ListIdentityPoolUsageResponse, _>()?;
2192
2193            Ok(result)
2194        } else {
2195            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2196            Err(ListIdentityPoolUsageError::from_response(response))
2197        }
2198    }
2199
2200    /// <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> <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>
2201    #[allow(unused_mut)]
2202    async fn list_records(
2203        &self,
2204        input: ListRecordsRequest,
2205    ) -> Result<ListRecordsResponse, RusotoError<ListRecordsError>> {
2206        let request_uri = format!("/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}/records", dataset_name = input.dataset_name, identity_id = input.identity_id, identity_pool_id = input.identity_pool_id);
2207
2208        let mut request = SignedRequest::new("GET", "cognito-sync", &self.region, &request_uri);
2209        request.set_content_type("application/x-amz-json-1.1".to_owned());
2210
2211        let mut params = Params::new();
2212        if let Some(ref x) = input.last_sync_count {
2213            params.put("lastSyncCount", x);
2214        }
2215        if let Some(ref x) = input.max_results {
2216            params.put("maxResults", x);
2217        }
2218        if let Some(ref x) = input.next_token {
2219            params.put("nextToken", x);
2220        }
2221        if let Some(ref x) = input.sync_session_token {
2222            params.put("syncSessionToken", x);
2223        }
2224        request.set_params(params);
2225
2226        let mut response = self
2227            .client
2228            .sign_and_dispatch(request)
2229            .await
2230            .map_err(RusotoError::from)?;
2231        if response.status.as_u16() == 200 {
2232            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2233            let result = proto::json::ResponsePayload::new(&response)
2234                .deserialize::<ListRecordsResponse, _>()?;
2235
2236            Ok(result)
2237        } else {
2238            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2239            Err(ListRecordsError::from_response(response))
2240        }
2241    }
2242
2243    /// <p>Registers a device to receive push sync notifications.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
2244    #[allow(unused_mut)]
2245    async fn register_device(
2246        &self,
2247        input: RegisterDeviceRequest,
2248    ) -> Result<RegisterDeviceResponse, RusotoError<RegisterDeviceError>> {
2249        let request_uri = format!(
2250            "/identitypools/{identity_pool_id}/identity/{identity_id}/device",
2251            identity_id = input.identity_id,
2252            identity_pool_id = input.identity_pool_id
2253        );
2254
2255        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2256        request.set_content_type("application/x-amz-json-1.1".to_owned());
2257
2258        let encoded = Some(serde_json::to_vec(&input).unwrap());
2259        request.set_payload(encoded);
2260
2261        let mut response = self
2262            .client
2263            .sign_and_dispatch(request)
2264            .await
2265            .map_err(RusotoError::from)?;
2266        if response.status.as_u16() == 200 {
2267            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2268            let result = proto::json::ResponsePayload::new(&response)
2269                .deserialize::<RegisterDeviceResponse, _>()?;
2270
2271            Ok(result)
2272        } else {
2273            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2274            Err(RegisterDeviceError::from_response(response))
2275        }
2276    }
2277
2278    /// <p>Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
2279    #[allow(unused_mut)]
2280    async fn set_cognito_events(
2281        &self,
2282        input: SetCognitoEventsRequest,
2283    ) -> Result<(), RusotoError<SetCognitoEventsError>> {
2284        let request_uri = format!(
2285            "/identitypools/{identity_pool_id}/events",
2286            identity_pool_id = input.identity_pool_id
2287        );
2288
2289        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2290        request.set_content_type("application/x-amz-json-1.1".to_owned());
2291
2292        let encoded = Some(serde_json::to_vec(&input).unwrap());
2293        request.set_payload(encoded);
2294
2295        let mut response = self
2296            .client
2297            .sign_and_dispatch(request)
2298            .await
2299            .map_err(RusotoError::from)?;
2300        if response.status.as_u16() == 200 {
2301            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2302            let result = ::std::mem::drop(response);
2303
2304            Ok(result)
2305        } else {
2306            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2307            Err(SetCognitoEventsError::from_response(response))
2308        }
2309    }
2310
2311    /// <p>Sets the necessary configuration for push sync.</p> <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p>
2312    #[allow(unused_mut)]
2313    async fn set_identity_pool_configuration(
2314        &self,
2315        input: SetIdentityPoolConfigurationRequest,
2316    ) -> Result<SetIdentityPoolConfigurationResponse, RusotoError<SetIdentityPoolConfigurationError>>
2317    {
2318        let request_uri = format!(
2319            "/identitypools/{identity_pool_id}/configuration",
2320            identity_pool_id = input.identity_pool_id
2321        );
2322
2323        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2324        request.set_content_type("application/x-amz-json-1.1".to_owned());
2325
2326        let encoded = Some(serde_json::to_vec(&input).unwrap());
2327        request.set_payload(encoded);
2328
2329        let mut response = self
2330            .client
2331            .sign_and_dispatch(request)
2332            .await
2333            .map_err(RusotoError::from)?;
2334        if response.status.as_u16() == 200 {
2335            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2336            let result = proto::json::ResponsePayload::new(&response)
2337                .deserialize::<SetIdentityPoolConfigurationResponse, _>()?;
2338
2339            Ok(result)
2340        } else {
2341            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2342            Err(SetIdentityPoolConfigurationError::from_response(response))
2343        }
2344    }
2345
2346    /// <p>Subscribes to receive notifications when a dataset is modified by another device.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
2347    #[allow(unused_mut)]
2348    async fn subscribe_to_dataset(
2349        &self,
2350        input: SubscribeToDatasetRequest,
2351    ) -> Result<SubscribeToDatasetResponse, RusotoError<SubscribeToDatasetError>> {
2352        let request_uri = format!("/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}/subscriptions/{device_id}", dataset_name = input.dataset_name, device_id = input.device_id, identity_id = input.identity_id, identity_pool_id = input.identity_pool_id);
2353
2354        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2355        request.set_content_type("application/x-amz-json-1.1".to_owned());
2356
2357        let mut response = self
2358            .client
2359            .sign_and_dispatch(request)
2360            .await
2361            .map_err(RusotoError::from)?;
2362        if response.status.as_u16() == 200 {
2363            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2364            let result = proto::json::ResponsePayload::new(&response)
2365                .deserialize::<SubscribeToDatasetResponse, _>()?;
2366
2367            Ok(result)
2368        } else {
2369            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2370            Err(SubscribeToDatasetError::from_response(response))
2371        }
2372    }
2373
2374    /// <p>Unsubscribes from receiving notifications when a dataset is modified by another device.</p> <p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p>
2375    #[allow(unused_mut)]
2376    async fn unsubscribe_from_dataset(
2377        &self,
2378        input: UnsubscribeFromDatasetRequest,
2379    ) -> Result<UnsubscribeFromDatasetResponse, RusotoError<UnsubscribeFromDatasetError>> {
2380        let request_uri = format!("/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}/subscriptions/{device_id}", dataset_name = input.dataset_name, device_id = input.device_id, identity_id = input.identity_id, identity_pool_id = input.identity_pool_id);
2381
2382        let mut request = SignedRequest::new("DELETE", "cognito-sync", &self.region, &request_uri);
2383        request.set_content_type("application/x-amz-json-1.1".to_owned());
2384
2385        let mut response = self
2386            .client
2387            .sign_and_dispatch(request)
2388            .await
2389            .map_err(RusotoError::from)?;
2390        if response.status.as_u16() == 200 {
2391            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2392            let result = proto::json::ResponsePayload::new(&response)
2393                .deserialize::<UnsubscribeFromDatasetResponse, _>()?;
2394
2395            Ok(result)
2396        } else {
2397            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2398            Err(UnsubscribeFromDatasetError::from_response(response))
2399        }
2400    }
2401
2402    /// <p>Posts updates to records and adds and deletes records for a dataset and user.</p> <p>The sync count in the record patch is your last known sync count for that record. The server will reject an UpdateRecords request with a ResourceConflictException if you try to patch a record with a new value but a stale sync count.</p> <p>For example, if the sync count on the server is 5 for a key called highScore and you try and submit a new highScore with sync count of 4, the request will be rejected. To obtain the current sync count for a record, call ListRecords. On a successful update of the record, the response returns the new sync count for that record. You should present that sync count the next time you try to update that same record. When the record does not exist, specify the sync count as 0.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>
2403    #[allow(unused_mut)]
2404    async fn update_records(
2405        &self,
2406        input: UpdateRecordsRequest,
2407    ) -> Result<UpdateRecordsResponse, RusotoError<UpdateRecordsError>> {
2408        let request_uri = format!(
2409            "/identitypools/{identity_pool_id}/identities/{identity_id}/datasets/{dataset_name}",
2410            dataset_name = input.dataset_name,
2411            identity_id = input.identity_id,
2412            identity_pool_id = input.identity_pool_id
2413        );
2414
2415        let mut request = SignedRequest::new("POST", "cognito-sync", &self.region, &request_uri);
2416        request.set_content_type("application/x-amz-json-1.1".to_owned());
2417
2418        let encoded = Some(serde_json::to_vec(&input).unwrap());
2419        request.set_payload(encoded);
2420        request.add_optional_header("x-amz-Client-Context", input.client_context.as_ref());
2421
2422        let mut response = self
2423            .client
2424            .sign_and_dispatch(request)
2425            .await
2426            .map_err(RusotoError::from)?;
2427        if response.status.as_u16() == 200 {
2428            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2429            let result = proto::json::ResponsePayload::new(&response)
2430                .deserialize::<UpdateRecordsResponse, _>()?;
2431
2432            Ok(result)
2433        } else {
2434            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2435            Err(UpdateRecordsError::from_response(response))
2436        }
2437    }
2438}