/AWS1/CL_CGS=>LISTRECORDS()
¶
About ListRecords¶
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.
{
"Operation": "com.amazonaws.cognito.sync.model#ListRecords",
"Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService",
"Input":
{
"IdentityPoolId": "IDENTITY_POOL_ID",
"IdentityId": "IDENTITY_ID",
"DatasetName": "newDataSet"
}
}
{ "Output": { "__type": "com.amazonaws.cognito.sync.model#ListRecordsResponse", "Count": 0, "DatasetDeletedAfterRequestedSyncCount": false, "DatasetExists": false, "DatasetSyncCount": 0, "LastModifiedBy": null, "MergedDatasetNames": null, "NextToken": null, "Records": [], "SyncSessionToken": "SYNC_SESSION_TOKEN" }, "Version": "1.0" }
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_identitypoolid
TYPE /AWS1/CGSIDENTITYPOOLID
/AWS1/CGSIDENTITYPOOLID
¶
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.
iv_identityid
TYPE /AWS1/CGSIDENTITYID
/AWS1/CGSIDENTITYID
¶
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.
iv_datasetname
TYPE /AWS1/CGSDATASETNAME
/AWS1/CGSDATASETNAME
¶
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
Optional arguments:¶
iv_lastsynccount
TYPE /AWS1/CGSLONG
/AWS1/CGSLONG
¶
The last server sync count for this record.
iv_nexttoken
TYPE /AWS1/CGSSTRING
/AWS1/CGSSTRING
¶
A pagination token for obtaining the next page of results.
iv_maxresults
TYPE /AWS1/CGSINTEGERSTRING
/AWS1/CGSINTEGERSTRING
¶
The maximum number of results to be returned.
iv_syncsessiontoken
TYPE /AWS1/CGSSYNCSESSIONTOKEN
/AWS1/CGSSYNCSESSIONTOKEN
¶
A token containing a session ID, identity ID, and expiration.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_cgslistrecordsrsp
/AWS1/CL_CGSLISTRECORDSRSP
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_cgs~listrecords(
iv_datasetname = |string|
iv_identityid = |string|
iv_identitypoolid = |string|
iv_lastsynccount = 123
iv_maxresults = 123
iv_nexttoken = |string|
iv_syncsessiontoken = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_records( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_recordkey = lo_row_1->get_key( ).
lv_recordvalue = lo_row_1->get_value( ).
lv_long = lo_row_1->get_synccount( ).
lv_date = lo_row_1->get_lastmodifieddate( ).
lv_string = lo_row_1->get_lastmodifiedby( ).
lv_date = lo_row_1->get_devicelastmodifieddate( ).
ENDIF.
ENDLOOP.
lv_string = lo_result->get_nexttoken( ).
lv_integer = lo_result->get_count( ).
lv_long = lo_result->get_datasetsynccount( ).
lv_string = lo_result->get_lastmodifiedby( ).
LOOP AT lo_result->get_mergeddatasetnames( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
lv_boolean = lo_result->get_datasetexists( ).
lv_boolean = lo_result->get_dsdeldafrreqedsynccount( ).
lv_string = lo_result->get_syncsessiontoken( ).
ENDIF.