module Network.AWS.IAM.GetGroupPolicy
(
GetGroupPolicy
, getGroupPolicy
, ggpGroupName
, ggpPolicyName
, GetGroupPolicyResponse
, getGroupPolicyResponse
, ggprGroupName
, ggprPolicyDocument
, ggprPolicyName
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
data GetGroupPolicy = GetGroupPolicy
{ _ggpGroupName :: Text
, _ggpPolicyName :: Text
} deriving (Eq, Ord, Show)
getGroupPolicy :: Text
-> Text
-> GetGroupPolicy
getGroupPolicy p1 p2 = GetGroupPolicy
{ _ggpGroupName = p1
, _ggpPolicyName = p2
}
ggpGroupName :: Lens' GetGroupPolicy Text
ggpGroupName = lens _ggpGroupName (\s a -> s { _ggpGroupName = a })
ggpPolicyName :: Lens' GetGroupPolicy Text
ggpPolicyName = lens _ggpPolicyName (\s a -> s { _ggpPolicyName = a })
data GetGroupPolicyResponse = GetGroupPolicyResponse
{ _ggprGroupName :: Text
, _ggprPolicyDocument :: Text
, _ggprPolicyName :: Text
} deriving (Eq, Ord, Show)
getGroupPolicyResponse :: Text
-> Text
-> Text
-> GetGroupPolicyResponse
getGroupPolicyResponse p1 p2 p3 = GetGroupPolicyResponse
{ _ggprGroupName = p1
, _ggprPolicyName = p2
, _ggprPolicyDocument = p3
}
ggprGroupName :: Lens' GetGroupPolicyResponse Text
ggprGroupName = lens _ggprGroupName (\s a -> s { _ggprGroupName = a })
ggprPolicyDocument :: Lens' GetGroupPolicyResponse Text
ggprPolicyDocument =
lens _ggprPolicyDocument (\s a -> s { _ggprPolicyDocument = a })
ggprPolicyName :: Lens' GetGroupPolicyResponse Text
ggprPolicyName = lens _ggprPolicyName (\s a -> s { _ggprPolicyName = a })
instance ToPath GetGroupPolicy where
toPath = const "/"
instance ToQuery GetGroupPolicy where
toQuery GetGroupPolicy{..} = mconcat
[ "GroupName" =? _ggpGroupName
, "PolicyName" =? _ggpPolicyName
]
instance ToHeaders GetGroupPolicy
instance AWSRequest GetGroupPolicy where
type Sv GetGroupPolicy = IAM
type Rs GetGroupPolicy = GetGroupPolicyResponse
request = post "GetGroupPolicy"
response = xmlResponse
instance FromXML GetGroupPolicyResponse where
parseXML = withElement "GetGroupPolicyResult" $ \x -> GetGroupPolicyResponse
<$> x .@ "GroupName"
<*> x .@ "PolicyDocument"
<*> x .@ "PolicyName"