module Network.AWS.IAM.CreateGroup
(
createGroup
, CreateGroup
, cgPath
, cgGroupName
, createGroupResponse
, CreateGroupResponse
, cgrsResponseStatus
, cgrsGroup
) 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 CreateGroup = CreateGroup'
{ _cgPath :: !(Maybe Text)
, _cgGroupName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createGroup
:: Text
-> CreateGroup
createGroup pGroupName_ =
CreateGroup'
{ _cgPath = Nothing
, _cgGroupName = pGroupName_
}
cgPath :: Lens' CreateGroup (Maybe Text)
cgPath = lens _cgPath (\ s a -> s{_cgPath = a});
cgGroupName :: Lens' CreateGroup Text
cgGroupName = lens _cgGroupName (\ s a -> s{_cgGroupName = a});
instance AWSRequest CreateGroup where
type Rs CreateGroup = CreateGroupResponse
request = postQuery iam
response
= receiveXMLWrapper "CreateGroupResult"
(\ s h x ->
CreateGroupResponse' <$>
(pure (fromEnum s)) <*> (x .@ "Group"))
instance Hashable CreateGroup
instance NFData CreateGroup
instance ToHeaders CreateGroup where
toHeaders = const mempty
instance ToPath CreateGroup where
toPath = const "/"
instance ToQuery CreateGroup where
toQuery CreateGroup'{..}
= mconcat
["Action" =: ("CreateGroup" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"Path" =: _cgPath, "GroupName" =: _cgGroupName]
data CreateGroupResponse = CreateGroupResponse'
{ _cgrsResponseStatus :: !Int
, _cgrsGroup :: !Group
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createGroupResponse
:: Int
-> Group
-> CreateGroupResponse
createGroupResponse pResponseStatus_ pGroup_ =
CreateGroupResponse'
{ _cgrsResponseStatus = pResponseStatus_
, _cgrsGroup = pGroup_
}
cgrsResponseStatus :: Lens' CreateGroupResponse Int
cgrsResponseStatus = lens _cgrsResponseStatus (\ s a -> s{_cgrsResponseStatus = a});
cgrsGroup :: Lens' CreateGroupResponse Group
cgrsGroup = lens _cgrsGroup (\ s a -> s{_cgrsGroup = a});
instance NFData CreateGroupResponse