amazonka-cognito-sync-1.6.1: Amazon Cognito Sync SDK.

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

Network.AWS.CognitoSync.UpdateRecords

Contents

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

updateRecords Source #

Creates a value of UpdateRecords with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • urRecordPatches - A list of patch operations.
  • urDeviceId - The unique ID generated for this device by Cognito.
  • urClientContext - Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
  • urIdentityPoolId - 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.
  • urIdentityId - 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.
  • urDatasetName - A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), - (dash), and . (dot).
  • urSyncSessionToken - The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.

data UpdateRecords Source #

A request to post updates to records or add and delete records for a dataset and user.

See: updateRecords smart constructor.

Instances
Eq UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Data UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpdateRecords -> c UpdateRecords #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UpdateRecords #

toConstr :: UpdateRecords -> Constr #

dataTypeOf :: UpdateRecords -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UpdateRecords) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UpdateRecords) #

gmapT :: (forall b. Data b => b -> b) -> UpdateRecords -> UpdateRecords #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpdateRecords -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpdateRecords -> r #

gmapQ :: (forall d. Data d => d -> u) -> UpdateRecords -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UpdateRecords -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpdateRecords -> m UpdateRecords #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateRecords -> m UpdateRecords #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateRecords -> m UpdateRecords #

Read UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Show UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Generic UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Associated Types

type Rep UpdateRecords :: Type -> Type #

Hashable UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

ToJSON UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

AWSRequest UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Associated Types

type Rs UpdateRecords :: Type #

ToHeaders UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

ToPath UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

ToQuery UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

NFData UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Methods

rnf :: UpdateRecords -> () #

type Rep UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

type Rep UpdateRecords = D1 (MetaData "UpdateRecords" "Network.AWS.CognitoSync.UpdateRecords" "amazonka-cognito-sync-1.6.1-ha9SVGJqZqDpQMx6bgfWw" False) (C1 (MetaCons "UpdateRecords'" PrefixI True) ((S1 (MetaSel (Just "_urRecordPatches") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [RecordPatch])) :*: (S1 (MetaSel (Just "_urDeviceId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_urClientContext") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_urIdentityPoolId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_urIdentityId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) :*: (S1 (MetaSel (Just "_urDatasetName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_urSyncSessionToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs UpdateRecords Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Request Lenses

urRecordPatches :: Lens' UpdateRecords [RecordPatch] Source #

A list of patch operations.

urDeviceId :: Lens' UpdateRecords (Maybe Text) Source #

The unique ID generated for this device by Cognito.

urClientContext :: 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.

urIdentityPoolId :: 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.

urIdentityId :: 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.

urDatasetName :: Lens' UpdateRecords Text Source #

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

urSyncSessionToken :: Lens' UpdateRecords Text Source #

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

Destructuring the Response

updateRecordsResponse Source #

Creates a value of UpdateRecordsResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data UpdateRecordsResponse Source #

Returned for a successful UpdateRecordsRequest.

See: updateRecordsResponse smart constructor.

Instances
Eq UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Data UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpdateRecordsResponse -> c UpdateRecordsResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UpdateRecordsResponse #

toConstr :: UpdateRecordsResponse -> Constr #

dataTypeOf :: UpdateRecordsResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UpdateRecordsResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UpdateRecordsResponse) #

gmapT :: (forall b. Data b => b -> b) -> UpdateRecordsResponse -> UpdateRecordsResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpdateRecordsResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpdateRecordsResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> UpdateRecordsResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UpdateRecordsResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpdateRecordsResponse -> m UpdateRecordsResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateRecordsResponse -> m UpdateRecordsResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateRecordsResponse -> m UpdateRecordsResponse #

Read UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Show UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Generic UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Associated Types

type Rep UpdateRecordsResponse :: Type -> Type #

NFData UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

Methods

rnf :: UpdateRecordsResponse -> () #

type Rep UpdateRecordsResponse Source # 
Instance details

Defined in Network.AWS.CognitoSync.UpdateRecords

type Rep UpdateRecordsResponse = D1 (MetaData "UpdateRecordsResponse" "Network.AWS.CognitoSync.UpdateRecords" "amazonka-cognito-sync-1.6.1-ha9SVGJqZqDpQMx6bgfWw" False) (C1 (MetaCons "UpdateRecordsResponse'" PrefixI True) (S1 (MetaSel (Just "_urrsRecords") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Record])) :*: S1 (MetaSel (Just "_urrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))

Response Lenses

urrsRecords :: Lens' UpdateRecordsResponse [Record] Source #

A list of records that have been updated.

urrsResponseStatus :: Lens' UpdateRecordsResponse Int Source #

  • - | The response status code.