{-# 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.GetContextKeysForPrincipalPolicy
(
GetContextKeysForPrincipalPolicy (..),
newGetContextKeysForPrincipalPolicy,
getContextKeysForPrincipalPolicy_policyInputList,
getContextKeysForPrincipalPolicy_policySourceArn,
GetContextKeysForPolicyResponse (..),
newGetContextKeysForPolicyResponse,
getContextKeysForPolicyResponse_contextKeyNames,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetContextKeysForPrincipalPolicy = GetContextKeysForPrincipalPolicy'
{
GetContextKeysForPrincipalPolicy -> Maybe [Text]
policyInputList :: Prelude.Maybe [Prelude.Text],
GetContextKeysForPrincipalPolicy -> Text
policySourceArn :: Prelude.Text
}
deriving (GetContextKeysForPrincipalPolicy
-> GetContextKeysForPrincipalPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContextKeysForPrincipalPolicy
-> GetContextKeysForPrincipalPolicy -> Bool
$c/= :: GetContextKeysForPrincipalPolicy
-> GetContextKeysForPrincipalPolicy -> Bool
== :: GetContextKeysForPrincipalPolicy
-> GetContextKeysForPrincipalPolicy -> Bool
$c== :: GetContextKeysForPrincipalPolicy
-> GetContextKeysForPrincipalPolicy -> Bool
Prelude.Eq, ReadPrec [GetContextKeysForPrincipalPolicy]
ReadPrec GetContextKeysForPrincipalPolicy
Int -> ReadS GetContextKeysForPrincipalPolicy
ReadS [GetContextKeysForPrincipalPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContextKeysForPrincipalPolicy]
$creadListPrec :: ReadPrec [GetContextKeysForPrincipalPolicy]
readPrec :: ReadPrec GetContextKeysForPrincipalPolicy
$creadPrec :: ReadPrec GetContextKeysForPrincipalPolicy
readList :: ReadS [GetContextKeysForPrincipalPolicy]
$creadList :: ReadS [GetContextKeysForPrincipalPolicy]
readsPrec :: Int -> ReadS GetContextKeysForPrincipalPolicy
$creadsPrec :: Int -> ReadS GetContextKeysForPrincipalPolicy
Prelude.Read, Int -> GetContextKeysForPrincipalPolicy -> ShowS
[GetContextKeysForPrincipalPolicy] -> ShowS
GetContextKeysForPrincipalPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContextKeysForPrincipalPolicy] -> ShowS
$cshowList :: [GetContextKeysForPrincipalPolicy] -> ShowS
show :: GetContextKeysForPrincipalPolicy -> String
$cshow :: GetContextKeysForPrincipalPolicy -> String
showsPrec :: Int -> GetContextKeysForPrincipalPolicy -> ShowS
$cshowsPrec :: Int -> GetContextKeysForPrincipalPolicy -> ShowS
Prelude.Show, forall x.
Rep GetContextKeysForPrincipalPolicy x
-> GetContextKeysForPrincipalPolicy
forall x.
GetContextKeysForPrincipalPolicy
-> Rep GetContextKeysForPrincipalPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContextKeysForPrincipalPolicy x
-> GetContextKeysForPrincipalPolicy
$cfrom :: forall x.
GetContextKeysForPrincipalPolicy
-> Rep GetContextKeysForPrincipalPolicy x
Prelude.Generic)
newGetContextKeysForPrincipalPolicy ::
Prelude.Text ->
GetContextKeysForPrincipalPolicy
newGetContextKeysForPrincipalPolicy :: Text -> GetContextKeysForPrincipalPolicy
newGetContextKeysForPrincipalPolicy Text
pPolicySourceArn_ =
GetContextKeysForPrincipalPolicy'
{ $sel:policyInputList:GetContextKeysForPrincipalPolicy' :: Maybe [Text]
policyInputList =
forall a. Maybe a
Prelude.Nothing,
$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: Text
policySourceArn = Text
pPolicySourceArn_
}
getContextKeysForPrincipalPolicy_policyInputList :: Lens.Lens' GetContextKeysForPrincipalPolicy (Prelude.Maybe [Prelude.Text])
getContextKeysForPrincipalPolicy_policyInputList :: Lens' GetContextKeysForPrincipalPolicy (Maybe [Text])
getContextKeysForPrincipalPolicy_policyInputList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContextKeysForPrincipalPolicy' {Maybe [Text]
policyInputList :: Maybe [Text]
$sel:policyInputList:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Maybe [Text]
policyInputList} -> Maybe [Text]
policyInputList) (\s :: GetContextKeysForPrincipalPolicy
s@GetContextKeysForPrincipalPolicy' {} Maybe [Text]
a -> GetContextKeysForPrincipalPolicy
s {$sel:policyInputList:GetContextKeysForPrincipalPolicy' :: Maybe [Text]
policyInputList = Maybe [Text]
a} :: GetContextKeysForPrincipalPolicy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getContextKeysForPrincipalPolicy_policySourceArn :: Lens.Lens' GetContextKeysForPrincipalPolicy Prelude.Text
getContextKeysForPrincipalPolicy_policySourceArn :: Lens' GetContextKeysForPrincipalPolicy Text
getContextKeysForPrincipalPolicy_policySourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContextKeysForPrincipalPolicy' {Text
policySourceArn :: Text
$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Text
policySourceArn} -> Text
policySourceArn) (\s :: GetContextKeysForPrincipalPolicy
s@GetContextKeysForPrincipalPolicy' {} Text
a -> GetContextKeysForPrincipalPolicy
s {$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: Text
policySourceArn = Text
a} :: GetContextKeysForPrincipalPolicy)
instance
Core.AWSRequest
GetContextKeysForPrincipalPolicy
where
type
AWSResponse GetContextKeysForPrincipalPolicy =
GetContextKeysForPolicyResponse
request :: (Service -> Service)
-> GetContextKeysForPrincipalPolicy
-> Request GetContextKeysForPrincipalPolicy
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetContextKeysForPrincipalPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetContextKeysForPrincipalPolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetContextKeysForPrincipalPolicyResult"
(\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
instance
Prelude.Hashable
GetContextKeysForPrincipalPolicy
where
hashWithSalt :: Int -> GetContextKeysForPrincipalPolicy -> Int
hashWithSalt
Int
_salt
GetContextKeysForPrincipalPolicy' {Maybe [Text]
Text
policySourceArn :: Text
policyInputList :: Maybe [Text]
$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Text
$sel:policyInputList:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
policyInputList
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policySourceArn
instance
Prelude.NFData
GetContextKeysForPrincipalPolicy
where
rnf :: GetContextKeysForPrincipalPolicy -> ()
rnf GetContextKeysForPrincipalPolicy' {Maybe [Text]
Text
policySourceArn :: Text
policyInputList :: Maybe [Text]
$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Text
$sel:policyInputList:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
policyInputList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policySourceArn
instance
Data.ToHeaders
GetContextKeysForPrincipalPolicy
where
toHeaders :: GetContextKeysForPrincipalPolicy -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetContextKeysForPrincipalPolicy where
toPath :: GetContextKeysForPrincipalPolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
GetContextKeysForPrincipalPolicy
where
toQuery :: GetContextKeysForPrincipalPolicy -> QueryString
toQuery GetContextKeysForPrincipalPolicy' {Maybe [Text]
Text
policySourceArn :: Text
policyInputList :: Maybe [Text]
$sel:policySourceArn:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Text
$sel:policyInputList:GetContextKeysForPrincipalPolicy' :: GetContextKeysForPrincipalPolicy -> Maybe [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetContextKeysForPrincipalPolicy" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"PolicyInputList"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
policyInputList
),
ByteString
"PolicySourceArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policySourceArn
]