{-# 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.CognitoIdentityProvider.ForgetDevice
(
forgetDevice
, ForgetDevice
, fdAccessToken
, fdDeviceKey
, forgetDeviceResponse
, ForgetDeviceResponse
) where
import Network.AWS.CognitoIdentityProvider.Types
import Network.AWS.CognitoIdentityProvider.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ForgetDevice = ForgetDevice'
{ _fdAccessToken :: !(Maybe (Sensitive Text))
, _fdDeviceKey :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
forgetDevice
:: Text
-> ForgetDevice
forgetDevice pDeviceKey_ =
ForgetDevice' {_fdAccessToken = Nothing, _fdDeviceKey = pDeviceKey_}
fdAccessToken :: Lens' ForgetDevice (Maybe Text)
fdAccessToken = lens _fdAccessToken (\ s a -> s{_fdAccessToken = a}) . mapping _Sensitive
fdDeviceKey :: Lens' ForgetDevice Text
fdDeviceKey = lens _fdDeviceKey (\ s a -> s{_fdDeviceKey = a})
instance AWSRequest ForgetDevice where
type Rs ForgetDevice = ForgetDeviceResponse
request = postJSON cognitoIdentityProvider
response = receiveNull ForgetDeviceResponse'
instance Hashable ForgetDevice where
instance NFData ForgetDevice where
instance ToHeaders ForgetDevice where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.ForgetDevice" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ForgetDevice where
toJSON ForgetDevice'{..}
= object
(catMaybes
[("AccessToken" .=) <$> _fdAccessToken,
Just ("DeviceKey" .= _fdDeviceKey)])
instance ToPath ForgetDevice where
toPath = const "/"
instance ToQuery ForgetDevice where
toQuery = const mempty
data ForgetDeviceResponse =
ForgetDeviceResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
forgetDeviceResponse
:: ForgetDeviceResponse
forgetDeviceResponse = ForgetDeviceResponse'
instance NFData ForgetDeviceResponse where