Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Posts 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.
Synopsis
- data UpdateRecords = UpdateRecords' {}
- newUpdateRecords :: Text -> Text -> Text -> Text -> UpdateRecords
- updateRecords_recordPatches :: Lens' UpdateRecords (Maybe [RecordPatch])
- updateRecords_deviceId :: Lens' UpdateRecords (Maybe Text)
- updateRecords_clientContext :: Lens' UpdateRecords (Maybe Text)
- updateRecords_identityPoolId :: Lens' UpdateRecords Text
- updateRecords_identityId :: Lens' UpdateRecords Text
- updateRecords_datasetName :: Lens' UpdateRecords Text
- updateRecords_syncSessionToken :: Lens' UpdateRecords Text
- data UpdateRecordsResponse = UpdateRecordsResponse' {
- records :: Maybe [Record]
- httpStatus :: Int
- newUpdateRecordsResponse :: Int -> UpdateRecordsResponse
- updateRecordsResponse_records :: Lens' UpdateRecordsResponse (Maybe [Record])
- updateRecordsResponse_httpStatus :: Lens' UpdateRecordsResponse Int
Creating a Request
data UpdateRecords Source #
A request to post updates to records or add and delete records for a dataset and user.
See: newUpdateRecords
smart constructor.
UpdateRecords' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> Text | |
-> UpdateRecords |
Create a value of UpdateRecords
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:recordPatches:UpdateRecords'
, updateRecords_recordPatches
- A list of patch operations.
$sel:deviceId:UpdateRecords'
, updateRecords_deviceId
- The unique ID generated for this device by Cognito.
$sel:clientContext:UpdateRecords'
, updateRecords_clientContext
- Intended to supply a device ID that will populate the lastModifiedBy
field referenced in other methods. The ClientContext field is not yet
implemented.
$sel:identityPoolId:UpdateRecords'
, updateRecords_identityPoolId
- 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.
$sel:identityId:UpdateRecords'
, updateRecords_identityId
- 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.
$sel:datasetName:UpdateRecords'
, updateRecords_datasetName
- A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9,
'_' (underscore), '-' (dash), and '.' (dot).
$sel:syncSessionToken:UpdateRecords'
, updateRecords_syncSessionToken
- The SyncSessionToken returned by a previous call to ListRecords for this
dataset and identity.
Request Lenses
updateRecords_recordPatches :: Lens' UpdateRecords (Maybe [RecordPatch]) Source #
A list of patch operations.
updateRecords_deviceId :: Lens' UpdateRecords (Maybe Text) Source #
The unique ID generated for this device by Cognito.
updateRecords_clientContext :: Lens' UpdateRecords (Maybe Text) Source #
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
updateRecords_identityPoolId :: Lens' UpdateRecords Text Source #
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.
updateRecords_identityId :: Lens' UpdateRecords Text Source #
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.
updateRecords_datasetName :: Lens' UpdateRecords Text Source #
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
updateRecords_syncSessionToken :: Lens' UpdateRecords Text Source #
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
Destructuring the Response
data UpdateRecordsResponse Source #
Returned for a successful UpdateRecordsRequest.
See: newUpdateRecordsResponse
smart constructor.
UpdateRecordsResponse' | |
|
Instances
newUpdateRecordsResponse Source #
Create a value of UpdateRecordsResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:records:UpdateRecordsResponse'
, updateRecordsResponse_records
- A list of records that have been updated.
$sel:httpStatus:UpdateRecordsResponse'
, updateRecordsResponse_httpStatus
- The response's http status code.
Response Lenses
updateRecordsResponse_records :: Lens' UpdateRecordsResponse (Maybe [Record]) Source #
A list of records that have been updated.
updateRecordsResponse_httpStatus :: Lens' UpdateRecordsResponse Int Source #
The response's http status code.