module Network.AWS.IAM.DetachUserPolicy
(
detachUserPolicy
, DetachUserPolicy
, dUserName
, dPolicyARN
, detachUserPolicyResponse
, DetachUserPolicyResponse
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DetachUserPolicy = DetachUserPolicy'
{ _dUserName :: !Text
, _dPolicyARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
detachUserPolicy
:: Text
-> Text
-> DetachUserPolicy
detachUserPolicy pUserName_ pPolicyARN_ =
DetachUserPolicy'
{ _dUserName = pUserName_
, _dPolicyARN = pPolicyARN_
}
dUserName :: Lens' DetachUserPolicy Text
dUserName = lens _dUserName (\ s a -> s{_dUserName = a});
dPolicyARN :: Lens' DetachUserPolicy Text
dPolicyARN = lens _dPolicyARN (\ s a -> s{_dPolicyARN = a});
instance AWSRequest DetachUserPolicy where
type Rs DetachUserPolicy = DetachUserPolicyResponse
request = postQuery iam
response = receiveNull DetachUserPolicyResponse'
instance Hashable DetachUserPolicy
instance NFData DetachUserPolicy
instance ToHeaders DetachUserPolicy where
toHeaders = const mempty
instance ToPath DetachUserPolicy where
toPath = const "/"
instance ToQuery DetachUserPolicy where
toQuery DetachUserPolicy'{..}
= mconcat
["Action" =: ("DetachUserPolicy" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"UserName" =: _dUserName, "PolicyArn" =: _dPolicyARN]
data DetachUserPolicyResponse =
DetachUserPolicyResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
detachUserPolicyResponse
:: DetachUserPolicyResponse
detachUserPolicyResponse = DetachUserPolicyResponse'
instance NFData DetachUserPolicyResponse