{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
module Aws.Iam.Commands.CreateUser
( CreateUser(..)
, CreateUserResponse(..)
, User(..)
) 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 CreateUser
= CreateUser {
cuUserName :: Text
, cuPath :: Maybe Text
}
deriving (Eq, Ord, Show, Typeable)
instance SignQuery CreateUser where
type ServiceConfiguration CreateUser = IamConfiguration
signQuery CreateUser{..}
= iamAction' "CreateUser" [
Just ("UserName", cuUserName)
, ("Path",) <$> cuPath
]
data CreateUserResponse = CreateUserResponse User
deriving (Eq, Ord, Show, Typeable)
instance ResponseConsumer CreateUser CreateUserResponse where
type ResponseMetadata CreateUserResponse = IamMetadata
responseConsumer _ _
= iamResponseConsumer $
fmap CreateUserResponse . parseUser
instance Transaction CreateUser CreateUserResponse
instance AsMemoryResponse CreateUserResponse where
type MemoryResponse CreateUserResponse = CreateUserResponse
loadToMemory = return