{-# 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.Lens as Lens
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
(CelebrityRecognition -> CelebrityRecognition -> Bool)
-> (CelebrityRecognition -> CelebrityRecognition -> Bool)
-> Eq CelebrityRecognition
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]
(Int -> ReadS CelebrityRecognition)
-> ReadS [CelebrityRecognition]
-> ReadPrec CelebrityRecognition
-> ReadPrec [CelebrityRecognition]
-> Read 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
(Int -> CelebrityRecognition -> ShowS)
-> (CelebrityRecognition -> String)
-> ([CelebrityRecognition] -> ShowS)
-> Show CelebrityRecognition
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. CelebrityRecognition -> Rep CelebrityRecognition x)
-> (forall x. Rep CelebrityRecognition x -> CelebrityRecognition)
-> Generic CelebrityRecognition
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' :: Maybe CelebrityDetail -> Maybe Integer -> CelebrityRecognition
CelebrityRecognition'
{ $sel:celebrity:CelebrityRecognition' :: Maybe CelebrityDetail
celebrity = Maybe CelebrityDetail
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:CelebrityRecognition' :: Maybe Integer
timestamp = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
celebrityRecognition_celebrity :: Lens.Lens' CelebrityRecognition (Prelude.Maybe CelebrityDetail)
celebrityRecognition_celebrity :: (Maybe CelebrityDetail -> f (Maybe CelebrityDetail))
-> CelebrityRecognition -> f CelebrityRecognition
celebrityRecognition_celebrity = (CelebrityRecognition -> Maybe CelebrityDetail)
-> (CelebrityRecognition
-> Maybe CelebrityDetail -> CelebrityRecognition)
-> Lens
CelebrityRecognition
CelebrityRecognition
(Maybe CelebrityDetail)
(Maybe CelebrityDetail)
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 :: (Maybe Integer -> f (Maybe Integer))
-> CelebrityRecognition -> f CelebrityRecognition
celebrityRecognition_timestamp = (CelebrityRecognition -> Maybe Integer)
-> (CelebrityRecognition -> Maybe Integer -> CelebrityRecognition)
-> Lens
CelebrityRecognition
CelebrityRecognition
(Maybe Integer)
(Maybe Integer)
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 Core.FromJSON CelebrityRecognition where
parseJSON :: Value -> Parser CelebrityRecognition
parseJSON =
String
-> (Object -> Parser CelebrityRecognition)
-> Value
-> Parser CelebrityRecognition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CelebrityRecognition"
( \Object
x ->
Maybe CelebrityDetail -> Maybe Integer -> CelebrityRecognition
CelebrityRecognition'
(Maybe CelebrityDetail -> Maybe Integer -> CelebrityRecognition)
-> Parser (Maybe CelebrityDetail)
-> Parser (Maybe Integer -> CelebrityRecognition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CelebrityDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Celebrity")
Parser (Maybe Integer -> CelebrityRecognition)
-> Parser (Maybe Integer) -> Parser CelebrityRecognition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timestamp")
)
instance Prelude.Hashable CelebrityRecognition
instance Prelude.NFData CelebrityRecognition