amazonka-cognito-sync-1.4.5: 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 #

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 #

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

See: updateRecords smart constructor.

Instances

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

Associated Types

type Rep UpdateRecords :: * -> * #

Hashable UpdateRecords # 
ToJSON UpdateRecords # 
NFData UpdateRecords # 

Methods

rnf :: UpdateRecords -> () #

AWSRequest UpdateRecords # 
ToQuery UpdateRecords # 
ToPath UpdateRecords # 
ToHeaders UpdateRecords # 
type Rep UpdateRecords # 
type Rep UpdateRecords = D1 (MetaData "UpdateRecords" "Network.AWS.CognitoSync.UpdateRecords" "amazonka-cognito-sync-1.4.5-6kgm8A380gaABwgTunDxt8" 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 # 

Request Lenses

urRecordPatches :: Lens' UpdateRecords [RecordPatch] #

A list of patch operations.

urDeviceId :: Lens' UpdateRecords (Maybe Text) #

The unique ID generated for this device by Cognito.

urClientContext :: Lens' UpdateRecords (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.

urIdentityPoolId :: Lens' UpdateRecords 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.

urIdentityId :: Lens' UpdateRecords 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.

urDatasetName :: Lens' UpdateRecords Text #

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

urSyncSessionToken :: Lens' UpdateRecords Text #

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

Destructuring the Response

updateRecordsResponse #

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 #

Returned for a successful UpdateRecordsRequest.

See: updateRecordsResponse smart constructor.

Instances

Eq UpdateRecordsResponse # 
Data UpdateRecordsResponse # 

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

Methods

rnf :: UpdateRecordsResponse -> () #

type Rep UpdateRecordsResponse # 
type Rep UpdateRecordsResponse = D1 (MetaData "UpdateRecordsResponse" "Network.AWS.CognitoSync.UpdateRecords" "amazonka-cognito-sync-1.4.5-6kgm8A380gaABwgTunDxt8" 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] #

A list of records that have been updated.

urrsResponseStatus :: Lens' UpdateRecordsResponse Int #

  • - | The response status code.