{-# 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.AdminUserGlobalSignOut
(
adminUserGlobalSignOut
, AdminUserGlobalSignOut
, augsoUserPoolId
, augsoUsername
, adminUserGlobalSignOutResponse
, AdminUserGlobalSignOutResponse
, augsorsResponseStatus
) 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 AdminUserGlobalSignOut = AdminUserGlobalSignOut'
{ _augsoUserPoolId :: !Text
, _augsoUsername :: !(Sensitive Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
adminUserGlobalSignOut
:: Text
-> Text
-> AdminUserGlobalSignOut
adminUserGlobalSignOut pUserPoolId_ pUsername_ =
AdminUserGlobalSignOut'
{ _augsoUserPoolId = pUserPoolId_
, _augsoUsername = _Sensitive # pUsername_
}
augsoUserPoolId :: Lens' AdminUserGlobalSignOut Text
augsoUserPoolId = lens _augsoUserPoolId (\ s a -> s{_augsoUserPoolId = a});
augsoUsername :: Lens' AdminUserGlobalSignOut Text
augsoUsername = lens _augsoUsername (\ s a -> s{_augsoUsername = a}) . _Sensitive;
instance AWSRequest AdminUserGlobalSignOut where
type Rs AdminUserGlobalSignOut =
AdminUserGlobalSignOutResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
AdminUserGlobalSignOutResponse' <$>
(pure (fromEnum s)))
instance Hashable AdminUserGlobalSignOut
instance NFData AdminUserGlobalSignOut
instance ToHeaders AdminUserGlobalSignOut where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.AdminUserGlobalSignOut"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AdminUserGlobalSignOut where
toJSON AdminUserGlobalSignOut'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _augsoUserPoolId),
Just ("Username" .= _augsoUsername)])
instance ToPath AdminUserGlobalSignOut where
toPath = const "/"
instance ToQuery AdminUserGlobalSignOut where
toQuery = const mempty
newtype AdminUserGlobalSignOutResponse = AdminUserGlobalSignOutResponse'
{ _augsorsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
adminUserGlobalSignOutResponse
:: Int
-> AdminUserGlobalSignOutResponse
adminUserGlobalSignOutResponse pResponseStatus_ =
AdminUserGlobalSignOutResponse'
{ _augsorsResponseStatus = pResponseStatus_
}
augsorsResponseStatus :: Lens' AdminUserGlobalSignOutResponse Int
augsorsResponseStatus = lens _augsorsResponseStatus (\ s a -> s{_augsorsResponseStatus = a});
instance NFData AdminUserGlobalSignOutResponse