{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IAM.Types.ContextEntry where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.ContextKeyTypeEnum
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContextEntry = ContextEntry'
{
ContextEntry -> Maybe [Text]
contextKeyValues :: Prelude.Maybe [Prelude.Text],
ContextEntry -> Maybe Text
contextKeyName :: Prelude.Maybe Prelude.Text,
ContextEntry -> Maybe ContextKeyTypeEnum
contextKeyType :: Prelude.Maybe ContextKeyTypeEnum
}
deriving (ContextEntry -> ContextEntry -> Bool
(ContextEntry -> ContextEntry -> Bool)
-> (ContextEntry -> ContextEntry -> Bool) -> Eq ContextEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContextEntry -> ContextEntry -> Bool
$c/= :: ContextEntry -> ContextEntry -> Bool
== :: ContextEntry -> ContextEntry -> Bool
$c== :: ContextEntry -> ContextEntry -> Bool
Prelude.Eq, ReadPrec [ContextEntry]
ReadPrec ContextEntry
Int -> ReadS ContextEntry
ReadS [ContextEntry]
(Int -> ReadS ContextEntry)
-> ReadS [ContextEntry]
-> ReadPrec ContextEntry
-> ReadPrec [ContextEntry]
-> Read ContextEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContextEntry]
$creadListPrec :: ReadPrec [ContextEntry]
readPrec :: ReadPrec ContextEntry
$creadPrec :: ReadPrec ContextEntry
readList :: ReadS [ContextEntry]
$creadList :: ReadS [ContextEntry]
readsPrec :: Int -> ReadS ContextEntry
$creadsPrec :: Int -> ReadS ContextEntry
Prelude.Read, Int -> ContextEntry -> ShowS
[ContextEntry] -> ShowS
ContextEntry -> String
(Int -> ContextEntry -> ShowS)
-> (ContextEntry -> String)
-> ([ContextEntry] -> ShowS)
-> Show ContextEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContextEntry] -> ShowS
$cshowList :: [ContextEntry] -> ShowS
show :: ContextEntry -> String
$cshow :: ContextEntry -> String
showsPrec :: Int -> ContextEntry -> ShowS
$cshowsPrec :: Int -> ContextEntry -> ShowS
Prelude.Show, (forall x. ContextEntry -> Rep ContextEntry x)
-> (forall x. Rep ContextEntry x -> ContextEntry)
-> Generic ContextEntry
forall x. Rep ContextEntry x -> ContextEntry
forall x. ContextEntry -> Rep ContextEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContextEntry x -> ContextEntry
$cfrom :: forall x. ContextEntry -> Rep ContextEntry x
Prelude.Generic)
newContextEntry ::
ContextEntry
newContextEntry :: ContextEntry
newContextEntry =
ContextEntry' :: Maybe [Text]
-> Maybe Text -> Maybe ContextKeyTypeEnum -> ContextEntry
ContextEntry'
{ $sel:contextKeyValues:ContextEntry' :: Maybe [Text]
contextKeyValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:contextKeyName:ContextEntry' :: Maybe Text
contextKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contextKeyType:ContextEntry' :: Maybe ContextKeyTypeEnum
contextKeyType = Maybe ContextKeyTypeEnum
forall a. Maybe a
Prelude.Nothing
}
contextEntry_contextKeyValues :: Lens.Lens' ContextEntry (Prelude.Maybe [Prelude.Text])
contextEntry_contextKeyValues :: (Maybe [Text] -> f (Maybe [Text]))
-> ContextEntry -> f ContextEntry
contextEntry_contextKeyValues = (ContextEntry -> Maybe [Text])
-> (ContextEntry -> Maybe [Text] -> ContextEntry)
-> Lens ContextEntry ContextEntry (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextEntry' {Maybe [Text]
contextKeyValues :: Maybe [Text]
$sel:contextKeyValues:ContextEntry' :: ContextEntry -> Maybe [Text]
contextKeyValues} -> Maybe [Text]
contextKeyValues) (\s :: ContextEntry
s@ContextEntry' {} Maybe [Text]
a -> ContextEntry
s {$sel:contextKeyValues:ContextEntry' :: Maybe [Text]
contextKeyValues = Maybe [Text]
a} :: ContextEntry) ((Maybe [Text] -> f (Maybe [Text]))
-> ContextEntry -> f ContextEntry)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ContextEntry
-> f ContextEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
contextEntry_contextKeyName :: Lens.Lens' ContextEntry (Prelude.Maybe Prelude.Text)
contextEntry_contextKeyName :: (Maybe Text -> f (Maybe Text)) -> ContextEntry -> f ContextEntry
contextEntry_contextKeyName = (ContextEntry -> Maybe Text)
-> (ContextEntry -> Maybe Text -> ContextEntry)
-> Lens ContextEntry ContextEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextEntry' {Maybe Text
contextKeyName :: Maybe Text
$sel:contextKeyName:ContextEntry' :: ContextEntry -> Maybe Text
contextKeyName} -> Maybe Text
contextKeyName) (\s :: ContextEntry
s@ContextEntry' {} Maybe Text
a -> ContextEntry
s {$sel:contextKeyName:ContextEntry' :: Maybe Text
contextKeyName = Maybe Text
a} :: ContextEntry)
contextEntry_contextKeyType :: Lens.Lens' ContextEntry (Prelude.Maybe ContextKeyTypeEnum)
contextEntry_contextKeyType :: (Maybe ContextKeyTypeEnum -> f (Maybe ContextKeyTypeEnum))
-> ContextEntry -> f ContextEntry
contextEntry_contextKeyType = (ContextEntry -> Maybe ContextKeyTypeEnum)
-> (ContextEntry -> Maybe ContextKeyTypeEnum -> ContextEntry)
-> Lens
ContextEntry
ContextEntry
(Maybe ContextKeyTypeEnum)
(Maybe ContextKeyTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContextEntry' {Maybe ContextKeyTypeEnum
contextKeyType :: Maybe ContextKeyTypeEnum
$sel:contextKeyType:ContextEntry' :: ContextEntry -> Maybe ContextKeyTypeEnum
contextKeyType} -> Maybe ContextKeyTypeEnum
contextKeyType) (\s :: ContextEntry
s@ContextEntry' {} Maybe ContextKeyTypeEnum
a -> ContextEntry
s {$sel:contextKeyType:ContextEntry' :: Maybe ContextKeyTypeEnum
contextKeyType = Maybe ContextKeyTypeEnum
a} :: ContextEntry)
instance Prelude.Hashable ContextEntry
instance Prelude.NFData ContextEntry
instance Core.ToQuery ContextEntry where
toQuery :: ContextEntry -> QueryString
toQuery ContextEntry' {Maybe [Text]
Maybe Text
Maybe ContextKeyTypeEnum
contextKeyType :: Maybe ContextKeyTypeEnum
contextKeyName :: Maybe Text
contextKeyValues :: Maybe [Text]
$sel:contextKeyType:ContextEntry' :: ContextEntry -> Maybe ContextKeyTypeEnum
$sel:contextKeyName:ContextEntry' :: ContextEntry -> Maybe Text
$sel:contextKeyValues:ContextEntry' :: ContextEntry -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ContextKeyValues"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
contextKeyValues
),
ByteString
"ContextKeyName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
contextKeyName,
ByteString
"ContextKeyType" ByteString -> Maybe ContextKeyTypeEnum -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ContextKeyTypeEnum
contextKeyType
]