{-# 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.GetContextKeysForCustomPolicy
(
GetContextKeysForCustomPolicy (..),
newGetContextKeysForCustomPolicy,
getContextKeysForCustomPolicy_policyInputList,
GetContextKeysForPolicyResponse (..),
newGetContextKeysForPolicyResponse,
getContextKeysForPolicyResponse_contextKeyNames,
)
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 GetContextKeysForCustomPolicy = GetContextKeysForCustomPolicy'
{
GetContextKeysForCustomPolicy -> [Text]
policyInputList :: [Prelude.Text]
}
deriving (GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool
(GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool)
-> (GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool)
-> Eq GetContextKeysForCustomPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool
$c/= :: GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool
== :: GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool
$c== :: GetContextKeysForCustomPolicy
-> GetContextKeysForCustomPolicy -> Bool
Prelude.Eq, ReadPrec [GetContextKeysForCustomPolicy]
ReadPrec GetContextKeysForCustomPolicy
Int -> ReadS GetContextKeysForCustomPolicy
ReadS [GetContextKeysForCustomPolicy]
(Int -> ReadS GetContextKeysForCustomPolicy)
-> ReadS [GetContextKeysForCustomPolicy]
-> ReadPrec GetContextKeysForCustomPolicy
-> ReadPrec [GetContextKeysForCustomPolicy]
-> Read GetContextKeysForCustomPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContextKeysForCustomPolicy]
$creadListPrec :: ReadPrec [GetContextKeysForCustomPolicy]
readPrec :: ReadPrec GetContextKeysForCustomPolicy
$creadPrec :: ReadPrec GetContextKeysForCustomPolicy
readList :: ReadS [GetContextKeysForCustomPolicy]
$creadList :: ReadS [GetContextKeysForCustomPolicy]
readsPrec :: Int -> ReadS GetContextKeysForCustomPolicy
$creadsPrec :: Int -> ReadS GetContextKeysForCustomPolicy
Prelude.Read, Int -> GetContextKeysForCustomPolicy -> ShowS
[GetContextKeysForCustomPolicy] -> ShowS
GetContextKeysForCustomPolicy -> String
(Int -> GetContextKeysForCustomPolicy -> ShowS)
-> (GetContextKeysForCustomPolicy -> String)
-> ([GetContextKeysForCustomPolicy] -> ShowS)
-> Show GetContextKeysForCustomPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContextKeysForCustomPolicy] -> ShowS
$cshowList :: [GetContextKeysForCustomPolicy] -> ShowS
show :: GetContextKeysForCustomPolicy -> String
$cshow :: GetContextKeysForCustomPolicy -> String
showsPrec :: Int -> GetContextKeysForCustomPolicy -> ShowS
$cshowsPrec :: Int -> GetContextKeysForCustomPolicy -> ShowS
Prelude.Show, (forall x.
GetContextKeysForCustomPolicy
-> Rep GetContextKeysForCustomPolicy x)
-> (forall x.
Rep GetContextKeysForCustomPolicy x
-> GetContextKeysForCustomPolicy)
-> Generic GetContextKeysForCustomPolicy
forall x.
Rep GetContextKeysForCustomPolicy x
-> GetContextKeysForCustomPolicy
forall x.
GetContextKeysForCustomPolicy
-> Rep GetContextKeysForCustomPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContextKeysForCustomPolicy x
-> GetContextKeysForCustomPolicy
$cfrom :: forall x.
GetContextKeysForCustomPolicy
-> Rep GetContextKeysForCustomPolicy x
Prelude.Generic)
newGetContextKeysForCustomPolicy ::
GetContextKeysForCustomPolicy
newGetContextKeysForCustomPolicy :: GetContextKeysForCustomPolicy
newGetContextKeysForCustomPolicy =
GetContextKeysForCustomPolicy' :: [Text] -> GetContextKeysForCustomPolicy
GetContextKeysForCustomPolicy'
{ $sel:policyInputList:GetContextKeysForCustomPolicy' :: [Text]
policyInputList =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
getContextKeysForCustomPolicy_policyInputList :: Lens.Lens' GetContextKeysForCustomPolicy [Prelude.Text]
getContextKeysForCustomPolicy_policyInputList :: ([Text] -> f [Text])
-> GetContextKeysForCustomPolicy -> f GetContextKeysForCustomPolicy
getContextKeysForCustomPolicy_policyInputList = (GetContextKeysForCustomPolicy -> [Text])
-> (GetContextKeysForCustomPolicy
-> [Text] -> GetContextKeysForCustomPolicy)
-> Lens
GetContextKeysForCustomPolicy
GetContextKeysForCustomPolicy
[Text]
[Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContextKeysForCustomPolicy' {[Text]
policyInputList :: [Text]
$sel:policyInputList:GetContextKeysForCustomPolicy' :: GetContextKeysForCustomPolicy -> [Text]
policyInputList} -> [Text]
policyInputList) (\s :: GetContextKeysForCustomPolicy
s@GetContextKeysForCustomPolicy' {} [Text]
a -> GetContextKeysForCustomPolicy
s {$sel:policyInputList:GetContextKeysForCustomPolicy' :: [Text]
policyInputList = [Text]
a} :: GetContextKeysForCustomPolicy) (([Text] -> f [Text])
-> GetContextKeysForCustomPolicy
-> f GetContextKeysForCustomPolicy)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetContextKeysForCustomPolicy
-> f GetContextKeysForCustomPolicy
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
GetContextKeysForCustomPolicy
where
type
AWSResponse GetContextKeysForCustomPolicy =
GetContextKeysForPolicyResponse
request :: GetContextKeysForCustomPolicy
-> Request GetContextKeysForCustomPolicy
request = Service
-> GetContextKeysForCustomPolicy
-> Request GetContextKeysForCustomPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetContextKeysForCustomPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContextKeysForCustomPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetContextKeysForCustomPolicy))
-> Logger
-> Service
-> Proxy GetContextKeysForCustomPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContextKeysForCustomPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetContextKeysForCustomPolicyResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String GetContextKeysForPolicyResponse
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance
Prelude.Hashable
GetContextKeysForCustomPolicy
instance Prelude.NFData GetContextKeysForCustomPolicy
instance Core.ToHeaders GetContextKeysForCustomPolicy where
toHeaders :: GetContextKeysForCustomPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> GetContextKeysForCustomPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetContextKeysForCustomPolicy where
toPath :: GetContextKeysForCustomPolicy -> ByteString
toPath = ByteString -> GetContextKeysForCustomPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetContextKeysForCustomPolicy where
toQuery :: GetContextKeysForCustomPolicy -> QueryString
toQuery GetContextKeysForCustomPolicy' {[Text]
policyInputList :: [Text]
$sel:policyInputList:GetContextKeysForCustomPolicy' :: GetContextKeysForCustomPolicy -> [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
"GetContextKeysForCustomPolicy" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"PolicyInputList"
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]
policyInputList
]