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