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