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