module Network.AWS.CognitoSync.UnsubscribeFromDataset
(
unsubscribeFromDataset
, UnsubscribeFromDataset
, ufdIdentityPoolId
, ufdIdentityId
, ufdDatasetName
, ufdDeviceId
, unsubscribeFromDatasetResponse
, UnsubscribeFromDatasetResponse
, ufdrsStatus
) 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 UnsubscribeFromDataset = UnsubscribeFromDataset'
{ _ufdIdentityPoolId :: !Text
, _ufdIdentityId :: !Text
, _ufdDatasetName :: !Text
, _ufdDeviceId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
unsubscribeFromDataset
:: Text
-> Text
-> Text
-> Text
-> UnsubscribeFromDataset
unsubscribeFromDataset pIdentityPoolId_ pIdentityId_ pDatasetName_ pDeviceId_ =
UnsubscribeFromDataset'
{ _ufdIdentityPoolId = pIdentityPoolId_
, _ufdIdentityId = pIdentityId_
, _ufdDatasetName = pDatasetName_
, _ufdDeviceId = pDeviceId_
}
ufdIdentityPoolId :: Lens' UnsubscribeFromDataset Text
ufdIdentityPoolId = lens _ufdIdentityPoolId (\ s a -> s{_ufdIdentityPoolId = a});
ufdIdentityId :: Lens' UnsubscribeFromDataset Text
ufdIdentityId = lens _ufdIdentityId (\ s a -> s{_ufdIdentityId = a});
ufdDatasetName :: Lens' UnsubscribeFromDataset Text
ufdDatasetName = lens _ufdDatasetName (\ s a -> s{_ufdDatasetName = a});
ufdDeviceId :: Lens' UnsubscribeFromDataset Text
ufdDeviceId = lens _ufdDeviceId (\ s a -> s{_ufdDeviceId = a});
instance AWSRequest UnsubscribeFromDataset where
type Sv UnsubscribeFromDataset = CognitoSync
type Rs UnsubscribeFromDataset =
UnsubscribeFromDatasetResponse
request = delete
response
= receiveEmpty
(\ s h x ->
UnsubscribeFromDatasetResponse' <$>
(pure (fromEnum s)))
instance ToHeaders UnsubscribeFromDataset where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath UnsubscribeFromDataset where
toPath UnsubscribeFromDataset'{..}
= mconcat
["/identitypools/", toBS _ufdIdentityPoolId,
"/identities/", toBS _ufdIdentityId, "/datasets/",
toBS _ufdDatasetName, "/subscriptions/",
toBS _ufdDeviceId]
instance ToQuery UnsubscribeFromDataset where
toQuery = const mempty
newtype UnsubscribeFromDatasetResponse = UnsubscribeFromDatasetResponse'
{ _ufdrsStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
unsubscribeFromDatasetResponse
:: Int
-> UnsubscribeFromDatasetResponse
unsubscribeFromDatasetResponse pStatus_ =
UnsubscribeFromDatasetResponse'
{ _ufdrsStatus = pStatus_
}
ufdrsStatus :: Lens' UnsubscribeFromDatasetResponse Int
ufdrsStatus = lens _ufdrsStatus (\ s a -> s{_ufdrsStatus = a});