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