{-# 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.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 :: Maybe (Sensitive Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
globalSignOut
:: GlobalSignOut
globalSignOut =
GlobalSignOut'
{ _gsoAccessToken = Nothing
}
gsoAccessToken :: Lens' GlobalSignOut (Maybe Text)
gsoAccessToken = lens _gsoAccessToken (\ s a -> s{_gsoAccessToken = a}) . mapping _Sensitive;
instance AWSRequest GlobalSignOut where
type Rs GlobalSignOut = GlobalSignOutResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
GlobalSignOutResponse' <$> (pure (fromEnum s)))
instance Hashable GlobalSignOut
instance NFData GlobalSignOut
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 [("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