2014/11/06 - Amazon Cognito Sync - 5 new 1 updated api methods
Gets the configuration settings of an identity pool.
Request Syntax
client.get_identity_pool_configuration( IdentityPoolId='string' )
string
[REQUIRED]
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.
dict
Response Syntax
{ 'IdentityPoolId': 'string', 'PushSync': { 'ApplicationArns': [ 'string', ], 'RoleArn': 'string' } }
Response Structure
(dict) --
The response from GetIdentityPoolConfigurationResponse .
IdentityPoolId (string) --
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.
PushSync (dict) --
Configuration options applied to the identity pool.
ApplicationArns (list) --
List of SNS platform application ARNs that could be used by clients.
(string) --
RoleArn (string) --
A role configured to allow Cognito to call SNS on behalf of the developer.
Subscribes to receive notifications when a dataset is modified by another device.
Request Syntax
client.subscribe_to_dataset( IdentityPoolId='string', IdentityId='string', DatasetName='string', DeviceId='string' )
string
[REQUIRED]
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.
string
[REQUIRED]
Unique ID for this identity.
string
[REQUIRED]
The name of the dataset to subcribe to.
string
[REQUIRED]
The unique ID generated for this device by Cognito.
dict
Response Syntax
{}
Response Structure
(dict) --
Response to a SubscribeToDataset request.
Registers a device to receive push sync notifications.
Request Syntax
client.register_device( IdentityPoolId='string', IdentityId='string', Platform='APNS'|'APNS_SANDBOX'|'GCM'|'ADM', Token='string' )
string
[REQUIRED]
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. Here, the ID of the pool that the identity belongs to.
string
[REQUIRED]
The unique ID for this identity.
string
[REQUIRED]
The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).
string
[REQUIRED]
The push token.
dict
Response Syntax
{ 'DeviceId': 'string' }
Response Structure
(dict) --
Response to a RegisterDevice request.
DeviceId (string) --
The unique ID generated for this device by Cognito.
Unsubscribe from receiving notifications when a dataset is modified by another device.
Request Syntax
client.unsubscribe_from_dataset( IdentityPoolId='string', IdentityId='string', DatasetName='string', DeviceId='string' )
string
[REQUIRED]
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which this identity belongs.
string
[REQUIRED]
Unique ID for this identity.
string
[REQUIRED]
The name of the dataset from which to unsubcribe.
string
[REQUIRED]
The unique ID generated for this device by Cognito.
dict
Response Syntax
{}
Response Structure
(dict) --
Response to an UnsubscribeFromDataset request.
Sets the necessary configuration for push sync.
Request Syntax
client.set_identity_pool_configuration( IdentityPoolId='string', PushSync={ 'ApplicationArns': [ 'string', ], 'RoleArn': 'string' } )
string
[REQUIRED]
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.
dict
Configuration options to be applied to the identity pool.
ApplicationArns (list) --
List of SNS platform application ARNs that could be used by clients.
(string) --
RoleArn (string) --
A role configured to allow Cognito to call SNS on behalf of the developer.
dict
Response Syntax
{ 'IdentityPoolId': 'string', 'PushSync': { 'ApplicationArns': [ 'string', ], 'RoleArn': 'string' } }
Response Structure
(dict) --
Response to a SetIdentityPoolConfiguration request.
IdentityPoolId (string) --
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.
PushSync (dict) --
Configuration options applied to the identity pool.
ApplicationArns (list) --
List of SNS platform application ARNs that could be used by clients.
(string) --
RoleArn (string) --
A role configured to allow Cognito to call SNS on behalf of the developer.
{'DeviceId': 'string'}
Posts updates to records and add and delete records for a dataset and user. The credentials used to make this API call need to have access to the identity data. With Amazon Cognito Sync, each identity has access only to its own data. You should use Amazon Cognito Identity service to retrieve the credentials necessary to make this API call.
Request Syntax
client.update_records( IdentityPoolId='string', IdentityId='string', DatasetName='string', DeviceId='string', RecordPatches=[ { 'Op': 'replace'|'remove', 'Key': 'string', 'Value': 'string', 'SyncCount': 123, 'DeviceLastModifiedDate': datetime(2015, 1, 1) }, ], SyncSessionToken='string', ClientContext='string' )
string
[REQUIRED] 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.
string
[REQUIRED] 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.
string
[REQUIRED] A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
string
The unique ID generated for this device by Cognito.
list
A list of patch operations.
(dict) -- An update operation for a record.
Op (string) -- [REQUIRED] An operation, either replace or remove.
Key (string) -- [REQUIRED] The key associated with the record patch.
Value (string) -- The value associated with the record patch.
SyncCount (integer) -- [REQUIRED] Last known server sync count for this record. Set to 0 if unknown.
DeviceLastModifiedDate (datetime) -- The last modified date of the client device.
string
[REQUIRED] The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
string
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
dict
Response Syntax
{ 'Records': [ { 'Key': 'string', 'Value': 'string', 'SyncCount': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'LastModifiedBy': 'string', 'DeviceLastModifiedDate': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) -- Returned for a successful UpdateRecordsRequest.
Records (list) -- A list of records that have been updated.
(dict) -- The basic data structure of a dataset.
Key (string) -- The key for the record.
Value (string) -- The value for the record.
SyncCount (integer) -- The server sync count for this record.
LastModifiedDate (datetime) -- The date on which the record was last modified.
LastModifiedBy (string) -- The user/device that made the last change to this record.
DeviceLastModifiedDate (datetime) -- The last modified date of the client device.