libZSservicesZSamazonka-cognito-syncZSamazonka-cognito-sync
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.CognitoSync.UpdateRecords

Description

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

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.

Constructors

UpdateRecords' 

Fields

  • recordPatches :: Maybe [RecordPatch]

    A list of patch operations.

  • deviceId :: Maybe Text

    The unique ID generated for this device by Cognito.

  • clientContext :: Maybe Text

    Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.

  • identityPoolId :: Text

    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.

  • identityId :: Text

    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.

  • datasetName :: Text

    A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

  • syncSessionToken :: Text

    The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.

Instances

Instances details
Eq UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Read UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Show UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Generic UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Associated Types

type Rep UpdateRecords :: Type -> Type #

NFData UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Methods

rnf :: UpdateRecords -> () #

Hashable UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

ToJSON UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

AWSRequest UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Associated Types

type AWSResponse UpdateRecords #

ToHeaders UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

ToPath UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

ToQuery UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

type Rep UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

type Rep UpdateRecords = D1 ('MetaData "UpdateRecords" "Amazonka.CognitoSync.UpdateRecords" "libZSservicesZSamazonka-cognito-syncZSamazonka-cognito-sync" 'False) (C1 ('MetaCons "UpdateRecords'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "recordPatches") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [RecordPatch])) :*: (S1 ('MetaSel ('Just "deviceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "clientContext") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "identityPoolId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "identityId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "datasetName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "syncSessionToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))
type AWSResponse UpdateRecords Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

newUpdateRecords Source #

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_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.

Constructors

UpdateRecordsResponse' 

Fields

Instances

Instances details
Eq UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Read UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Show UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Generic UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Associated Types

type Rep UpdateRecordsResponse :: Type -> Type #

NFData UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

Methods

rnf :: UpdateRecordsResponse -> () #

type Rep UpdateRecordsResponse Source # 
Instance details

Defined in Amazonka.CognitoSync.UpdateRecords

type Rep UpdateRecordsResponse = D1 ('MetaData "UpdateRecordsResponse" "Amazonka.CognitoSync.UpdateRecords" "libZSservicesZSamazonka-cognito-syncZSamazonka-cognito-sync" 'False) (C1 ('MetaCons "UpdateRecordsResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "records") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Record])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

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.