Amazon Cognito Sync provides an AWS service and client library that enable cross-device syncing of application-related user data. High-level client libraries are available for both iOS and Android. You can use these libraries to persist data locally so that it's available even if the device is offline. Developer credentials don't need to be stored on the mobile device to access the service. You can use Amazon Cognito to obtain a normalized user ID and credentials. User data is persisted in a dataset that can store up to 1 MB of key-value pairs, and you can have up to 20 datasets per user identity.
With Amazon Cognito Sync, the data stored for each identity is accessible only to credentials assigned to that identity. In order to use the Cognito Sync service, you need to make API calls using credentials retrieved with Amazon Cognito Identity service.
If you want to use Cognito Sync in an Android or iOS application, you will probably want to make API calls via the AWS Mobile SDK. To learn more, see the Developer Guide for Android and the Developer Guide for iOS.
24 | */ 25 | @interface AWSCognitoSync : AWSService 26 | 27 | /** 28 | The service configuration used to instantiate this service client. 29 | 30 | @warning Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors. 31 | */ 32 | @property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration; 33 | 34 | /** 35 | Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with `defaultServiceConfiguration` from `[AWSServiceManager defaultServiceManager]`. The reference to this object is maintained by the SDK, and you do not need to retain it manually. 36 | 37 | For example, set the default service configuration in `- application:didFinishLaunchingWithOptions:` 38 | 39 | *Swift* 40 | 41 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 42 | let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId") 43 | let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider) 44 | AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration 45 | 46 | return true 47 | } 48 | 49 | *Objective-C* 50 | 51 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 52 | AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 53 | identityPoolId:@"YourIdentityPoolId"]; 54 | AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 55 | credentialsProvider:credentialsProvider]; 56 | [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration; 57 | 58 | return YES; 59 | } 60 | 61 | Then call the following to get the default service client: 62 | 63 | *Swift* 64 | 65 | let CognitoSync = AWSCognitoSync.defaultCognitoSync() 66 | 67 | *Objective-C* 68 | 69 | AWSCognitoSync *CognitoSync = [AWSCognitoSync defaultCognitoSync]; 70 | 71 | @return The default service client. 72 | */ 73 | + (instancetype)defaultCognitoSync; 74 | 75 | /** 76 | Creates a service client with the given service configuration and registers it for the key. 77 | 78 | For example, set the default service configuration in `- application:didFinishLaunchingWithOptions:` 79 | 80 | *Swift* 81 | 82 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 83 | let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId") 84 | let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider) 85 | AWSCognitoSync.registerCognitoSyncWithConfiguration(configuration, forKey: "USWest2CognitoSync") 86 | 87 | return true 88 | } 89 | 90 | *Objective-C* 91 | 92 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 93 | AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 94 | identityPoolId:@"YourIdentityPoolId"]; 95 | AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2 96 | credentialsProvider:credentialsProvider]; 97 | 98 | [AWSCognitoSync registerCognitoSyncWithConfiguration:configuration forKey:@"USWest2CognitoSync"]; 99 | 100 | return YES; 101 | } 102 | 103 | Then call the following to get the service client: 104 | 105 | *Swift* 106 | 107 | let CognitoSync = AWSCognitoSync(forKey: "USWest2CognitoSync") 108 | 109 | *Objective-C* 110 | 111 | AWSCognitoSync *CognitoSync = [AWSCognitoSync CognitoSyncForKey:@"USWest2CognitoSync"]; 112 | 113 | @warning After calling this method, do not modify the configuration object. It may cause unspecified behaviors. 114 | 115 | @param configuration A service configuration object. 116 | @param key A string to identify the service client. 117 | */ 118 | + (void)registerCognitoSyncWithConfiguration:(AWSServiceConfiguration *)configuration forKey:(NSString *)key; 119 | 120 | /** 121 | Retrieves the service client associated with the key. You need to call `+ registerCognitoSyncWithConfiguration:forKey:` before invoking this method. 122 | 123 | For example, set the default service configuration in `- application:didFinishLaunchingWithOptions:` 124 | 125 | *Swift* 126 | 127 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 128 | let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId") 129 | let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider) 130 | AWSCognitoSync.registerCognitoSyncWithConfiguration(configuration, forKey: "USWest2CognitoSync") 131 | 132 | return true 133 | } 134 | 135 | *Objective-C* 136 | 137 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 138 | AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 139 | identityPoolId:@"YourIdentityPoolId"]; 140 | AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2 141 | credentialsProvider:credentialsProvider]; 142 | 143 | [AWSCognitoSync registerCognitoSyncWithConfiguration:configuration forKey:@"USWest2CognitoSync"]; 144 | 145 | return YES; 146 | } 147 | 148 | Then call the following to get the service client: 149 | 150 | *Swift* 151 | 152 | let CognitoSync = AWSCognitoSync(forKey: "USWest2CognitoSync") 153 | 154 | *Objective-C* 155 | 156 | AWSCognitoSync *CognitoSync = [AWSCognitoSync CognitoSyncForKey:@"USWest2CognitoSync"]; 157 | 158 | @param key A string to identify the service client. 159 | 160 | @return An instance of the service client. 161 | */ 162 | + (instancetype)CognitoSyncForKey:(NSString *)key; 163 | 164 | /** 165 | Removes the service client associated with the key and release it. 166 | 167 | @warning Before calling this method, make sure no method is running on this client. 168 | 169 | @param key A string to identify the service client. 170 | */ 171 | + (void)removeCognitoSyncForKey:(NSString *)key; 172 | 173 | /** 174 | Instantiates the service client with the given service configuration. 175 | 176 | @warning This method has been deprecated. Use `+ registerCognitoSyncWithConfiguration:forKey:` and `+ CognitoSyncForKey:` instead. 177 | 178 | @warning Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors. 179 | 180 | @warning Unlike the singleton method, you are responsible for maintaining a strong reference to this object. If the service client is released before completing a service request, the request may fail with unspecified errors. 181 | 182 | @param configuration The service configuration object. 183 | 184 | @return An instance of the service client. 185 | */ 186 | - (instancetype)initWithConfiguration:(AWSServiceConfiguration *)configuration __attribute__ ((deprecated("Use '+ registerCognitoSyncWithConfiguration:forKey:' and '+ CognitoSyncForKey:' instead."))); 187 | 188 | /** 189 |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.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
190 | 191 | @param request A container for the necessary parameters to execute the BulkPublish service method. 192 | 193 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncBulkPublishResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorDuplicateRequest`, `AWSCognitoSyncErrorAlreadyStreamed`. 194 | 195 | @see AWSCognitoSyncBulkPublishRequest 196 | @see AWSCognitoSyncBulkPublishResponse 197 | */ 198 | - (AWSTaskDeletes 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.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.
202 | 203 | @param request A container for the necessary parameters to execute the DeleteDataset service method. 204 | 205 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncDeleteDatasetResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`, `AWSCognitoSyncErrorResourceConflict`. 206 | 207 | @see AWSCognitoSyncDeleteDatasetRequest 208 | @see AWSCognitoSyncDeleteDatasetResponse 209 | */ 210 | - (AWSTaskGets 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.
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.
214 | 215 | @param request A container for the necessary parameters to execute the DescribeDataset service method. 216 | 217 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncDescribeDatasetResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 218 | 219 | @see AWSCognitoSyncDescribeDatasetRequest 220 | @see AWSCognitoSyncDescribeDatasetResponse 221 | */ 222 | - (AWSTaskGets usage details (for example, data storage) about a particular identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
226 | 227 | @param request A container for the necessary parameters to execute the DescribeIdentityPoolUsage service method. 228 | 229 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncDescribeIdentityPoolUsageResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 230 | 231 | @see AWSCognitoSyncDescribeIdentityPoolUsageRequest 232 | @see AWSCognitoSyncDescribeIdentityPoolUsageResponse 233 | */ 234 | - (AWSTaskGets usage information for an identity, including number of datasets and data usage.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.
238 | 239 | @param request A container for the necessary parameters to execute the DescribeIdentityUsage service method. 240 | 241 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncDescribeIdentityUsageResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 242 | 243 | @see AWSCognitoSyncDescribeIdentityUsageRequest 244 | @see AWSCognitoSyncDescribeIdentityUsageResponse 245 | */ 246 | - (AWSTaskGet the status of the last BulkPublish operation for an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
250 | 251 | @param request A container for the necessary parameters to execute the GetBulkPublishDetails service method. 252 | 253 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncGetBulkPublishDetailsResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`. 254 | 255 | @see AWSCognitoSyncGetBulkPublishDetailsRequest 256 | @see AWSCognitoSyncGetBulkPublishDetailsResponse 257 | */ 258 | - (AWSTaskGets the events and the corresponding Lambda functions associated with an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
262 | 263 | @param request A container for the necessary parameters to execute the GetCognitoEvents service method. 264 | 265 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncGetCognitoEventsResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 266 | 267 | @see AWSCognitoSyncGetCognitoEventsRequest 268 | @see AWSCognitoSyncGetCognitoEventsResponse 269 | */ 270 | - (AWSTaskGets the configuration settings of an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
274 | 275 | @param request A container for the necessary parameters to execute the GetIdentityPoolConfiguration service method. 276 | 277 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncGetIdentityPoolConfigurationResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 278 | 279 | @see AWSCognitoSyncGetIdentityPoolConfigurationRequest 280 | @see AWSCognitoSyncGetIdentityPoolConfigurationResponse 281 | */ 282 | - (AWSTaskLists 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.
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.
286 | 287 | @param request A container for the necessary parameters to execute the ListDatasets service method. 288 | 289 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncListDatasetsResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 290 | 291 | @see AWSCognitoSyncListDatasetsRequest 292 | @see AWSCognitoSyncListDatasetsResponse 293 | */ 294 | - (AWSTaskGets a list of identity pools registered with Cognito.
ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.
298 | 299 | @param request A container for the necessary parameters to execute the ListIdentityPoolUsage service method. 300 | 301 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncListIdentityPoolUsageResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 302 | 303 | @see AWSCognitoSyncListIdentityPoolUsageRequest 304 | @see AWSCognitoSyncListIdentityPoolUsageResponse 305 | */ 306 | - (AWSTaskGets 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.
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.
310 | 311 | @param request A container for the necessary parameters to execute the ListRecords service method. 312 | 313 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncListRecordsResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorTooManyRequests`, `AWSCognitoSyncErrorInternalError`. 314 | 315 | @see AWSCognitoSyncListRecordsRequest 316 | @see AWSCognitoSyncListRecordsResponse 317 | */ 318 | - (AWSTaskRegisters a device to receive push sync notifications.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
322 | 323 | @param request A container for the necessary parameters to execute the RegisterDevice service method. 324 | 325 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncRegisterDeviceResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorInvalidConfiguration`, `AWSCognitoSyncErrorTooManyRequests`. 326 | 327 | @see AWSCognitoSyncRegisterDeviceRequest 328 | @see AWSCognitoSyncRegisterDeviceResponse 329 | */ 330 | - (AWSTaskSets 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.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
334 | 335 | @param request A container for the necessary parameters to execute the SetCognitoEvents service method. 336 | 337 | @return An instance of `AWSTask`. On successful execution, `task.result` will be `nil`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`. 338 | 339 | @see AWSCognitoSyncSetCognitoEventsRequest 340 | */ 341 | - (AWSTask *)setCognitoEvents:(AWSCognitoSyncSetCognitoEventsRequest *)request; 342 | 343 | /** 344 |Sets the necessary configuration for push sync.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
345 | 346 | @param request A container for the necessary parameters to execute the SetIdentityPoolConfiguration service method. 347 | 348 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncSetIdentityPoolConfigurationResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorTooManyRequests`, `AWSCognitoSyncErrorLimitExceeded`. 349 | 350 | @see AWSCognitoSyncSetIdentityPoolConfigurationRequest 351 | @see AWSCognitoSyncSetIdentityPoolConfigurationResponse 352 | */ 353 | - (AWSTaskSubscribes to receive notifications when a dataset is modified by another device.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
357 | 358 | @param request A container for the necessary parameters to execute the SubscribeToDataset service method. 359 | 360 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncSubscribeToDatasetResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorInvalidConfiguration`, `AWSCognitoSyncErrorTooManyRequests`. 361 | 362 | @see AWSCognitoSyncSubscribeToDatasetRequest 363 | @see AWSCognitoSyncSubscribeToDatasetResponse 364 | */ 365 | - (AWSTaskUnsubscribes from receiving notifications when a dataset is modified by another device.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
369 | 370 | @param request A container for the necessary parameters to execute the UnsubscribeFromDataset service method. 371 | 372 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncUnsubscribeFromDatasetResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorInternalError`, `AWSCognitoSyncErrorInvalidConfiguration`, `AWSCognitoSyncErrorTooManyRequests`. 373 | 374 | @see AWSCognitoSyncUnsubscribeFromDatasetRequest 375 | @see AWSCognitoSyncUnsubscribeFromDatasetResponse 376 | */ 377 | - (AWSTaskPosts updates to records and adds and deletes records for a dataset and user.
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.
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.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.
381 | 382 | @param request A container for the necessary parameters to execute the UpdateRecords service method. 383 | 384 | @return An instance of `AWSTask`. On successful execution, `task.result` will contain an instance of `AWSCognitoSyncUpdateRecordsResponse`. On failed execution, `task.error` may contain an `NSError` with `AWSCognitoSyncErrorDomain` domain and the following error code: `AWSCognitoSyncErrorInvalidParameter`, `AWSCognitoSyncErrorLimitExceeded`, `AWSCognitoSyncErrorNotAuthorized`, `AWSCognitoSyncErrorResourceNotFound`, `AWSCognitoSyncErrorResourceConflict`, `AWSCognitoSyncErrorInvalidLambdaFunctionOutput`, `AWSCognitoSyncErrorLambdaThrottled`, `AWSCognitoSyncErrorTooManyRequests`, `AWSCognitoSyncErrorInternalError`. 385 | 386 | @see AWSCognitoSyncUpdateRecordsRequest 387 | @see AWSCognitoSyncUpdateRecordsResponse 388 | */ 389 | - (AWSTask