'Lists datasets for an identity. 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.
:type identity_pool_id: string
:param identity_pool_id: 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.
:type identity_id: string
:param identity_id: 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.
:type next_token: string
:param next_token: A pagination token for obtaining the next page of
results.
:type max_results: integer
:param max_results: The maximum number of results to be returned.'

def list_datasets(self, identity_pool_id, identity_id, next_token=None, max_results=None):

    uri = '/identitypools/{0}/identities/{1}/datasets'.format(identity_pool_id, identity_id)
    params = {}
    headers = {}
    query_params = {}
    if (next_token is not None):
        query_params['nextToken'] = next_token
    if (max_results is not None):
        query_params['maxResults'] = max_results
    return self.make_request('GET', uri, expected_status=200, data=json.dumps(params), headers=headers, params=query_params)
