{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
module Aws.Iam.Commands.CreateGroup
( CreateGroup(..)
, CreateGroupResponse(..)
, Group(..)
) where
import Aws.Core
import Aws.Iam.Core
import Aws.Iam.Internal
import Control.Applicative
import Data.Text (Text)
import Data.Typeable
import Prelude
data CreateGroup
= CreateGroup {
cgGroupName :: Text
, cgPath :: Maybe Text
}
deriving (Eq, Ord, Show, Typeable)
instance SignQuery CreateGroup where
type ServiceConfiguration CreateGroup = IamConfiguration
signQuery CreateGroup{..}
= iamAction' "CreateGroup" [
Just ("GroupName", cgGroupName)
, ("Path",) <$> cgPath
]
data CreateGroupResponse = CreateGroupResponse Group
deriving (Eq, Ord, Show, Typeable)
instance ResponseConsumer CreateGroup CreateGroupResponse where
type ResponseMetadata CreateGroupResponse = IamMetadata
responseConsumer _ _
= iamResponseConsumer $
fmap CreateGroupResponse . parseGroup
instance Transaction CreateGroup CreateGroupResponse
instance AsMemoryResponse CreateGroupResponse where
type MemoryResponse CreateGroupResponse = CreateGroupResponse
loadToMemory = return