{-# 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 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 PutGroupPolicy = PutGroupPolicy'
{
PutGroupPolicy -> Text
groupName :: Prelude.Text,
PutGroupPolicy -> Text
policyName :: Prelude.Text,
PutGroupPolicy -> Text
policyDocument :: Prelude.Text
}
deriving (PutGroupPolicy -> PutGroupPolicy -> Bool
(PutGroupPolicy -> PutGroupPolicy -> Bool)
-> (PutGroupPolicy -> PutGroupPolicy -> Bool) -> Eq PutGroupPolicy
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]
(Int -> ReadS PutGroupPolicy)
-> ReadS [PutGroupPolicy]
-> ReadPrec PutGroupPolicy
-> ReadPrec [PutGroupPolicy]
-> Read 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
(Int -> PutGroupPolicy -> ShowS)
-> (PutGroupPolicy -> String)
-> ([PutGroupPolicy] -> ShowS)
-> Show PutGroupPolicy
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. PutGroupPolicy -> Rep PutGroupPolicy x)
-> (forall x. Rep PutGroupPolicy x -> PutGroupPolicy)
-> Generic PutGroupPolicy
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' :: Text -> Text -> Text -> PutGroupPolicy
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 :: (Text -> f Text) -> PutGroupPolicy -> f PutGroupPolicy
putGroupPolicy_groupName = (PutGroupPolicy -> Text)
-> (PutGroupPolicy -> Text -> PutGroupPolicy)
-> Lens PutGroupPolicy PutGroupPolicy Text Text
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 :: (Text -> f Text) -> PutGroupPolicy -> f PutGroupPolicy
putGroupPolicy_policyName = (PutGroupPolicy -> Text)
-> (PutGroupPolicy -> Text -> PutGroupPolicy)
-> Lens PutGroupPolicy PutGroupPolicy Text Text
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 :: (Text -> f Text) -> PutGroupPolicy -> f PutGroupPolicy
putGroupPolicy_policyDocument = (PutGroupPolicy -> Text)
-> (PutGroupPolicy -> Text -> PutGroupPolicy)
-> Lens PutGroupPolicy PutGroupPolicy Text Text
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 :: PutGroupPolicy -> Request PutGroupPolicy
request = Service -> PutGroupPolicy -> Request PutGroupPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutGroupPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutGroupPolicy)))
response =
AWSResponse PutGroupPolicy
-> Logger
-> Service
-> Proxy PutGroupPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutGroupPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutGroupPolicy
PutGroupPolicyResponse
PutGroupPolicyResponse'
instance Prelude.Hashable PutGroupPolicy
instance Prelude.NFData PutGroupPolicy
instance Core.ToHeaders PutGroupPolicy where
toHeaders :: PutGroupPolicy -> [Header]
toHeaders = [Header] -> PutGroupPolicy -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutGroupPolicy where
toPath :: PutGroupPolicy -> ByteString
toPath = ByteString -> PutGroupPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.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
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PutGroupPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"GroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
groupName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName,
ByteString
"PolicyDocument" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyDocument
]
data PutGroupPolicyResponse = PutGroupPolicyResponse'
{
}
deriving (PutGroupPolicyResponse -> PutGroupPolicyResponse -> Bool
(PutGroupPolicyResponse -> PutGroupPolicyResponse -> Bool)
-> (PutGroupPolicyResponse -> PutGroupPolicyResponse -> Bool)
-> Eq PutGroupPolicyResponse
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]
(Int -> ReadS PutGroupPolicyResponse)
-> ReadS [PutGroupPolicyResponse]
-> ReadPrec PutGroupPolicyResponse
-> ReadPrec [PutGroupPolicyResponse]
-> Read 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
(Int -> PutGroupPolicyResponse -> ShowS)
-> (PutGroupPolicyResponse -> String)
-> ([PutGroupPolicyResponse] -> ShowS)
-> Show PutGroupPolicyResponse
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. PutGroupPolicyResponse -> Rep PutGroupPolicyResponse x)
-> (forall x.
Rep PutGroupPolicyResponse x -> PutGroupPolicyResponse)
-> Generic PutGroupPolicyResponse
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