{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CognitoSync.SubscribeToDataset
(
subscribeToDataset
, SubscribeToDataset
, stdIdentityPoolId
, stdIdentityId
, stdDatasetName
, stdDeviceId
, subscribeToDatasetResponse
, SubscribeToDatasetResponse
, stdrsResponseStatus
) where
import Network.AWS.CognitoSync.Types
import Network.AWS.CognitoSync.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SubscribeToDataset = SubscribeToDataset'
{ _stdIdentityPoolId :: !Text
, _stdIdentityId :: !Text
, _stdDatasetName :: !Text
, _stdDeviceId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
subscribeToDataset
:: Text
-> Text
-> Text
-> Text
-> SubscribeToDataset
subscribeToDataset pIdentityPoolId_ pIdentityId_ pDatasetName_ pDeviceId_ =
SubscribeToDataset'
{ _stdIdentityPoolId = pIdentityPoolId_
, _stdIdentityId = pIdentityId_
, _stdDatasetName = pDatasetName_
, _stdDeviceId = pDeviceId_
}
stdIdentityPoolId :: Lens' SubscribeToDataset Text
stdIdentityPoolId = lens _stdIdentityPoolId (\ s a -> s{_stdIdentityPoolId = a});
stdIdentityId :: Lens' SubscribeToDataset Text
stdIdentityId = lens _stdIdentityId (\ s a -> s{_stdIdentityId = a});
stdDatasetName :: Lens' SubscribeToDataset Text
stdDatasetName = lens _stdDatasetName (\ s a -> s{_stdDatasetName = a});
stdDeviceId :: Lens' SubscribeToDataset Text
stdDeviceId = lens _stdDeviceId (\ s a -> s{_stdDeviceId = a});
instance AWSRequest SubscribeToDataset where
type Rs SubscribeToDataset =
SubscribeToDatasetResponse
request = postJSON cognitoSync
response
= receiveEmpty
(\ s h x ->
SubscribeToDatasetResponse' <$> (pure (fromEnum s)))
instance Hashable SubscribeToDataset
instance NFData SubscribeToDataset
instance ToHeaders SubscribeToDataset where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SubscribeToDataset where
toJSON = const (Object mempty)
instance ToPath SubscribeToDataset where
toPath SubscribeToDataset'{..}
= mconcat
["/identitypools/", toBS _stdIdentityPoolId,
"/identities/", toBS _stdIdentityId, "/datasets/",
toBS _stdDatasetName, "/subscriptions/",
toBS _stdDeviceId]
instance ToQuery SubscribeToDataset where
toQuery = const mempty
newtype SubscribeToDatasetResponse = SubscribeToDatasetResponse'
{ _stdrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
subscribeToDatasetResponse
:: Int
-> SubscribeToDatasetResponse
subscribeToDatasetResponse pResponseStatus_ =
SubscribeToDatasetResponse'
{ _stdrsResponseStatus = pResponseStatus_
}
stdrsResponseStatus :: Lens' SubscribeToDatasetResponse Int
stdrsResponseStatus = lens _stdrsResponseStatus (\ s a -> s{_stdrsResponseStatus = a});
instance NFData SubscribeToDatasetResponse