{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
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
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]
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
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. 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'
{ $sel:roleName:DetachRolePolicy' :: Text
roleName = Text
pRoleName_,
$sel:policyArn:DetachRolePolicy' :: Text
policyArn = Text
pPolicyArn_
}
detachRolePolicy_roleName :: Lens.Lens' DetachRolePolicy Prelude.Text
detachRolePolicy_roleName :: Lens' DetachRolePolicy Text
detachRolePolicy_roleName = 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 :: Lens' DetachRolePolicy Text
detachRolePolicy_policyArn = 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 :: (Service -> Service)
-> DetachRolePolicy -> Request DetachRolePolicy
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DetachRolePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetachRolePolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DetachRolePolicyResponse
DetachRolePolicyResponse'
instance Prelude.Hashable DetachRolePolicy where
hashWithSalt :: Int -> DetachRolePolicy -> Int
hashWithSalt Int
_salt DetachRolePolicy' {Text
policyArn :: Text
roleName :: Text
$sel:policyArn:DetachRolePolicy' :: DetachRolePolicy -> Text
$sel:roleName:DetachRolePolicy' :: DetachRolePolicy -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyArn
instance Prelude.NFData DetachRolePolicy where
rnf :: DetachRolePolicy -> ()
rnf DetachRolePolicy' {Text
policyArn :: Text
roleName :: Text
$sel:policyArn:DetachRolePolicy' :: DetachRolePolicy -> Text
$sel:roleName:DetachRolePolicy' :: DetachRolePolicy -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
roleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyArn
instance Data.ToHeaders DetachRolePolicy where
toHeaders :: DetachRolePolicy -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DetachRolePolicy where
toPath :: DetachRolePolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DetachRolePolicy where
toQuery :: DetachRolePolicy -> QueryString
toQuery DetachRolePolicy' {Text
policyArn :: Text
roleName :: Text
$sel:policyArn:DetachRolePolicy' :: DetachRolePolicy -> Text
$sel:roleName:DetachRolePolicy' :: DetachRolePolicy -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DetachRolePolicy" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"RoleName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
roleName,
ByteString
"PolicyArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyArn
]
data DetachRolePolicyResponse = DetachRolePolicyResponse'
{
}
deriving (DetachRolePolicyResponse -> DetachRolePolicyResponse -> Bool
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]
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
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.
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 where
rnf :: DetachRolePolicyResponse -> ()
rnf DetachRolePolicyResponse
_ = ()