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