{-# 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.Rekognition.Types.CelebrityRecognition 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
import Amazonka.Rekognition.Types.CelebrityDetail
data CelebrityRecognition = CelebrityRecognition'
{
CelebrityRecognition -> Maybe CelebrityDetail
celebrity :: Prelude.Maybe CelebrityDetail,
CelebrityRecognition -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer
}
deriving (CelebrityRecognition -> CelebrityRecognition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CelebrityRecognition -> CelebrityRecognition -> Bool
$c/= :: CelebrityRecognition -> CelebrityRecognition -> Bool
== :: CelebrityRecognition -> CelebrityRecognition -> Bool
$c== :: CelebrityRecognition -> CelebrityRecognition -> Bool
Prelude.Eq, ReadPrec [CelebrityRecognition]
ReadPrec CelebrityRecognition
Int -> ReadS CelebrityRecognition
ReadS [CelebrityRecognition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CelebrityRecognition]
$creadListPrec :: ReadPrec [CelebrityRecognition]
readPrec :: ReadPrec CelebrityRecognition
$creadPrec :: ReadPrec CelebrityRecognition
readList :: ReadS [CelebrityRecognition]
$creadList :: ReadS [CelebrityRecognition]
readsPrec :: Int -> ReadS CelebrityRecognition
$creadsPrec :: Int -> ReadS CelebrityRecognition
Prelude.Read, Int -> CelebrityRecognition -> ShowS
[CelebrityRecognition] -> ShowS
CelebrityRecognition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CelebrityRecognition] -> ShowS
$cshowList :: [CelebrityRecognition] -> ShowS
show :: CelebrityRecognition -> String
$cshow :: CelebrityRecognition -> String
showsPrec :: Int -> CelebrityRecognition -> ShowS
$cshowsPrec :: Int -> CelebrityRecognition -> ShowS
Prelude.Show, forall x. Rep CelebrityRecognition x -> CelebrityRecognition
forall x. CelebrityRecognition -> Rep CelebrityRecognition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CelebrityRecognition x -> CelebrityRecognition
$cfrom :: forall x. CelebrityRecognition -> Rep CelebrityRecognition x
Prelude.Generic)
newCelebrityRecognition ::
CelebrityRecognition
newCelebrityRecognition :: CelebrityRecognition
newCelebrityRecognition =
CelebrityRecognition'
{ $sel:celebrity:CelebrityRecognition' :: Maybe CelebrityDetail
celebrity = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:CelebrityRecognition' :: Maybe Integer
timestamp = forall a. Maybe a
Prelude.Nothing
}
celebrityRecognition_celebrity :: Lens.Lens' CelebrityRecognition (Prelude.Maybe CelebrityDetail)
celebrityRecognition_celebrity :: Lens' CelebrityRecognition (Maybe CelebrityDetail)
celebrityRecognition_celebrity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CelebrityRecognition' {Maybe CelebrityDetail
celebrity :: Maybe CelebrityDetail
$sel:celebrity:CelebrityRecognition' :: CelebrityRecognition -> Maybe CelebrityDetail
celebrity} -> Maybe CelebrityDetail
celebrity) (\s :: CelebrityRecognition
s@CelebrityRecognition' {} Maybe CelebrityDetail
a -> CelebrityRecognition
s {$sel:celebrity:CelebrityRecognition' :: Maybe CelebrityDetail
celebrity = Maybe CelebrityDetail
a} :: CelebrityRecognition)
celebrityRecognition_timestamp :: Lens.Lens' CelebrityRecognition (Prelude.Maybe Prelude.Integer)
celebrityRecognition_timestamp :: Lens' CelebrityRecognition (Maybe Integer)
celebrityRecognition_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CelebrityRecognition' {Maybe Integer
timestamp :: Maybe Integer
$sel:timestamp:CelebrityRecognition' :: CelebrityRecognition -> Maybe Integer
timestamp} -> Maybe Integer
timestamp) (\s :: CelebrityRecognition
s@CelebrityRecognition' {} Maybe Integer
a -> CelebrityRecognition
s {$sel:timestamp:CelebrityRecognition' :: Maybe Integer
timestamp = Maybe Integer
a} :: CelebrityRecognition)
instance Data.FromJSON CelebrityRecognition where
parseJSON :: Value -> Parser CelebrityRecognition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CelebrityRecognition"
( \Object
x ->
Maybe CelebrityDetail -> Maybe Integer -> CelebrityRecognition
CelebrityRecognition'
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
"Celebrity")
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
"Timestamp")
)
instance Prelude.Hashable CelebrityRecognition where
hashWithSalt :: Int -> CelebrityRecognition -> Int
hashWithSalt Int
_salt CelebrityRecognition' {Maybe Integer
Maybe CelebrityDetail
timestamp :: Maybe Integer
celebrity :: Maybe CelebrityDetail
$sel:timestamp:CelebrityRecognition' :: CelebrityRecognition -> Maybe Integer
$sel:celebrity:CelebrityRecognition' :: CelebrityRecognition -> Maybe CelebrityDetail
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CelebrityDetail
celebrity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
timestamp
instance Prelude.NFData CelebrityRecognition where
rnf :: CelebrityRecognition -> ()
rnf CelebrityRecognition' {Maybe Integer
Maybe CelebrityDetail
timestamp :: Maybe Integer
celebrity :: Maybe CelebrityDetail
$sel:timestamp:CelebrityRecognition' :: CelebrityRecognition -> Maybe Integer
$sel:celebrity:CelebrityRecognition' :: CelebrityRecognition -> Maybe CelebrityDetail
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CelebrityDetail
celebrity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
timestamp