module Network.AWS.CognitoIdentityProvider.GlobalSignOut
(
globalSignOut
, GlobalSignOut
, gsoAccessToken
, globalSignOutResponse
, GlobalSignOutResponse
, gsorsResponseStatus
) 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
newtype GlobalSignOut = GlobalSignOut'
{ _gsoAccessToken :: Sensitive Text
} deriving (Eq, Show, Data, Typeable, Generic)
globalSignOut
:: Text
-> GlobalSignOut
globalSignOut pAccessToken_ =
GlobalSignOut' {_gsoAccessToken = _Sensitive # pAccessToken_}
gsoAccessToken :: Lens' GlobalSignOut Text
gsoAccessToken = lens _gsoAccessToken (\ s a -> s{_gsoAccessToken = a}) . _Sensitive;
instance AWSRequest GlobalSignOut where
type Rs GlobalSignOut = GlobalSignOutResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
GlobalSignOutResponse' <$> (pure (fromEnum s)))
instance Hashable GlobalSignOut where
instance NFData GlobalSignOut where
instance ToHeaders GlobalSignOut where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.GlobalSignOut" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GlobalSignOut where
toJSON GlobalSignOut'{..}
= object
(catMaybes [Just ("AccessToken" .= _gsoAccessToken)])
instance ToPath GlobalSignOut where
toPath = const "/"
instance ToQuery GlobalSignOut where
toQuery = const mempty
newtype GlobalSignOutResponse = GlobalSignOutResponse'
{ _gsorsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
globalSignOutResponse
:: Int
-> GlobalSignOutResponse
globalSignOutResponse pResponseStatus_ =
GlobalSignOutResponse' {_gsorsResponseStatus = pResponseStatus_}
gsorsResponseStatus :: Lens' GlobalSignOutResponse Int
gsorsResponseStatus = lens _gsorsResponseStatus (\ s a -> s{_gsorsResponseStatus = a});
instance NFData GlobalSignOutResponse where