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