module Network.AWS.IAM.GetGroupPolicy
(
getGroupPolicy
, GetGroupPolicy
, ggpGroupName
, ggpPolicyName
, getGroupPolicyResponse
, GetGroupPolicyResponse
, ggprsResponseStatus
, ggprsGroupName
, ggprsPolicyName
, ggprsPolicyDocument
) 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 GetGroupPolicy = GetGroupPolicy'
{ _ggpGroupName :: !Text
, _ggpPolicyName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getGroupPolicy
:: Text
-> Text
-> GetGroupPolicy
getGroupPolicy pGroupName_ pPolicyName_ =
GetGroupPolicy'
{ _ggpGroupName = pGroupName_
, _ggpPolicyName = pPolicyName_
}
ggpGroupName :: Lens' GetGroupPolicy Text
ggpGroupName = lens _ggpGroupName (\ s a -> s{_ggpGroupName = a});
ggpPolicyName :: Lens' GetGroupPolicy Text
ggpPolicyName = lens _ggpPolicyName (\ s a -> s{_ggpPolicyName = a});
instance AWSRequest GetGroupPolicy where
type Rs GetGroupPolicy = GetGroupPolicyResponse
request = postQuery iam
response
= receiveXMLWrapper "GetGroupPolicyResult"
(\ s h x ->
GetGroupPolicyResponse' <$>
(pure (fromEnum s)) <*> (x .@ "GroupName") <*>
(x .@ "PolicyName")
<*> (x .@ "PolicyDocument"))
instance Hashable GetGroupPolicy
instance NFData GetGroupPolicy
instance ToHeaders GetGroupPolicy where
toHeaders = const mempty
instance ToPath GetGroupPolicy where
toPath = const "/"
instance ToQuery GetGroupPolicy where
toQuery GetGroupPolicy'{..}
= mconcat
["Action" =: ("GetGroupPolicy" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"GroupName" =: _ggpGroupName,
"PolicyName" =: _ggpPolicyName]
data GetGroupPolicyResponse = GetGroupPolicyResponse'
{ _ggprsResponseStatus :: !Int
, _ggprsGroupName :: !Text
, _ggprsPolicyName :: !Text
, _ggprsPolicyDocument :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getGroupPolicyResponse
:: Int
-> Text
-> Text
-> Text
-> GetGroupPolicyResponse
getGroupPolicyResponse pResponseStatus_ pGroupName_ pPolicyName_ pPolicyDocument_ =
GetGroupPolicyResponse'
{ _ggprsResponseStatus = pResponseStatus_
, _ggprsGroupName = pGroupName_
, _ggprsPolicyName = pPolicyName_
, _ggprsPolicyDocument = pPolicyDocument_
}
ggprsResponseStatus :: Lens' GetGroupPolicyResponse Int
ggprsResponseStatus = lens _ggprsResponseStatus (\ s a -> s{_ggprsResponseStatus = a});
ggprsGroupName :: Lens' GetGroupPolicyResponse Text
ggprsGroupName = lens _ggprsGroupName (\ s a -> s{_ggprsGroupName = a});
ggprsPolicyName :: Lens' GetGroupPolicyResponse Text
ggprsPolicyName = lens _ggprsPolicyName (\ s a -> s{_ggprsPolicyName = a});
ggprsPolicyDocument :: Lens' GetGroupPolicyResponse Text
ggprsPolicyDocument = lens _ggprsPolicyDocument (\ s a -> s{_ggprsPolicyDocument = a});
instance NFData GetGroupPolicyResponse