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

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@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:

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 # 
Data UpdateRecords Source # 

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 # 
Show UpdateRecords Source # 
Generic UpdateRecords Source # 

Associated Types

type Rep UpdateRecords :: * -> * #

Hashable UpdateRecords Source # 
NFData UpdateRecords Source # 

Methods

rnf :: UpdateRecords -> () #

AWSRequest UpdateRecords Source # 
ToPath UpdateRecords Source # 
ToHeaders UpdateRecords Source # 
ToQuery UpdateRecords Source # 
ToJSON UpdateRecords Source # 

Methods

toJSON :: UpdateRecords -> Value #

toEncoding :: UpdateRecords -> Encoding #

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

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 # 
Data UpdateRecordsResponse Source # 

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 # 
Show UpdateRecordsResponse Source # 
Generic UpdateRecordsResponse Source # 
NFData UpdateRecordsResponse Source # 

Methods

rnf :: UpdateRecordsResponse -> () #

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

Response Lenses

urrsRecords :: Lens' UpdateRecordsResponse [Record] Source #

A list of records that have been updated.