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