{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE TypeFamilies          #-}
module Aws.Iam.Commands.AddUserToGroup
    ( AddUserToGroup(..)
    , AddUserToGroupResponse(..)
    ) where

import           Aws.Core
import           Aws.Iam.Core
import           Aws.Iam.Internal
import           Data.Text        (Text)
import           Data.Typeable

-- | Adds the specified user to the specified group.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_AddUserToGroup.html>
data AddUserToGroup
    = AddUserToGroup {
        AddUserToGroup -> Text
autgGroupName :: Text
      -- ^ Name of the group to update.
      , AddUserToGroup -> Text
autgUserName  :: Text
      -- ^ The of the user to add.
      }
    deriving (AddUserToGroup -> AddUserToGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddUserToGroup -> AddUserToGroup -> Bool
$c/= :: AddUserToGroup -> AddUserToGroup -> Bool
== :: AddUserToGroup -> AddUserToGroup -> Bool
$c== :: AddUserToGroup -> AddUserToGroup -> Bool
Eq, Eq AddUserToGroup
AddUserToGroup -> AddUserToGroup -> Bool
AddUserToGroup -> AddUserToGroup -> Ordering
AddUserToGroup -> AddUserToGroup -> AddUserToGroup
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
$cmin :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
max :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
$cmax :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
>= :: AddUserToGroup -> AddUserToGroup -> Bool
$c>= :: AddUserToGroup -> AddUserToGroup -> Bool
> :: AddUserToGroup -> AddUserToGroup -> Bool
$c> :: AddUserToGroup -> AddUserToGroup -> Bool
<= :: AddUserToGroup -> AddUserToGroup -> Bool
$c<= :: AddUserToGroup -> AddUserToGroup -> Bool
< :: AddUserToGroup -> AddUserToGroup -> Bool
$c< :: AddUserToGroup -> AddUserToGroup -> Bool
compare :: AddUserToGroup -> AddUserToGroup -> Ordering
$ccompare :: AddUserToGroup -> AddUserToGroup -> Ordering
Ord, Int -> AddUserToGroup -> ShowS
[AddUserToGroup] -> ShowS
AddUserToGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddUserToGroup] -> ShowS
$cshowList :: [AddUserToGroup] -> ShowS
show :: AddUserToGroup -> String
$cshow :: AddUserToGroup -> String
showsPrec :: Int -> AddUserToGroup -> ShowS
$cshowsPrec :: Int -> AddUserToGroup -> ShowS
Show, Typeable)

instance SignQuery AddUserToGroup where
    type ServiceConfiguration AddUserToGroup = IamConfiguration
    signQuery :: forall queryType.
AddUserToGroup
-> ServiceConfiguration AddUserToGroup queryType
-> SignatureData
-> SignedQuery
signQuery AddUserToGroup{Text
autgUserName :: Text
autgGroupName :: Text
autgUserName :: AddUserToGroup -> Text
autgGroupName :: AddUserToGroup -> Text
..}
        = forall qt.
ByteString
-> [(ByteString, Text)]
-> IamConfiguration qt
-> SignatureData
-> SignedQuery
iamAction ByteString
"AddUserToGroup" [
              (ByteString
"GroupName"     , Text
autgGroupName)
            , (ByteString
"UserName"      , Text
autgUserName)
            ]

data AddUserToGroupResponse = AddUserToGroupResponse
    deriving (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c/= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
== :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c== :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
Eq, Eq AddUserToGroupResponse
AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering
AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
$cmin :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
max :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
$cmax :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
>= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c>= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
> :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c> :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
<= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c<= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
< :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c< :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
compare :: AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering
$ccompare :: AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering
Ord, Int -> AddUserToGroupResponse -> ShowS
[AddUserToGroupResponse] -> ShowS
AddUserToGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddUserToGroupResponse] -> ShowS
$cshowList :: [AddUserToGroupResponse] -> ShowS
show :: AddUserToGroupResponse -> String
$cshow :: AddUserToGroupResponse -> String
showsPrec :: Int -> AddUserToGroupResponse -> ShowS
$cshowsPrec :: Int -> AddUserToGroupResponse -> ShowS
Show, Typeable)

instance ResponseConsumer AddUserToGroup AddUserToGroupResponse where
    type ResponseMetadata AddUserToGroupResponse = IamMetadata
    responseConsumer :: Request
-> AddUserToGroup
-> IORef (ResponseMetadata AddUserToGroupResponse)
-> HTTPResponseConsumer AddUserToGroupResponse
responseConsumer Request
_ AddUserToGroup
_
        = forall a.
(Cursor -> Response IamMetadata a)
-> IORef IamMetadata -> HTTPResponseConsumer a
iamResponseConsumer (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. Monad m => a -> m a
return AddUserToGroupResponse
AddUserToGroupResponse)

instance Transaction AddUserToGroup AddUserToGroupResponse

instance AsMemoryResponse AddUserToGroupResponse where
    type MemoryResponse AddUserToGroupResponse = AddUserToGroupResponse
    loadToMemory :: AddUserToGroupResponse
-> ResourceT IO (MemoryResponse AddUserToGroupResponse)
loadToMemory = forall (m :: * -> *) a. Monad m => a -> m a
return