module Network.AWS.CognitoSync.ListRecords
(
listRecords
, ListRecords
, lrLastSyncCount
, lrNextToken
, lrSyncSessionToken
, lrMaxResults
, lrIdentityPoolId
, lrIdentityId
, lrDatasetName
, listRecordsResponse
, ListRecordsResponse
, lrrsDatasetDeletedAfterRequestedSyncCount
, lrrsDatasetExists
, lrrsCount
, lrrsRecords
, lrrsNextToken
, lrrsMergedDatasetNames
, lrrsSyncSessionToken
, lrrsLastModifiedBy
, lrrsDatasetSyncCount
, lrrsResponseStatus
) where
import Network.AWS.CognitoSync.Types
import Network.AWS.CognitoSync.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListRecords = ListRecords'
{ _lrLastSyncCount :: !(Maybe Integer)
, _lrNextToken :: !(Maybe Text)
, _lrSyncSessionToken :: !(Maybe Text)
, _lrMaxResults :: !(Maybe Int)
, _lrIdentityPoolId :: !Text
, _lrIdentityId :: !Text
, _lrDatasetName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRecords
:: Text
-> Text
-> Text
-> ListRecords
listRecords pIdentityPoolId_ pIdentityId_ pDatasetName_ =
ListRecords'
{ _lrLastSyncCount = Nothing
, _lrNextToken = Nothing
, _lrSyncSessionToken = Nothing
, _lrMaxResults = Nothing
, _lrIdentityPoolId = pIdentityPoolId_
, _lrIdentityId = pIdentityId_
, _lrDatasetName = pDatasetName_
}
lrLastSyncCount :: Lens' ListRecords (Maybe Integer)
lrLastSyncCount = lens _lrLastSyncCount (\ s a -> s{_lrLastSyncCount = a});
lrNextToken :: Lens' ListRecords (Maybe Text)
lrNextToken = lens _lrNextToken (\ s a -> s{_lrNextToken = a});
lrSyncSessionToken :: Lens' ListRecords (Maybe Text)
lrSyncSessionToken = lens _lrSyncSessionToken (\ s a -> s{_lrSyncSessionToken = a});
lrMaxResults :: Lens' ListRecords (Maybe Int)
lrMaxResults = lens _lrMaxResults (\ s a -> s{_lrMaxResults = a});
lrIdentityPoolId :: Lens' ListRecords Text
lrIdentityPoolId = lens _lrIdentityPoolId (\ s a -> s{_lrIdentityPoolId = a});
lrIdentityId :: Lens' ListRecords Text
lrIdentityId = lens _lrIdentityId (\ s a -> s{_lrIdentityId = a});
lrDatasetName :: Lens' ListRecords Text
lrDatasetName = lens _lrDatasetName (\ s a -> s{_lrDatasetName = a});
instance AWSRequest ListRecords where
type Rs ListRecords = ListRecordsResponse
request = get cognitoSync
response
= receiveJSON
(\ s h x ->
ListRecordsResponse' <$>
(x .?> "DatasetDeletedAfterRequestedSyncCount") <*>
(x .?> "DatasetExists")
<*> (x .?> "Count")
<*> (x .?> "Records" .!@ mempty)
<*> (x .?> "NextToken")
<*> (x .?> "MergedDatasetNames" .!@ mempty)
<*> (x .?> "SyncSessionToken")
<*> (x .?> "LastModifiedBy")
<*> (x .?> "DatasetSyncCount")
<*> (pure (fromEnum s)))
instance ToHeaders ListRecords where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListRecords where
toPath ListRecords'{..}
= mconcat
["/identitypools/", toBS _lrIdentityPoolId,
"/identities/", toBS _lrIdentityId, "/datasets/",
toBS _lrDatasetName, "/records"]
instance ToQuery ListRecords where
toQuery ListRecords'{..}
= mconcat
["lastSyncCount" =: _lrLastSyncCount,
"nextToken" =: _lrNextToken,
"syncSessionToken" =: _lrSyncSessionToken,
"maxResults" =: _lrMaxResults]
data ListRecordsResponse = ListRecordsResponse'
{ _lrrsDatasetDeletedAfterRequestedSyncCount :: !(Maybe Bool)
, _lrrsDatasetExists :: !(Maybe Bool)
, _lrrsCount :: !(Maybe Int)
, _lrrsRecords :: !(Maybe [Record])
, _lrrsNextToken :: !(Maybe Text)
, _lrrsMergedDatasetNames :: !(Maybe [Text])
, _lrrsSyncSessionToken :: !(Maybe Text)
, _lrrsLastModifiedBy :: !(Maybe Text)
, _lrrsDatasetSyncCount :: !(Maybe Integer)
, _lrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRecordsResponse
:: Int
-> ListRecordsResponse
listRecordsResponse pResponseStatus_ =
ListRecordsResponse'
{ _lrrsDatasetDeletedAfterRequestedSyncCount = Nothing
, _lrrsDatasetExists = Nothing
, _lrrsCount = Nothing
, _lrrsRecords = Nothing
, _lrrsNextToken = Nothing
, _lrrsMergedDatasetNames = Nothing
, _lrrsSyncSessionToken = Nothing
, _lrrsLastModifiedBy = Nothing
, _lrrsDatasetSyncCount = Nothing
, _lrrsResponseStatus = pResponseStatus_
}
lrrsDatasetDeletedAfterRequestedSyncCount :: Lens' ListRecordsResponse (Maybe Bool)
lrrsDatasetDeletedAfterRequestedSyncCount = lens _lrrsDatasetDeletedAfterRequestedSyncCount (\ s a -> s{_lrrsDatasetDeletedAfterRequestedSyncCount = a});
lrrsDatasetExists :: Lens' ListRecordsResponse (Maybe Bool)
lrrsDatasetExists = lens _lrrsDatasetExists (\ s a -> s{_lrrsDatasetExists = a});
lrrsCount :: Lens' ListRecordsResponse (Maybe Int)
lrrsCount = lens _lrrsCount (\ s a -> s{_lrrsCount = a});
lrrsRecords :: Lens' ListRecordsResponse [Record]
lrrsRecords = lens _lrrsRecords (\ s a -> s{_lrrsRecords = a}) . _Default . _Coerce;
lrrsNextToken :: Lens' ListRecordsResponse (Maybe Text)
lrrsNextToken = lens _lrrsNextToken (\ s a -> s{_lrrsNextToken = a});
lrrsMergedDatasetNames :: Lens' ListRecordsResponse [Text]
lrrsMergedDatasetNames = lens _lrrsMergedDatasetNames (\ s a -> s{_lrrsMergedDatasetNames = a}) . _Default . _Coerce;
lrrsSyncSessionToken :: Lens' ListRecordsResponse (Maybe Text)
lrrsSyncSessionToken = lens _lrrsSyncSessionToken (\ s a -> s{_lrrsSyncSessionToken = a});
lrrsLastModifiedBy :: Lens' ListRecordsResponse (Maybe Text)
lrrsLastModifiedBy = lens _lrrsLastModifiedBy (\ s a -> s{_lrrsLastModifiedBy = a});
lrrsDatasetSyncCount :: Lens' ListRecordsResponse (Maybe Integer)
lrrsDatasetSyncCount = lens _lrrsDatasetSyncCount (\ s a -> s{_lrrsDatasetSyncCount = a});
lrrsResponseStatus :: Lens' ListRecordsResponse Int
lrrsResponseStatus = lens _lrrsResponseStatus (\ s a -> s{_lrrsResponseStatus = a});