{-# 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
(AddUserToGroup -> AddUserToGroup -> Bool)
-> (AddUserToGroup -> AddUserToGroup -> Bool) -> Eq AddUserToGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddUserToGroup -> AddUserToGroup -> Bool
== :: AddUserToGroup -> AddUserToGroup -> Bool
$c/= :: AddUserToGroup -> AddUserToGroup -> Bool
/= :: AddUserToGroup -> AddUserToGroup -> Bool
Eq, Eq AddUserToGroup
Eq AddUserToGroup =>
(AddUserToGroup -> AddUserToGroup -> Ordering)
-> (AddUserToGroup -> AddUserToGroup -> Bool)
-> (AddUserToGroup -> AddUserToGroup -> Bool)
-> (AddUserToGroup -> AddUserToGroup -> Bool)
-> (AddUserToGroup -> AddUserToGroup -> Bool)
-> (AddUserToGroup -> AddUserToGroup -> AddUserToGroup)
-> (AddUserToGroup -> AddUserToGroup -> AddUserToGroup)
-> Ord 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
$ccompare :: AddUserToGroup -> AddUserToGroup -> Ordering
compare :: AddUserToGroup -> AddUserToGroup -> Ordering
$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
>= :: AddUserToGroup -> AddUserToGroup -> Bool
$cmax :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
max :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
$cmin :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
min :: AddUserToGroup -> AddUserToGroup -> AddUserToGroup
Ord, Int -> AddUserToGroup -> ShowS
[AddUserToGroup] -> ShowS
AddUserToGroup -> String
(Int -> AddUserToGroup -> ShowS)
-> (AddUserToGroup -> String)
-> ([AddUserToGroup] -> ShowS)
-> Show AddUserToGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddUserToGroup -> ShowS
showsPrec :: Int -> AddUserToGroup -> ShowS
$cshow :: AddUserToGroup -> String
show :: AddUserToGroup -> String
$cshowList :: [AddUserToGroup] -> ShowS
showList :: [AddUserToGroup] -> ShowS
Show, Typeable)

instance SignQuery AddUserToGroup where
    type ServiceConfiguration AddUserToGroup = IamConfiguration
    signQuery :: forall queryType.
AddUserToGroup
-> ServiceConfiguration AddUserToGroup queryType
-> SignatureData
-> SignedQuery
signQuery AddUserToGroup{Text
autgGroupName :: AddUserToGroup -> Text
autgUserName :: AddUserToGroup -> Text
autgGroupName :: Text
autgUserName :: Text
..}
        = ByteString
-> [(ByteString, Text)]
-> IamConfiguration queryType
-> SignatureData
-> SignedQuery
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
(AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> Eq AddUserToGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
== :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$c/= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
/= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
Eq, Eq AddUserToGroupResponse
Eq AddUserToGroupResponse =>
(AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering)
-> (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> (AddUserToGroupResponse -> AddUserToGroupResponse -> Bool)
-> (AddUserToGroupResponse
    -> AddUserToGroupResponse -> AddUserToGroupResponse)
-> (AddUserToGroupResponse
    -> AddUserToGroupResponse -> AddUserToGroupResponse)
-> Ord 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
$ccompare :: AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering
compare :: AddUserToGroupResponse -> AddUserToGroupResponse -> Ordering
$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
>= :: AddUserToGroupResponse -> AddUserToGroupResponse -> Bool
$cmax :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
max :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
$cmin :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
min :: AddUserToGroupResponse
-> AddUserToGroupResponse -> AddUserToGroupResponse
Ord, Int -> AddUserToGroupResponse -> ShowS
[AddUserToGroupResponse] -> ShowS
AddUserToGroupResponse -> String
(Int -> AddUserToGroupResponse -> ShowS)
-> (AddUserToGroupResponse -> String)
-> ([AddUserToGroupResponse] -> ShowS)
-> Show AddUserToGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddUserToGroupResponse -> ShowS
showsPrec :: Int -> AddUserToGroupResponse -> ShowS
$cshow :: AddUserToGroupResponse -> String
show :: AddUserToGroupResponse -> String
$cshowList :: [AddUserToGroupResponse] -> ShowS
showList :: [AddUserToGroupResponse] -> ShowS
Show, Typeable)

instance ResponseConsumer AddUserToGroup AddUserToGroupResponse where
    type ResponseMetadata AddUserToGroupResponse = IamMetadata
    responseConsumer :: Request
-> AddUserToGroup
-> IORef (ResponseMetadata AddUserToGroupResponse)
-> HTTPResponseConsumer AddUserToGroupResponse
responseConsumer Request
_ AddUserToGroup
_
        = (Cursor -> Response IamMetadata AddUserToGroupResponse)
-> IORef IamMetadata -> HTTPResponseConsumer AddUserToGroupResponse
forall a.
(Cursor -> Response IamMetadata a)
-> IORef IamMetadata -> HTTPResponseConsumer a
iamResponseConsumer (Response IamMetadata AddUserToGroupResponse
-> Cursor -> Response IamMetadata AddUserToGroupResponse
forall a b. a -> b -> a
const (Response IamMetadata AddUserToGroupResponse
 -> Cursor -> Response IamMetadata AddUserToGroupResponse)
-> Response IamMetadata AddUserToGroupResponse
-> Cursor
-> Response IamMetadata AddUserToGroupResponse
forall a b. (a -> b) -> a -> b
$ AddUserToGroupResponse
-> Response IamMetadata AddUserToGroupResponse
forall a. a -> Response IamMetadata a
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 = AddUserToGroupResponse
-> ResourceT IO (MemoryResponse AddUserToGroupResponse)
AddUserToGroupResponse -> ResourceT IO AddUserToGroupResponse
forall a. a -> ResourceT IO a
forall (m :: * -> *) a. Monad m => a -> m a
return