{-# 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.CustomerProfiles.Types.FoundByKeyValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data FoundByKeyValue = FoundByKeyValue'
{
FoundByKeyValue -> Maybe Text
keyName :: Prelude.Maybe Prelude.Text,
FoundByKeyValue -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
}
deriving (FoundByKeyValue -> FoundByKeyValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FoundByKeyValue -> FoundByKeyValue -> Bool
$c/= :: FoundByKeyValue -> FoundByKeyValue -> Bool
== :: FoundByKeyValue -> FoundByKeyValue -> Bool
$c== :: FoundByKeyValue -> FoundByKeyValue -> Bool
Prelude.Eq, ReadPrec [FoundByKeyValue]
ReadPrec FoundByKeyValue
Int -> ReadS FoundByKeyValue
ReadS [FoundByKeyValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FoundByKeyValue]
$creadListPrec :: ReadPrec [FoundByKeyValue]
readPrec :: ReadPrec FoundByKeyValue
$creadPrec :: ReadPrec FoundByKeyValue
readList :: ReadS [FoundByKeyValue]
$creadList :: ReadS [FoundByKeyValue]
readsPrec :: Int -> ReadS FoundByKeyValue
$creadsPrec :: Int -> ReadS FoundByKeyValue
Prelude.Read, Int -> FoundByKeyValue -> ShowS
[FoundByKeyValue] -> ShowS
FoundByKeyValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FoundByKeyValue] -> ShowS
$cshowList :: [FoundByKeyValue] -> ShowS
show :: FoundByKeyValue -> String
$cshow :: FoundByKeyValue -> String
showsPrec :: Int -> FoundByKeyValue -> ShowS
$cshowsPrec :: Int -> FoundByKeyValue -> ShowS
Prelude.Show, forall x. Rep FoundByKeyValue x -> FoundByKeyValue
forall x. FoundByKeyValue -> Rep FoundByKeyValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FoundByKeyValue x -> FoundByKeyValue
$cfrom :: forall x. FoundByKeyValue -> Rep FoundByKeyValue x
Prelude.Generic)
newFoundByKeyValue ::
FoundByKeyValue
newFoundByKeyValue :: FoundByKeyValue
newFoundByKeyValue =
FoundByKeyValue'
{ $sel:keyName:FoundByKeyValue' :: Maybe Text
keyName = forall a. Maybe a
Prelude.Nothing,
$sel:values:FoundByKeyValue' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
}
foundByKeyValue_keyName :: Lens.Lens' FoundByKeyValue (Prelude.Maybe Prelude.Text)
foundByKeyValue_keyName :: Lens' FoundByKeyValue (Maybe Text)
foundByKeyValue_keyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FoundByKeyValue' {Maybe Text
keyName :: Maybe Text
$sel:keyName:FoundByKeyValue' :: FoundByKeyValue -> Maybe Text
keyName} -> Maybe Text
keyName) (\s :: FoundByKeyValue
s@FoundByKeyValue' {} Maybe Text
a -> FoundByKeyValue
s {$sel:keyName:FoundByKeyValue' :: Maybe Text
keyName = Maybe Text
a} :: FoundByKeyValue)
foundByKeyValue_values :: Lens.Lens' FoundByKeyValue (Prelude.Maybe [Prelude.Text])
foundByKeyValue_values :: Lens' FoundByKeyValue (Maybe [Text])
foundByKeyValue_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FoundByKeyValue' {Maybe [Text]
values :: Maybe [Text]
$sel:values:FoundByKeyValue' :: FoundByKeyValue -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: FoundByKeyValue
s@FoundByKeyValue' {} Maybe [Text]
a -> FoundByKeyValue
s {$sel:values:FoundByKeyValue' :: Maybe [Text]
values = Maybe [Text]
a} :: FoundByKeyValue) 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
instance Data.FromJSON FoundByKeyValue where
parseJSON :: Value -> Parser FoundByKeyValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FoundByKeyValue"
( \Object
x ->
Maybe Text -> Maybe [Text] -> FoundByKeyValue
FoundByKeyValue'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KeyName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Values" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable FoundByKeyValue where
hashWithSalt :: Int -> FoundByKeyValue -> Int
hashWithSalt Int
_salt FoundByKeyValue' {Maybe [Text]
Maybe Text
values :: Maybe [Text]
keyName :: Maybe Text
$sel:values:FoundByKeyValue' :: FoundByKeyValue -> Maybe [Text]
$sel:keyName:FoundByKeyValue' :: FoundByKeyValue -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
keyName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values
instance Prelude.NFData FoundByKeyValue where
rnf :: FoundByKeyValue -> ()
rnf FoundByKeyValue' {Maybe [Text]
Maybe Text
values :: Maybe [Text]
keyName :: Maybe Text
$sel:values:FoundByKeyValue' :: FoundByKeyValue -> Maybe [Text]
$sel:keyName:FoundByKeyValue' :: FoundByKeyValue -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
keyName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values