{-# 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.CloudTrail.Types.LookupAttribute where
import Amazonka.CloudTrail.Types.LookupAttributeKey
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LookupAttribute = LookupAttribute'
{
LookupAttribute -> LookupAttributeKey
attributeKey :: LookupAttributeKey,
LookupAttribute -> Text
attributeValue :: Prelude.Text
}
deriving (LookupAttribute -> LookupAttribute -> Bool
(LookupAttribute -> LookupAttribute -> Bool)
-> (LookupAttribute -> LookupAttribute -> Bool)
-> Eq LookupAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LookupAttribute -> LookupAttribute -> Bool
$c/= :: LookupAttribute -> LookupAttribute -> Bool
== :: LookupAttribute -> LookupAttribute -> Bool
$c== :: LookupAttribute -> LookupAttribute -> Bool
Prelude.Eq, ReadPrec [LookupAttribute]
ReadPrec LookupAttribute
Int -> ReadS LookupAttribute
ReadS [LookupAttribute]
(Int -> ReadS LookupAttribute)
-> ReadS [LookupAttribute]
-> ReadPrec LookupAttribute
-> ReadPrec [LookupAttribute]
-> Read LookupAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LookupAttribute]
$creadListPrec :: ReadPrec [LookupAttribute]
readPrec :: ReadPrec LookupAttribute
$creadPrec :: ReadPrec LookupAttribute
readList :: ReadS [LookupAttribute]
$creadList :: ReadS [LookupAttribute]
readsPrec :: Int -> ReadS LookupAttribute
$creadsPrec :: Int -> ReadS LookupAttribute
Prelude.Read, Int -> LookupAttribute -> ShowS
[LookupAttribute] -> ShowS
LookupAttribute -> String
(Int -> LookupAttribute -> ShowS)
-> (LookupAttribute -> String)
-> ([LookupAttribute] -> ShowS)
-> Show LookupAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LookupAttribute] -> ShowS
$cshowList :: [LookupAttribute] -> ShowS
show :: LookupAttribute -> String
$cshow :: LookupAttribute -> String
showsPrec :: Int -> LookupAttribute -> ShowS
$cshowsPrec :: Int -> LookupAttribute -> ShowS
Prelude.Show, (forall x. LookupAttribute -> Rep LookupAttribute x)
-> (forall x. Rep LookupAttribute x -> LookupAttribute)
-> Generic LookupAttribute
forall x. Rep LookupAttribute x -> LookupAttribute
forall x. LookupAttribute -> Rep LookupAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LookupAttribute x -> LookupAttribute
$cfrom :: forall x. LookupAttribute -> Rep LookupAttribute x
Prelude.Generic)
newLookupAttribute ::
LookupAttributeKey ->
Prelude.Text ->
LookupAttribute
newLookupAttribute :: LookupAttributeKey -> Text -> LookupAttribute
newLookupAttribute LookupAttributeKey
pAttributeKey_ Text
pAttributeValue_ =
LookupAttribute' :: LookupAttributeKey -> Text -> LookupAttribute
LookupAttribute'
{ $sel:attributeKey:LookupAttribute' :: LookupAttributeKey
attributeKey = LookupAttributeKey
pAttributeKey_,
$sel:attributeValue:LookupAttribute' :: Text
attributeValue = Text
pAttributeValue_
}
lookupAttribute_attributeKey :: Lens.Lens' LookupAttribute LookupAttributeKey
lookupAttribute_attributeKey :: (LookupAttributeKey -> f LookupAttributeKey)
-> LookupAttribute -> f LookupAttribute
lookupAttribute_attributeKey = (LookupAttribute -> LookupAttributeKey)
-> (LookupAttribute -> LookupAttributeKey -> LookupAttribute)
-> Lens
LookupAttribute
LookupAttribute
LookupAttributeKey
LookupAttributeKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupAttribute' {LookupAttributeKey
attributeKey :: LookupAttributeKey
$sel:attributeKey:LookupAttribute' :: LookupAttribute -> LookupAttributeKey
attributeKey} -> LookupAttributeKey
attributeKey) (\s :: LookupAttribute
s@LookupAttribute' {} LookupAttributeKey
a -> LookupAttribute
s {$sel:attributeKey:LookupAttribute' :: LookupAttributeKey
attributeKey = LookupAttributeKey
a} :: LookupAttribute)
lookupAttribute_attributeValue :: Lens.Lens' LookupAttribute Prelude.Text
lookupAttribute_attributeValue :: (Text -> f Text) -> LookupAttribute -> f LookupAttribute
lookupAttribute_attributeValue = (LookupAttribute -> Text)
-> (LookupAttribute -> Text -> LookupAttribute)
-> Lens LookupAttribute LookupAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupAttribute' {Text
attributeValue :: Text
$sel:attributeValue:LookupAttribute' :: LookupAttribute -> Text
attributeValue} -> Text
attributeValue) (\s :: LookupAttribute
s@LookupAttribute' {} Text
a -> LookupAttribute
s {$sel:attributeValue:LookupAttribute' :: Text
attributeValue = Text
a} :: LookupAttribute)
instance Prelude.Hashable LookupAttribute
instance Prelude.NFData LookupAttribute
instance Core.ToJSON LookupAttribute where
toJSON :: LookupAttribute -> Value
toJSON LookupAttribute' {Text
LookupAttributeKey
attributeValue :: Text
attributeKey :: LookupAttributeKey
$sel:attributeValue:LookupAttribute' :: LookupAttribute -> Text
$sel:attributeKey:LookupAttribute' :: LookupAttribute -> LookupAttributeKey
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AttributeKey" Text -> LookupAttributeKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LookupAttributeKey
attributeKey),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AttributeValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
attributeValue)
]
)