{-# 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.PutRolePolicy
(
PutRolePolicy (..),
newPutRolePolicy,
putRolePolicy_roleName,
putRolePolicy_policyName,
putRolePolicy_policyDocument,
PutRolePolicyResponse (..),
newPutRolePolicyResponse,
)
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 PutRolePolicy = PutRolePolicy'
{
PutRolePolicy -> Text
roleName :: Prelude.Text,
PutRolePolicy -> Text
policyName :: Prelude.Text,
PutRolePolicy -> Text
policyDocument :: Prelude.Text
}
deriving (PutRolePolicy -> PutRolePolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRolePolicy -> PutRolePolicy -> Bool
$c/= :: PutRolePolicy -> PutRolePolicy -> Bool
== :: PutRolePolicy -> PutRolePolicy -> Bool
$c== :: PutRolePolicy -> PutRolePolicy -> Bool
Prelude.Eq, ReadPrec [PutRolePolicy]
ReadPrec PutRolePolicy
Int -> ReadS PutRolePolicy
ReadS [PutRolePolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRolePolicy]
$creadListPrec :: ReadPrec [PutRolePolicy]
readPrec :: ReadPrec PutRolePolicy
$creadPrec :: ReadPrec PutRolePolicy
readList :: ReadS [PutRolePolicy]
$creadList :: ReadS [PutRolePolicy]
readsPrec :: Int -> ReadS PutRolePolicy
$creadsPrec :: Int -> ReadS PutRolePolicy
Prelude.Read, Int -> PutRolePolicy -> ShowS
[PutRolePolicy] -> ShowS
PutRolePolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRolePolicy] -> ShowS
$cshowList :: [PutRolePolicy] -> ShowS
show :: PutRolePolicy -> String
$cshow :: PutRolePolicy -> String
showsPrec :: Int -> PutRolePolicy -> ShowS
$cshowsPrec :: Int -> PutRolePolicy -> ShowS
Prelude.Show, forall x. Rep PutRolePolicy x -> PutRolePolicy
forall x. PutRolePolicy -> Rep PutRolePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRolePolicy x -> PutRolePolicy
$cfrom :: forall x. PutRolePolicy -> Rep PutRolePolicy x
Prelude.Generic)
newPutRolePolicy ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PutRolePolicy
newPutRolePolicy :: Text -> Text -> Text -> PutRolePolicy
newPutRolePolicy
Text
pRoleName_
Text
pPolicyName_
Text
pPolicyDocument_ =
PutRolePolicy'
{ $sel:roleName:PutRolePolicy' :: Text
roleName = Text
pRoleName_,
$sel:policyName:PutRolePolicy' :: Text
policyName = Text
pPolicyName_,
$sel:policyDocument:PutRolePolicy' :: Text
policyDocument = Text
pPolicyDocument_
}
putRolePolicy_roleName :: Lens.Lens' PutRolePolicy Prelude.Text
putRolePolicy_roleName :: Lens' PutRolePolicy Text
putRolePolicy_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRolePolicy' {Text
roleName :: Text
$sel:roleName:PutRolePolicy' :: PutRolePolicy -> Text
roleName} -> Text
roleName) (\s :: PutRolePolicy
s@PutRolePolicy' {} Text
a -> PutRolePolicy
s {$sel:roleName:PutRolePolicy' :: Text
roleName = Text
a} :: PutRolePolicy)
putRolePolicy_policyName :: Lens.Lens' PutRolePolicy Prelude.Text
putRolePolicy_policyName :: Lens' PutRolePolicy Text
putRolePolicy_policyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRolePolicy' {Text
policyName :: Text
$sel:policyName:PutRolePolicy' :: PutRolePolicy -> Text
policyName} -> Text
policyName) (\s :: PutRolePolicy
s@PutRolePolicy' {} Text
a -> PutRolePolicy
s {$sel:policyName:PutRolePolicy' :: Text
policyName = Text
a} :: PutRolePolicy)
putRolePolicy_policyDocument :: Lens.Lens' PutRolePolicy Prelude.Text
putRolePolicy_policyDocument :: Lens' PutRolePolicy Text
putRolePolicy_policyDocument = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRolePolicy' {Text
policyDocument :: Text
$sel:policyDocument:PutRolePolicy' :: PutRolePolicy -> Text
policyDocument} -> Text
policyDocument) (\s :: PutRolePolicy
s@PutRolePolicy' {} Text
a -> PutRolePolicy
s {$sel:policyDocument:PutRolePolicy' :: Text
policyDocument = Text
a} :: PutRolePolicy)
instance Core.AWSRequest PutRolePolicy where
type
AWSResponse PutRolePolicy =
PutRolePolicyResponse
request :: (Service -> Service) -> PutRolePolicy -> Request PutRolePolicy
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 PutRolePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutRolePolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutRolePolicyResponse
PutRolePolicyResponse'
instance Prelude.Hashable PutRolePolicy where
hashWithSalt :: Int -> PutRolePolicy -> Int
hashWithSalt Int
_salt PutRolePolicy' {Text
policyDocument :: Text
policyName :: Text
roleName :: Text
$sel:policyDocument:PutRolePolicy' :: PutRolePolicy -> Text
$sel:policyName:PutRolePolicy' :: PutRolePolicy -> Text
$sel:roleName:PutRolePolicy' :: PutRolePolicy -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyDocument
instance Prelude.NFData PutRolePolicy where
rnf :: PutRolePolicy -> ()
rnf PutRolePolicy' {Text
policyDocument :: Text
policyName :: Text
roleName :: Text
$sel:policyDocument:PutRolePolicy' :: PutRolePolicy -> Text
$sel:policyName:PutRolePolicy' :: PutRolePolicy -> Text
$sel:roleName:PutRolePolicy' :: PutRolePolicy -> 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
policyName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyDocument
instance Data.ToHeaders PutRolePolicy where
toHeaders :: PutRolePolicy -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath PutRolePolicy where
toPath :: PutRolePolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutRolePolicy where
toQuery :: PutRolePolicy -> QueryString
toQuery PutRolePolicy' {Text
policyDocument :: Text
policyName :: Text
roleName :: Text
$sel:policyDocument:PutRolePolicy' :: PutRolePolicy -> Text
$sel:policyName:PutRolePolicy' :: PutRolePolicy -> Text
$sel:roleName:PutRolePolicy' :: PutRolePolicy -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"PutRolePolicy" :: 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
"PolicyName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyName,
ByteString
"PolicyDocument" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyDocument
]
data PutRolePolicyResponse = PutRolePolicyResponse'
{
}
deriving (PutRolePolicyResponse -> PutRolePolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRolePolicyResponse -> PutRolePolicyResponse -> Bool
$c/= :: PutRolePolicyResponse -> PutRolePolicyResponse -> Bool
== :: PutRolePolicyResponse -> PutRolePolicyResponse -> Bool
$c== :: PutRolePolicyResponse -> PutRolePolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutRolePolicyResponse]
ReadPrec PutRolePolicyResponse
Int -> ReadS PutRolePolicyResponse
ReadS [PutRolePolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRolePolicyResponse]
$creadListPrec :: ReadPrec [PutRolePolicyResponse]
readPrec :: ReadPrec PutRolePolicyResponse
$creadPrec :: ReadPrec PutRolePolicyResponse
readList :: ReadS [PutRolePolicyResponse]
$creadList :: ReadS [PutRolePolicyResponse]
readsPrec :: Int -> ReadS PutRolePolicyResponse
$creadsPrec :: Int -> ReadS PutRolePolicyResponse
Prelude.Read, Int -> PutRolePolicyResponse -> ShowS
[PutRolePolicyResponse] -> ShowS
PutRolePolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRolePolicyResponse] -> ShowS
$cshowList :: [PutRolePolicyResponse] -> ShowS
show :: PutRolePolicyResponse -> String
$cshow :: PutRolePolicyResponse -> String
showsPrec :: Int -> PutRolePolicyResponse -> ShowS
$cshowsPrec :: Int -> PutRolePolicyResponse -> ShowS
Prelude.Show, forall x. Rep PutRolePolicyResponse x -> PutRolePolicyResponse
forall x. PutRolePolicyResponse -> Rep PutRolePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRolePolicyResponse x -> PutRolePolicyResponse
$cfrom :: forall x. PutRolePolicyResponse -> Rep PutRolePolicyResponse x
Prelude.Generic)
newPutRolePolicyResponse ::
PutRolePolicyResponse
newPutRolePolicyResponse :: PutRolePolicyResponse
newPutRolePolicyResponse = PutRolePolicyResponse
PutRolePolicyResponse'
instance Prelude.NFData PutRolePolicyResponse where
rnf :: PutRolePolicyResponse -> ()
rnf PutRolePolicyResponse
_ = ()