{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IAM.DeleteUserPolicy
(
DeleteUserPolicy (..),
newDeleteUserPolicy,
deleteUserPolicy_userName,
deleteUserPolicy_policyName,
DeleteUserPolicyResponse (..),
newDeleteUserPolicyResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteUserPolicy = DeleteUserPolicy'
{
DeleteUserPolicy -> Text
userName :: Prelude.Text,
DeleteUserPolicy -> Text
policyName :: Prelude.Text
}
deriving (DeleteUserPolicy -> DeleteUserPolicy -> Bool
(DeleteUserPolicy -> DeleteUserPolicy -> Bool)
-> (DeleteUserPolicy -> DeleteUserPolicy -> Bool)
-> Eq DeleteUserPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c/= :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
== :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
$c== :: DeleteUserPolicy -> DeleteUserPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteUserPolicy]
ReadPrec DeleteUserPolicy
Int -> ReadS DeleteUserPolicy
ReadS [DeleteUserPolicy]
(Int -> ReadS DeleteUserPolicy)
-> ReadS [DeleteUserPolicy]
-> ReadPrec DeleteUserPolicy
-> ReadPrec [DeleteUserPolicy]
-> Read DeleteUserPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserPolicy]
$creadListPrec :: ReadPrec [DeleteUserPolicy]
readPrec :: ReadPrec DeleteUserPolicy
$creadPrec :: ReadPrec DeleteUserPolicy
readList :: ReadS [DeleteUserPolicy]
$creadList :: ReadS [DeleteUserPolicy]
readsPrec :: Int -> ReadS DeleteUserPolicy
$creadsPrec :: Int -> ReadS DeleteUserPolicy
Prelude.Read, Int -> DeleteUserPolicy -> ShowS
[DeleteUserPolicy] -> ShowS
DeleteUserPolicy -> String
(Int -> DeleteUserPolicy -> ShowS)
-> (DeleteUserPolicy -> String)
-> ([DeleteUserPolicy] -> ShowS)
-> Show DeleteUserPolicy
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
Prelude.Show, (forall x. DeleteUserPolicy -> Rep DeleteUserPolicy x)
-> (forall x. Rep DeleteUserPolicy x -> DeleteUserPolicy)
-> Generic DeleteUserPolicy
forall x. Rep DeleteUserPolicy x -> DeleteUserPolicy
forall x. DeleteUserPolicy -> Rep DeleteUserPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUserPolicy x -> DeleteUserPolicy
$cfrom :: forall x. DeleteUserPolicy -> Rep DeleteUserPolicy x
Prelude.Generic)
newDeleteUserPolicy ::
Prelude.Text ->
Prelude.Text ->
DeleteUserPolicy
newDeleteUserPolicy :: Text -> Text -> DeleteUserPolicy
newDeleteUserPolicy Text
pUserName_ Text
pPolicyName_ =
DeleteUserPolicy' :: Text -> Text -> DeleteUserPolicy
DeleteUserPolicy'
{ $sel:userName:DeleteUserPolicy' :: Text
userName = Text
pUserName_,
$sel:policyName:DeleteUserPolicy' :: Text
policyName = Text
pPolicyName_
}
deleteUserPolicy_userName :: Lens.Lens' DeleteUserPolicy Prelude.Text
deleteUserPolicy_userName :: (Text -> f Text) -> DeleteUserPolicy -> f DeleteUserPolicy
deleteUserPolicy_userName = (DeleteUserPolicy -> Text)
-> (DeleteUserPolicy -> Text -> DeleteUserPolicy)
-> Lens DeleteUserPolicy DeleteUserPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserPolicy' {Text
userName :: Text
$sel:userName:DeleteUserPolicy' :: DeleteUserPolicy -> Text
userName} -> Text
userName) (\s :: DeleteUserPolicy
s@DeleteUserPolicy' {} Text
a -> DeleteUserPolicy
s {$sel:userName:DeleteUserPolicy' :: Text
userName = Text
a} :: DeleteUserPolicy)
deleteUserPolicy_policyName :: Lens.Lens' DeleteUserPolicy Prelude.Text
deleteUserPolicy_policyName :: (Text -> f Text) -> DeleteUserPolicy -> f DeleteUserPolicy
deleteUserPolicy_policyName = (DeleteUserPolicy -> Text)
-> (DeleteUserPolicy -> Text -> DeleteUserPolicy)
-> Lens DeleteUserPolicy DeleteUserPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserPolicy' {Text
policyName :: Text
$sel:policyName:DeleteUserPolicy' :: DeleteUserPolicy -> Text
policyName} -> Text
policyName) (\s :: DeleteUserPolicy
s@DeleteUserPolicy' {} Text
a -> DeleteUserPolicy
s {$sel:policyName:DeleteUserPolicy' :: Text
policyName = Text
a} :: DeleteUserPolicy)
instance Core.AWSRequest DeleteUserPolicy where
type
AWSResponse DeleteUserPolicy =
DeleteUserPolicyResponse
request :: DeleteUserPolicy -> Request DeleteUserPolicy
request = Service -> DeleteUserPolicy -> Request DeleteUserPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUserPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUserPolicy)))
response =
AWSResponse DeleteUserPolicy
-> Logger
-> Service
-> Proxy DeleteUserPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUserPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteUserPolicy
DeleteUserPolicyResponse
DeleteUserPolicyResponse'
instance Prelude.Hashable DeleteUserPolicy
instance Prelude.NFData DeleteUserPolicy
instance Core.ToHeaders DeleteUserPolicy where
toHeaders :: DeleteUserPolicy -> [Header]
toHeaders = [Header] -> DeleteUserPolicy -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteUserPolicy where
toPath :: DeleteUserPolicy -> ByteString
toPath = ByteString -> DeleteUserPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteUserPolicy where
toQuery :: DeleteUserPolicy -> QueryString
toQuery DeleteUserPolicy' {Text
policyName :: Text
userName :: Text
$sel:policyName:DeleteUserPolicy' :: DeleteUserPolicy -> Text
$sel:userName:DeleteUserPolicy' :: DeleteUserPolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteUserPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data DeleteUserPolicyResponse = DeleteUserPolicyResponse'
{
}
deriving (DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool
(DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool)
-> (DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool)
-> Eq DeleteUserPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool
$c/= :: DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool
== :: DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool
$c== :: DeleteUserPolicyResponse -> DeleteUserPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteUserPolicyResponse]
ReadPrec DeleteUserPolicyResponse
Int -> ReadS DeleteUserPolicyResponse
ReadS [DeleteUserPolicyResponse]
(Int -> ReadS DeleteUserPolicyResponse)
-> ReadS [DeleteUserPolicyResponse]
-> ReadPrec DeleteUserPolicyResponse
-> ReadPrec [DeleteUserPolicyResponse]
-> Read DeleteUserPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserPolicyResponse]
$creadListPrec :: ReadPrec [DeleteUserPolicyResponse]
readPrec :: ReadPrec DeleteUserPolicyResponse
$creadPrec :: ReadPrec DeleteUserPolicyResponse
readList :: ReadS [DeleteUserPolicyResponse]
$creadList :: ReadS [DeleteUserPolicyResponse]
readsPrec :: Int -> ReadS DeleteUserPolicyResponse
$creadsPrec :: Int -> ReadS DeleteUserPolicyResponse
Prelude.Read, Int -> DeleteUserPolicyResponse -> ShowS
[DeleteUserPolicyResponse] -> ShowS
DeleteUserPolicyResponse -> String
(Int -> DeleteUserPolicyResponse -> ShowS)
-> (DeleteUserPolicyResponse -> String)
-> ([DeleteUserPolicyResponse] -> ShowS)
-> Show DeleteUserPolicyResponse
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
Prelude.Show, (forall x.
DeleteUserPolicyResponse -> Rep DeleteUserPolicyResponse x)
-> (forall x.
Rep DeleteUserPolicyResponse x -> DeleteUserPolicyResponse)
-> Generic DeleteUserPolicyResponse
forall x.
Rep DeleteUserPolicyResponse x -> DeleteUserPolicyResponse
forall x.
DeleteUserPolicyResponse -> Rep DeleteUserPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteUserPolicyResponse x -> DeleteUserPolicyResponse
$cfrom :: forall x.
DeleteUserPolicyResponse -> Rep DeleteUserPolicyResponse x
Prelude.Generic)
newDeleteUserPolicyResponse ::
DeleteUserPolicyResponse
newDeleteUserPolicyResponse :: DeleteUserPolicyResponse
newDeleteUserPolicyResponse =
DeleteUserPolicyResponse
DeleteUserPolicyResponse'
instance Prelude.NFData DeleteUserPolicyResponse