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