{-# 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.DeleteRolePolicy
(
DeleteRolePolicy (..),
newDeleteRolePolicy,
deleteRolePolicy_roleName,
deleteRolePolicy_policyName,
DeleteRolePolicyResponse (..),
newDeleteRolePolicyResponse,
)
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 DeleteRolePolicy = DeleteRolePolicy'
{
DeleteRolePolicy -> Text
roleName :: Prelude.Text,
DeleteRolePolicy -> Text
policyName :: Prelude.Text
}
deriving (DeleteRolePolicy -> DeleteRolePolicy -> Bool
(DeleteRolePolicy -> DeleteRolePolicy -> Bool)
-> (DeleteRolePolicy -> DeleteRolePolicy -> Bool)
-> Eq DeleteRolePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRolePolicy -> DeleteRolePolicy -> Bool
$c/= :: DeleteRolePolicy -> DeleteRolePolicy -> Bool
== :: DeleteRolePolicy -> DeleteRolePolicy -> Bool
$c== :: DeleteRolePolicy -> DeleteRolePolicy -> Bool
Prelude.Eq, ReadPrec [DeleteRolePolicy]
ReadPrec DeleteRolePolicy
Int -> ReadS DeleteRolePolicy
ReadS [DeleteRolePolicy]
(Int -> ReadS DeleteRolePolicy)
-> ReadS [DeleteRolePolicy]
-> ReadPrec DeleteRolePolicy
-> ReadPrec [DeleteRolePolicy]
-> Read DeleteRolePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRolePolicy]
$creadListPrec :: ReadPrec [DeleteRolePolicy]
readPrec :: ReadPrec DeleteRolePolicy
$creadPrec :: ReadPrec DeleteRolePolicy
readList :: ReadS [DeleteRolePolicy]
$creadList :: ReadS [DeleteRolePolicy]
readsPrec :: Int -> ReadS DeleteRolePolicy
$creadsPrec :: Int -> ReadS DeleteRolePolicy
Prelude.Read, Int -> DeleteRolePolicy -> ShowS
[DeleteRolePolicy] -> ShowS
DeleteRolePolicy -> String
(Int -> DeleteRolePolicy -> ShowS)
-> (DeleteRolePolicy -> String)
-> ([DeleteRolePolicy] -> ShowS)
-> Show DeleteRolePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRolePolicy] -> ShowS
$cshowList :: [DeleteRolePolicy] -> ShowS
show :: DeleteRolePolicy -> String
$cshow :: DeleteRolePolicy -> String
showsPrec :: Int -> DeleteRolePolicy -> ShowS
$cshowsPrec :: Int -> DeleteRolePolicy -> ShowS
Prelude.Show, (forall x. DeleteRolePolicy -> Rep DeleteRolePolicy x)
-> (forall x. Rep DeleteRolePolicy x -> DeleteRolePolicy)
-> Generic DeleteRolePolicy
forall x. Rep DeleteRolePolicy x -> DeleteRolePolicy
forall x. DeleteRolePolicy -> Rep DeleteRolePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRolePolicy x -> DeleteRolePolicy
$cfrom :: forall x. DeleteRolePolicy -> Rep DeleteRolePolicy x
Prelude.Generic)
newDeleteRolePolicy ::
Prelude.Text ->
Prelude.Text ->
DeleteRolePolicy
newDeleteRolePolicy :: Text -> Text -> DeleteRolePolicy
newDeleteRolePolicy Text
pRoleName_ Text
pPolicyName_ =
DeleteRolePolicy' :: Text -> Text -> DeleteRolePolicy
DeleteRolePolicy'
{ $sel:roleName:DeleteRolePolicy' :: Text
roleName = Text
pRoleName_,
$sel:policyName:DeleteRolePolicy' :: Text
policyName = Text
pPolicyName_
}
deleteRolePolicy_roleName :: Lens.Lens' DeleteRolePolicy Prelude.Text
deleteRolePolicy_roleName :: (Text -> f Text) -> DeleteRolePolicy -> f DeleteRolePolicy
deleteRolePolicy_roleName = (DeleteRolePolicy -> Text)
-> (DeleteRolePolicy -> Text -> DeleteRolePolicy)
-> Lens DeleteRolePolicy DeleteRolePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRolePolicy' {Text
roleName :: Text
$sel:roleName:DeleteRolePolicy' :: DeleteRolePolicy -> Text
roleName} -> Text
roleName) (\s :: DeleteRolePolicy
s@DeleteRolePolicy' {} Text
a -> DeleteRolePolicy
s {$sel:roleName:DeleteRolePolicy' :: Text
roleName = Text
a} :: DeleteRolePolicy)
deleteRolePolicy_policyName :: Lens.Lens' DeleteRolePolicy Prelude.Text
deleteRolePolicy_policyName :: (Text -> f Text) -> DeleteRolePolicy -> f DeleteRolePolicy
deleteRolePolicy_policyName = (DeleteRolePolicy -> Text)
-> (DeleteRolePolicy -> Text -> DeleteRolePolicy)
-> Lens DeleteRolePolicy DeleteRolePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRolePolicy' {Text
policyName :: Text
$sel:policyName:DeleteRolePolicy' :: DeleteRolePolicy -> Text
policyName} -> Text
policyName) (\s :: DeleteRolePolicy
s@DeleteRolePolicy' {} Text
a -> DeleteRolePolicy
s {$sel:policyName:DeleteRolePolicy' :: Text
policyName = Text
a} :: DeleteRolePolicy)
instance Core.AWSRequest DeleteRolePolicy where
type
AWSResponse DeleteRolePolicy =
DeleteRolePolicyResponse
request :: DeleteRolePolicy -> Request DeleteRolePolicy
request = Service -> DeleteRolePolicy -> Request DeleteRolePolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteRolePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRolePolicy)))
response =
AWSResponse DeleteRolePolicy
-> Logger
-> Service
-> Proxy DeleteRolePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRolePolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteRolePolicy
DeleteRolePolicyResponse
DeleteRolePolicyResponse'
instance Prelude.Hashable DeleteRolePolicy
instance Prelude.NFData DeleteRolePolicy
instance Core.ToHeaders DeleteRolePolicy where
toHeaders :: DeleteRolePolicy -> [Header]
toHeaders = [Header] -> DeleteRolePolicy -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteRolePolicy where
toPath :: DeleteRolePolicy -> ByteString
toPath = ByteString -> DeleteRolePolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteRolePolicy where
toQuery :: DeleteRolePolicy -> QueryString
toQuery DeleteRolePolicy' {Text
policyName :: Text
roleName :: Text
$sel:policyName:DeleteRolePolicy' :: DeleteRolePolicy -> Text
$sel:roleName:DeleteRolePolicy' :: DeleteRolePolicy -> 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
"DeleteRolePolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"RoleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
roleName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data DeleteRolePolicyResponse = DeleteRolePolicyResponse'
{
}
deriving (DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool
(DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool)
-> (DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool)
-> Eq DeleteRolePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool
$c/= :: DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool
== :: DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool
$c== :: DeleteRolePolicyResponse -> DeleteRolePolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRolePolicyResponse]
ReadPrec DeleteRolePolicyResponse
Int -> ReadS DeleteRolePolicyResponse
ReadS [DeleteRolePolicyResponse]
(Int -> ReadS DeleteRolePolicyResponse)
-> ReadS [DeleteRolePolicyResponse]
-> ReadPrec DeleteRolePolicyResponse
-> ReadPrec [DeleteRolePolicyResponse]
-> Read DeleteRolePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRolePolicyResponse]
$creadListPrec :: ReadPrec [DeleteRolePolicyResponse]
readPrec :: ReadPrec DeleteRolePolicyResponse
$creadPrec :: ReadPrec DeleteRolePolicyResponse
readList :: ReadS [DeleteRolePolicyResponse]
$creadList :: ReadS [DeleteRolePolicyResponse]
readsPrec :: Int -> ReadS DeleteRolePolicyResponse
$creadsPrec :: Int -> ReadS DeleteRolePolicyResponse
Prelude.Read, Int -> DeleteRolePolicyResponse -> ShowS
[DeleteRolePolicyResponse] -> ShowS
DeleteRolePolicyResponse -> String
(Int -> DeleteRolePolicyResponse -> ShowS)
-> (DeleteRolePolicyResponse -> String)
-> ([DeleteRolePolicyResponse] -> ShowS)
-> Show DeleteRolePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRolePolicyResponse] -> ShowS
$cshowList :: [DeleteRolePolicyResponse] -> ShowS
show :: DeleteRolePolicyResponse -> String
$cshow :: DeleteRolePolicyResponse -> String
showsPrec :: Int -> DeleteRolePolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteRolePolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteRolePolicyResponse -> Rep DeleteRolePolicyResponse x)
-> (forall x.
Rep DeleteRolePolicyResponse x -> DeleteRolePolicyResponse)
-> Generic DeleteRolePolicyResponse
forall x.
Rep DeleteRolePolicyResponse x -> DeleteRolePolicyResponse
forall x.
DeleteRolePolicyResponse -> Rep DeleteRolePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRolePolicyResponse x -> DeleteRolePolicyResponse
$cfrom :: forall x.
DeleteRolePolicyResponse -> Rep DeleteRolePolicyResponse x
Prelude.Generic)
newDeleteRolePolicyResponse ::
DeleteRolePolicyResponse
newDeleteRolePolicyResponse :: DeleteRolePolicyResponse
newDeleteRolePolicyResponse =
DeleteRolePolicyResponse
DeleteRolePolicyResponse'
instance Prelude.NFData DeleteRolePolicyResponse