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

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

-- | Deletes the specified policy associated with the specified user.
--
-- <http://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteUserPolicy.html>
data DeleteUserPolicy
    = DeleteUserPolicy {
        DeleteUserPolicy -> Text
dupPolicyName :: Text
      -- ^ Name of the policy to be deleted.
      , DeleteUserPolicy -> Text
dupUserName   :: Text
      -- ^ Name of the user with whom the policy is associated.
      }
    deriving (DeleteUserPolicy -> DeleteUserPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c/= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
== :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c== :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
Eq, Eq DeleteUserPolicy
DeleteUserPolicy -> DeleteUserPolicy -> Bool
DeleteUserPolicy -> DeleteUserPolicy -> Ordering
DeleteUserPolicy -> DeleteUserPolicy -> DeleteUserPolicy
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 :: DeleteUserPolicy -> DeleteUserPolicy -> DeleteUserPolicy
$cmin :: DeleteUserPolicy -> DeleteUserPolicy -> DeleteUserPolicy
max :: DeleteUserPolicy -> DeleteUserPolicy -> DeleteUserPolicy
$cmax :: DeleteUserPolicy -> DeleteUserPolicy -> DeleteUserPolicy
>= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c>= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
> :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c> :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
<= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c<= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
< :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c< :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
compare :: DeleteUserPolicy -> DeleteUserPolicy -> Ordering
$ccompare :: DeleteUserPolicy -> DeleteUserPolicy -> Ordering
Ord, Int -> DeleteUserPolicy -> ShowS
[DeleteUserPolicy] -> ShowS
DeleteUserPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUserPolicy] -> ShowS
$cshowList :: [DeleteUserPolicy] -> ShowS
show :: DeleteUserPolicy -> String
$cshow :: DeleteUserPolicy -> String
showsPrec :: Int -> DeleteUserPolicy -> ShowS
$cshowsPrec :: Int -> DeleteUserPolicy -> ShowS
Show, Typeable)

instance SignQuery DeleteUserPolicy where
    type ServiceConfiguration DeleteUserPolicy = IamConfiguration
    signQuery :: forall queryType.
DeleteUserPolicy
-> ServiceConfiguration DeleteUserPolicy queryType
-> SignatureData
-> SignedQuery
signQuery DeleteUserPolicy{Text
dupUserName :: Text
dupPolicyName :: Text
dupUserName :: DeleteUserPolicy -> Text
dupPolicyName :: DeleteUserPolicy -> Text
..}
        = forall qt.
ByteString
-> [(ByteString, Text)]
-> IamConfiguration qt
-> SignatureData
-> SignedQuery
iamAction ByteString
"DeleteUserPolicy" [
              (ByteString
"PolicyName", Text
dupPolicyName)
            , (ByteString
"UserName", Text
dupUserName)
            ]

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

instance ResponseConsumer DeleteUserPolicy DeleteUserPolicyResponse where
    type ResponseMetadata DeleteUserPolicyResponse = IamMetadata
    responseConsumer :: Request
-> DeleteUserPolicy
-> IORef (ResponseMetadata DeleteUserPolicyResponse)
-> HTTPResponseConsumer DeleteUserPolicyResponse
responseConsumer Request
_ DeleteUserPolicy
_ =
        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 DeleteUserPolicyResponse
DeleteUserPolicyResponse)

instance Transaction DeleteUserPolicy DeleteUserPolicyResponse

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