Class CognitoSyncClient
Client to interact with Amazon Cognito Sync
- Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
-
Guzzle\Http\Client implements Guzzle\Http\ClientInterface
-
Guzzle\Service\Client implements Guzzle\Service\ClientInterface
-
Aws\Common\Client\AbstractClient implements Aws\Common\Client\AwsClientInterface
-
Aws\CognitoSync\CognitoSyncClient
Link: User guide
Link: API docs
Located at Aws/CognitoSync/CognitoSyncClient.php
Methods summary
-
public static
factory ( array $config = array() )
Executes the UpdateRecords operation.
-
public
bulkPublish ( array $args = array() )
Executes the BulkPublish operation.
-
public
deleteDataset ( array $args = array() )
Executes the DeleteDataset operation.
-
public
describeDataset ( array $args = array() )
Executes the DescribeDataset operation.
-
public
describeIdentityPoolUsage ( array $args = array() )
Executes the DescribeIdentityPoolUsage operation.
-
public
describeIdentityUsage ( array $args = array() )
Executes the DescribeIdentityUsage operation.
-
public
getBulkPublishDetails ( array $args = array() )
Executes the GetBulkPublishDetails operation.
-
public
getCognitoEvents ( array $args = array() )
Executes the GetCognitoEvents operation.
-
public
getIdentityPoolConfiguration ( array $args = array() )
Executes the GetIdentityPoolConfiguration operation.
-
public
listDatasets ( array $args = array() )
Executes the ListDatasets operation.
-
public
listIdentityPoolUsage ( array $args = array() )
Executes the ListIdentityPoolUsage operation.
-
public
listRecords ( array $args = array() )
Executes the ListRecords operation.
-
public
registerDevice ( array $args = array() )
Executes the RegisterDevice operation.
-
public
setCognitoEvents ( array $args = array() )
Executes the SetCognitoEvents operation.
-
public
setIdentityPoolConfiguration ( array $args = array() )
Executes the SetIdentityPoolConfiguration operation.
-
public
subscribeToDataset ( array $args = array() )
Executes the SubscribeToDataset operation.
-
public
unsubscribeFromDataset ( array $args = array() )
Executes the UnsubscribeFromDataset operation.
-
public
updateRecords ( array $args = array() )
Executes the UpdateRecords operation.
Methods detail
Executes the UpdateRecords operation.
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.
Parameters
- $config
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
DeviceId => (string)The unique ID generated for this device by Cognito.
-
RecordPatches => (array<associative-array>)A list of patch operations.- (associative-array)
An update operation for a record.
-
Op => (string:replace |remove )An operation, either replace or remove. -
Key => (string)The key associated with the record patch. -
Value => (string)The value associated with the record patch. -
SyncCount => (int)Last known server sync count for this record. Set to 0 if unknown. -
DeviceLastModifiedDate => (string [date format]|int [unix timestamp]|\DateTime)The last modified date of the client device.
-
- (associative-array)
-
SyncSessionToken => (string)The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity. -
ClientContext => (string)Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Records => (array<associative-array>)A list of records that have been updated.- (associative-array)
The basic data structure of a dataset.
-
Key => (string)The key for the record. -
Value => (string)The value for the record. -
SyncCount => (int)The server sync count for this record. -
LastModifiedDate => (string)The date on which the record was last modified. -
LastModifiedBy => (string)The user/device that made the last change to this record. -
DeviceLastModifiedDate => (string)The last modified date of the client device.
-
- (associative-array)
Overrides
Executes the BulkPublish operation.
Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream. Customers are limited to one successful bulk publish per 24 hours. Bulk publish is an asynchronous request, customers can see the status of the request via the GetBulkPublishDetails operation.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->bulkPublish(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolId => (string)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.
Executes the DeleteDataset operation.
Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.
Examples
- Basic formatting example
$result = $client->deleteDataset(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Dataset => (associative-array)A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don't exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.-
IdentityId => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
CreationDate => (string)Date on which the dataset was created. -
LastModifiedDate => (string)Date when the dataset was last modified. -
LastModifiedBy => (string)The device that made the last change to this dataset. -
DataStorage => (int)Total size in bytes of the records in this dataset. -
NumRecords => (int)Number of records in this dataset.
-
Executes the DescribeDataset operation.
Gets meta data about a dataset by identity and dataset name. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.
Examples
- Basic formatting example
$result = $client->describeDataset(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Dataset => (associative-array)Meta data for a collection of data for an identity. An identity can have multiple datasets. A dataset can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don't exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.-
IdentityId => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
CreationDate => (string)Date on which the dataset was created. -
LastModifiedDate => (string)Date when the dataset was last modified. -
LastModifiedBy => (string)The device that made the last change to this dataset. -
DataStorage => (int)Total size in bytes of the records in this dataset. -
NumRecords => (int)Number of records in this dataset.
-
Executes the DescribeIdentityPoolUsage operation.
Gets usage details (for example, data storage) about a particular identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->describeIdentityPoolUsage(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolUsage => (associative-array)Information about the usage of the identity pool.-
IdentityPoolId => (string)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. -
SyncSessionsCount => (int)Number of sync sessions for the identity pool. -
DataStorage => (int)Data storage information for the identity pool. -
LastModifiedDate => (string)Date on which the identity pool was last modified.
-
Executes the DescribeIdentityUsage operation.
Gets usage information for an identity, including number of datasets and data usage.
This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.
Examples
- Basic formatting example
$result = $client->describeIdentityUsage(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityUsage => (associative-array)Usage information for the identity.-
IdentityId => (string)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. -
IdentityPoolId => (string)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. -
LastModifiedDate => (string)Date on which the identity was last modified. -
DatasetCount => (int)Number of datasets for the identity. -
DataStorage => (int)Total data storage for this identity.
-
Executes the GetBulkPublishDetails operation.
Get the status of the last BulkPublish operation for an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->getBulkPublishDetails(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolId => (string)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. -
BulkPublishStartTime => (string)The date/time at which the last bulk publish was initiated. -
BulkPublishCompleteTime => (string)If BulkPublishStatus is SUCCEEDED, the time the last bulk publish operation completed. -
BulkPublishStatus => (string)Status of the last bulk publish operation, valid values are:NOT_STARTED - No bulk publish has been requested for this identity pool
IN_PROGRESS - Data is being published to the configured stream
SUCCEEDED - All data for the identity pool has been published to the configured stream
FAILED - Some portion of the data has failed to publish, check FailureMessage for the cause.
-
FailureMessage => (string)If BulkPublishStatus is FAILED this field will contain the error message that caused the bulk publish to fail.
Executes the GetCognitoEvents operation.
Gets the events and the corresponding Lambda functions associated with an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->getCognitoEvents(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)The Cognito Identity Pool ID for the request
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Events => (associative-array<string>)Associative array of <string> keys mapping to (string) values. Each array key should be changed to an appropriate <string>.
The Cognito Events returned from the GetCognitoEvents request
-
<string> => (string)
-
Executes the GetIdentityPoolConfiguration operation.
Gets the configuration settings of an identity pool.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->getIdentityPoolConfiguration(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolId => (string)A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.
-
PushSync => (associative-array)Options to apply to this identity pool for push synchronization.
-
ApplicationArns => (array<string>)List of SNS platform application ARNs that could be used by clients.
-
RoleArn => (string)A role configured to allow Cognito to call SNS on behalf of the developer.
-
-
CognitoStreams => (associative-array)Options to apply to this identity pool for Amazon Cognito streams.-
StreamName => (string)The name of the Cognito stream to receive updates. This stream must be in the developers account and in the same region as the identity pool. -
RoleArn => (string)The ARN of the role Amazon Cognito can assume in order to publish to the stream. This role must grant access to Amazon Cognito (cognito-sync) to invoke PutRecord on your Cognito stream. -
StreamingStatus => (string)Status of the Cognito streams. Valid values are:ENABLED - Streaming of updates to identity pool is enabled.
DISABLED - Streaming of updates to identity pool is disabled. Bulk publish will also fail if StreamingStatus is DISABLED.
-
Executes the ListDatasets operation.
Lists datasets for an identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.
ListDatasets can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use the Cognito Identity credentials to make this API call.
Examples
- Basic formatting example
$result = $client->listDatasets(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', 'NextToken' => 'string', 'MaxResults' => integer, ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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. -
NextToken => (string)A pagination token for obtaining the next page of results. -
MaxResults => (int)The maximum number of results to be returned.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Datasets => (array<associative-array>)A set of datasets.- (associative-array)
A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don't exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.
-
IdentityId => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
CreationDate => (string)Date on which the dataset was created. -
LastModifiedDate => (string)Date when the dataset was last modified. -
LastModifiedBy => (string)The device that made the last change to this dataset. -
DataStorage => (int)Total size in bytes of the records in this dataset. -
NumRecords => (int)Number of records in this dataset.
-
- (associative-array)
-
Count => (int)Number of datasets returned. -
NextToken => (string)A pagination token for obtaining the next page of results.
Executes the ListIdentityPoolUsage operation.
Gets a list of identity pools registered with Cognito.
ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->listIdentityPoolUsage(array( 'NextToken' => 'string', 'MaxResults' => integer, ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
NextToken => (string)A pagination token for obtaining the next page of results. -
MaxResults => (int)The maximum number of results to be returned.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolUsages => (array<associative-array>)Usage information for the identity pools.- (associative-array)
Usage information for the identity pool.
-
IdentityPoolId => (string)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. -
SyncSessionsCount => (int)Number of sync sessions for the identity pool. -
DataStorage => (int)Data storage information for the identity pool. -
LastModifiedDate => (string)Date on which the identity pool was last modified.
-
- (associative-array)
-
MaxResults => (int)The maximum number of results to be returned. -
Count => (int)Total number of identities for the identity pool. -
NextToken => (string)A pagination token for obtaining the next page of results.
Executes the ListRecords operation.
Gets paginated records, optionally changed after a particular sync count for a dataset and identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.
ListRecords can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.
Examples
- Basic formatting example
$result = $client->listRecords(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', 'LastSyncCount' => integer, 'NextToken' => 'string', 'MaxResults' => integer, 'SyncSessionToken' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
LastSyncCount => (int)The last server sync count for this record. -
NextToken => (string)A pagination token for obtaining the next page of results. -
MaxResults => (int)The maximum number of results to be returned. -
SyncSessionToken => (string)A token containing a session ID, identity ID, and expiration.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Records => (array<associative-array>)A list of all records.- (associative-array)
The basic data structure of a dataset.
-
Key => (string)The key for the record. -
Value => (string)The value for the record. -
SyncCount => (int)The server sync count for this record. -
LastModifiedDate => (string)The date on which the record was last modified. -
LastModifiedBy => (string)The user/device that made the last change to this record. -
DeviceLastModifiedDate => (string)The last modified date of the client device.
-
- (associative-array)
-
NextToken => (string)A pagination token for obtaining the next page of results. -
Count => (int)Total number of records. -
DatasetSyncCount => (int)Server sync count for this dataset. -
LastModifiedBy => (string)The user/device that made the last change to this record. -
MergedDatasetNames => (array<string>)Names of merged datasets. -
DatasetExists => (bool)Indicates whether the dataset exists. -
DatasetDeletedAfterRequestedSyncCount => (bool)A boolean value specifying whether to delete the dataset locally. -
SyncSessionToken => (string)A token containing a session ID, identity ID, and expiration.
Executes the RegisterDevice operation.
Registers a device to receive push sync notifications.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
Examples
- Basic formatting example
$result = $client->registerDevice(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // Platform is required 'Platform' => 'string', // Token is required 'Token' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
IdentityId => (string)The unique ID for this identity.
-
Platform => (string:APNS |APNS_SANDBOX |GCM |ADM )The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).
-
Token => (string)The push token.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
DeviceId => (string)The unique ID generated for this device by Cognito.
Executes the SetCognitoEvents operation.
Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->setCognitoEvents(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // Events is required 'Events' => array( // Associative array of custom 'CognitoEventType' key names 'CognitoEventType' => 'string', // ... repeated ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)The Cognito Identity Pool to use when configuring Cognito Events
-
Events => (associative-array<string>)Associative array of <CognitoEventType> keys mapping to (string) values. Each array key should be changed to an appropriate <CognitoEventType>.
The events to configure
-
<CognitoEventType> => (string)
-
-
Returns
Executes the SetIdentityPoolConfiguration operation.
Sets the necessary configuration for push sync.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Examples
- Basic formatting example
$result = $client->setIdentityPoolConfiguration(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', 'PushSync' => array( 'ApplicationArns' => array('string', ... ), 'RoleArn' => 'string', ), 'CognitoStreams' => array( 'StreamName' => 'string', 'RoleArn' => 'string', 'StreamingStatus' => 'string', ), ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
PushSync => (associative-array)Options to apply to this identity pool for push synchronization.
-
ApplicationArns => (array<string>)List of SNS platform application ARNs that could be used by clients.
-
RoleArn => (string)A role configured to allow Cognito to call SNS on behalf of the developer.
-
-
CognitoStreams => (associative-array)Options to apply to this identity pool for Amazon Cognito streams.-
StreamName => (string)The name of the Cognito stream to receive updates. This stream must be in the developers account and in the same region as the identity pool. -
RoleArn => (string)The ARN of the role Amazon Cognito can assume in order to publish to the stream. This role must grant access to Amazon Cognito (cognito-sync) to invoke PutRecord on your Cognito stream. -
StreamingStatus => (string:ENABLED |DISABLED )Status of the Cognito streams. Valid values are:ENABLED - Streaming of updates to identity pool is enabled.
DISABLED - Streaming of updates to identity pool is disabled. Bulk publish will also fail if StreamingStatus is DISABLED.
-
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
IdentityPoolId => (string)A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.
-
PushSync => (associative-array)Options to apply to this identity pool for push synchronization.
-
ApplicationArns => (array<string>)List of SNS platform application ARNs that could be used by clients.
-
RoleArn => (string)A role configured to allow Cognito to call SNS on behalf of the developer.
-
-
CognitoStreams => (associative-array)Options to apply to this identity pool for Amazon Cognito streams.-
StreamName => (string)The name of the Cognito stream to receive updates. This stream must be in the developers account and in the same region as the identity pool. -
RoleArn => (string)The ARN of the role Amazon Cognito can assume in order to publish to the stream. This role must grant access to Amazon Cognito (cognito-sync) to invoke PutRecord on your Cognito stream. -
StreamingStatus => (string)Status of the Cognito streams. Valid values are:ENABLED - Streaming of updates to identity pool is enabled.
DISABLED - Streaming of updates to identity pool is disabled. Bulk publish will also fail if StreamingStatus is DISABLED.
-
Executes the SubscribeToDataset operation.
Subscribes to receive notifications when a dataset is modified by another device.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
Examples
- Basic formatting example
$result = $client->subscribeToDataset(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', // DeviceId is required 'DeviceId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
IdentityId => (string)Unique ID for this identity.
-
DatasetName => (string)The name of the dataset to subcribe to.
-
DeviceId => (string)The unique ID generated for this device by Cognito.
-
Returns
Executes the UnsubscribeFromDataset operation.
Unsubscribes from receiving notifications when a dataset is modified by another device.
This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.
Examples
- Basic formatting example
$result = $client->unsubscribeFromDataset(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', // DeviceId is required 'DeviceId' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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.
-
IdentityId => (string)Unique ID for this identity.
-
DatasetName => (string)The name of the dataset from which to unsubcribe.
-
DeviceId => (string)The unique ID generated for this device by Cognito.
-
Returns
Executes the UpdateRecords operation.
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.
Examples
- Basic formatting example
$result = $client->updateRecords(array( // IdentityPoolId is required 'IdentityPoolId' => 'string', // IdentityId is required 'IdentityId' => 'string', // DatasetName is required 'DatasetName' => 'string', 'DeviceId' => 'string', 'RecordPatches' => array( array( // Op is required 'Op' => 'string', // Key is required 'Key' => 'string', 'Value' => 'string', // SyncCount is required 'SyncCount' => integer, 'DeviceLastModifiedDate' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime', ), // ... repeated ), // SyncSessionToken is required 'SyncSessionToken' => 'string', 'ClientContext' => 'string', ));
Parameters
- $args
array
$arg Associative array containing the following keys (required keys are bold):-
IdentityPoolId => (string)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 => (string)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 => (string)A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot). -
DeviceId => (string)The unique ID generated for this device by Cognito.
-
RecordPatches => (array<associative-array>)A list of patch operations.- (associative-array)
An update operation for a record.
-
Op => (string:replace |remove )An operation, either replace or remove. -
Key => (string)The key associated with the record patch. -
Value => (string)The value associated with the record patch. -
SyncCount => (int)Last known server sync count for this record. Set to 0 if unknown. -
DeviceLastModifiedDate => (string [date format]|int [unix timestamp]|\DateTime)The last modified date of the client device.
-
- (associative-array)
-
SyncSessionToken => (string)The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity. -
ClientContext => (string)Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
-
Returns
Guzzle\Service\Resource\Model
Returns a response Model object
-
Records => (array<associative-array>)A list of records that have been updated.- (associative-array)
The basic data structure of a dataset.
-
Key => (string)The key for the record. -
Value => (string)The value for the record. -
SyncCount => (int)The server sync count for this record. -
LastModifiedDate => (string)The date on which the record was last modified. -
LastModifiedBy => (string)The user/device that made the last change to this record. -
DeviceLastModifiedDate => (string)The last modified date of the client device.
-
- (associative-array)
Methods inherited from Aws\Common\Client\AbstractClient
__call()
,
__construct()
,
createRequest()
,
getAllEvents()
,
getApiVersion()
,
getCredentials()
,
getRegion()
,
getRegions()
,
getSignature()
,
getWaiter()
,
getWaiterFactory()
,
send()
,
setCredentials()
,
setRegion()
,
setWaiterFactory()
,
waitUntil()
Methods inherited from Guzzle\Service\Client
execute()
,
executeMultiple()
,
getCommand()
,
getCommandFactory()
,
getDescription()
,
getInflector()
,
getIterator()
,
getResourceIteratorFactory()
,
prepareCommand()
,
setCommandFactory()
,
setDescription()
,
setInflector()
,
setResourceIteratorFactory()
Methods inherited from Guzzle\Http\Client
delete()
,
expandTemplate()
,
extractPharCacert()
,
get()
,
getBaseUrl()
,
getConfig()
,
getCurlMulti()
,
getDefaultOption()
,
getDefaultUserAgent()
,
getUriTemplate()
,
head()
,
initSsl()
,
options()
,
patch()
,
post()
,
prepareRequest()
,
put()
,
sendMultiple()
,
setBaseUrl()
,
setConfig()
,
setCurlMulti()
,
setDefaultOption()
,
setRequestFactory()
,
setSslVerification()
,
setUriTemplate()
,
setUserAgent()
Methods inherited from Guzzle\Common\AbstractHasDispatcher
addSubscriber()
,
dispatch()
,
getEventDispatcher()
,
setEventDispatcher()
Magic methods summary
Constants summary
string |
LATEST_API_VERSION |
'2014-06-30' |
Constants inherited from Guzzle\Service\Client
Constants inherited from Guzzle\Http\Client
CURL_OPTIONS
,
DEFAULT_SELECT_TIMEOUT
,
DISABLE_REDIRECTS
,
MAX_HANDLES
,
REQUEST_OPTIONS
,
SSL_CERT_AUTHORITY
Constants inherited from Guzzle\Http\ClientInterface
Properties summary
Properties inherited from Aws\Common\Client\AbstractClient
$aggregator
,
$credentials
,
$signature
,
$waiterFactory
Properties inherited from Guzzle\Service\Client
$commandFactory
,
$inflector
,
$resourceIteratorFactory
,
$serviceDescription
Properties inherited from Guzzle\Http\Client
$defaultHeaders
,
$requestFactory
,
$userAgent