{-# 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.Celebrity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.ComparedFace
import Amazonka.Rekognition.Types.KnownGender
data Celebrity = Celebrity'
{
Celebrity -> Maybe Double
matchConfidence :: Prelude.Maybe Prelude.Double,
Celebrity -> Maybe [Text]
urls :: Prelude.Maybe [Prelude.Text],
Celebrity -> Maybe KnownGender
knownGender :: Prelude.Maybe KnownGender,
Celebrity -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Celebrity -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Celebrity -> Maybe ComparedFace
face :: Prelude.Maybe ComparedFace
}
deriving (Celebrity -> Celebrity -> Bool
(Celebrity -> Celebrity -> Bool)
-> (Celebrity -> Celebrity -> Bool) -> Eq Celebrity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Celebrity -> Celebrity -> Bool
$c/= :: Celebrity -> Celebrity -> Bool
== :: Celebrity -> Celebrity -> Bool
$c== :: Celebrity -> Celebrity -> Bool
Prelude.Eq, ReadPrec [Celebrity]
ReadPrec Celebrity
Int -> ReadS Celebrity
ReadS [Celebrity]
(Int -> ReadS Celebrity)
-> ReadS [Celebrity]
-> ReadPrec Celebrity
-> ReadPrec [Celebrity]
-> Read Celebrity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Celebrity]
$creadListPrec :: ReadPrec [Celebrity]
readPrec :: ReadPrec Celebrity
$creadPrec :: ReadPrec Celebrity
readList :: ReadS [Celebrity]
$creadList :: ReadS [Celebrity]
readsPrec :: Int -> ReadS Celebrity
$creadsPrec :: Int -> ReadS Celebrity
Prelude.Read, Int -> Celebrity -> ShowS
[Celebrity] -> ShowS
Celebrity -> String
(Int -> Celebrity -> ShowS)
-> (Celebrity -> String)
-> ([Celebrity] -> ShowS)
-> Show Celebrity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Celebrity] -> ShowS
$cshowList :: [Celebrity] -> ShowS
show :: Celebrity -> String
$cshow :: Celebrity -> String
showsPrec :: Int -> Celebrity -> ShowS
$cshowsPrec :: Int -> Celebrity -> ShowS
Prelude.Show, (forall x. Celebrity -> Rep Celebrity x)
-> (forall x. Rep Celebrity x -> Celebrity) -> Generic Celebrity
forall x. Rep Celebrity x -> Celebrity
forall x. Celebrity -> Rep Celebrity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Celebrity x -> Celebrity
$cfrom :: forall x. Celebrity -> Rep Celebrity x
Prelude.Generic)
newCelebrity ::
Celebrity
newCelebrity :: Celebrity
newCelebrity =
Celebrity' :: Maybe Double
-> Maybe [Text]
-> Maybe KnownGender
-> Maybe Text
-> Maybe Text
-> Maybe ComparedFace
-> Celebrity
Celebrity'
{ $sel:matchConfidence:Celebrity' :: Maybe Double
matchConfidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:urls:Celebrity' :: Maybe [Text]
urls = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:knownGender:Celebrity' :: Maybe KnownGender
knownGender = Maybe KnownGender
forall a. Maybe a
Prelude.Nothing,
$sel:name:Celebrity' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Celebrity' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:face:Celebrity' :: Maybe ComparedFace
face = Maybe ComparedFace
forall a. Maybe a
Prelude.Nothing
}
celebrity_matchConfidence :: Lens.Lens' Celebrity (Prelude.Maybe Prelude.Double)
celebrity_matchConfidence :: (Maybe Double -> f (Maybe Double)) -> Celebrity -> f Celebrity
celebrity_matchConfidence = (Celebrity -> Maybe Double)
-> (Celebrity -> Maybe Double -> Celebrity)
-> Lens Celebrity Celebrity (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe Double
matchConfidence :: Maybe Double
$sel:matchConfidence:Celebrity' :: Celebrity -> Maybe Double
matchConfidence} -> Maybe Double
matchConfidence) (\s :: Celebrity
s@Celebrity' {} Maybe Double
a -> Celebrity
s {$sel:matchConfidence:Celebrity' :: Maybe Double
matchConfidence = Maybe Double
a} :: Celebrity)
celebrity_urls :: Lens.Lens' Celebrity (Prelude.Maybe [Prelude.Text])
celebrity_urls :: (Maybe [Text] -> f (Maybe [Text])) -> Celebrity -> f Celebrity
celebrity_urls = (Celebrity -> Maybe [Text])
-> (Celebrity -> Maybe [Text] -> Celebrity)
-> Lens Celebrity Celebrity (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe [Text]
urls :: Maybe [Text]
$sel:urls:Celebrity' :: Celebrity -> Maybe [Text]
urls} -> Maybe [Text]
urls) (\s :: Celebrity
s@Celebrity' {} Maybe [Text]
a -> Celebrity
s {$sel:urls:Celebrity' :: Maybe [Text]
urls = Maybe [Text]
a} :: Celebrity) ((Maybe [Text] -> f (Maybe [Text])) -> Celebrity -> f Celebrity)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Celebrity
-> f Celebrity
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
celebrity_knownGender :: Lens.Lens' Celebrity (Prelude.Maybe KnownGender)
celebrity_knownGender :: (Maybe KnownGender -> f (Maybe KnownGender))
-> Celebrity -> f Celebrity
celebrity_knownGender = (Celebrity -> Maybe KnownGender)
-> (Celebrity -> Maybe KnownGender -> Celebrity)
-> Lens Celebrity Celebrity (Maybe KnownGender) (Maybe KnownGender)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe KnownGender
knownGender :: Maybe KnownGender
$sel:knownGender:Celebrity' :: Celebrity -> Maybe KnownGender
knownGender} -> Maybe KnownGender
knownGender) (\s :: Celebrity
s@Celebrity' {} Maybe KnownGender
a -> Celebrity
s {$sel:knownGender:Celebrity' :: Maybe KnownGender
knownGender = Maybe KnownGender
a} :: Celebrity)
celebrity_name :: Lens.Lens' Celebrity (Prelude.Maybe Prelude.Text)
celebrity_name :: (Maybe Text -> f (Maybe Text)) -> Celebrity -> f Celebrity
celebrity_name = (Celebrity -> Maybe Text)
-> (Celebrity -> Maybe Text -> Celebrity)
-> Lens Celebrity Celebrity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe Text
name :: Maybe Text
$sel:name:Celebrity' :: Celebrity -> Maybe Text
name} -> Maybe Text
name) (\s :: Celebrity
s@Celebrity' {} Maybe Text
a -> Celebrity
s {$sel:name:Celebrity' :: Maybe Text
name = Maybe Text
a} :: Celebrity)
celebrity_id :: Lens.Lens' Celebrity (Prelude.Maybe Prelude.Text)
celebrity_id :: (Maybe Text -> f (Maybe Text)) -> Celebrity -> f Celebrity
celebrity_id = (Celebrity -> Maybe Text)
-> (Celebrity -> Maybe Text -> Celebrity)
-> Lens Celebrity Celebrity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe Text
id :: Maybe Text
$sel:id:Celebrity' :: Celebrity -> Maybe Text
id} -> Maybe Text
id) (\s :: Celebrity
s@Celebrity' {} Maybe Text
a -> Celebrity
s {$sel:id:Celebrity' :: Maybe Text
id = Maybe Text
a} :: Celebrity)
celebrity_face :: Lens.Lens' Celebrity (Prelude.Maybe ComparedFace)
celebrity_face :: (Maybe ComparedFace -> f (Maybe ComparedFace))
-> Celebrity -> f Celebrity
celebrity_face = (Celebrity -> Maybe ComparedFace)
-> (Celebrity -> Maybe ComparedFace -> Celebrity)
-> Lens
Celebrity Celebrity (Maybe ComparedFace) (Maybe ComparedFace)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Celebrity' {Maybe ComparedFace
face :: Maybe ComparedFace
$sel:face:Celebrity' :: Celebrity -> Maybe ComparedFace
face} -> Maybe ComparedFace
face) (\s :: Celebrity
s@Celebrity' {} Maybe ComparedFace
a -> Celebrity
s {$sel:face:Celebrity' :: Maybe ComparedFace
face = Maybe ComparedFace
a} :: Celebrity)
instance Core.FromJSON Celebrity where
parseJSON :: Value -> Parser Celebrity
parseJSON =
String -> (Object -> Parser Celebrity) -> Value -> Parser Celebrity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Celebrity"
( \Object
x ->
Maybe Double
-> Maybe [Text]
-> Maybe KnownGender
-> Maybe Text
-> Maybe Text
-> Maybe ComparedFace
-> Celebrity
Celebrity'
(Maybe Double
-> Maybe [Text]
-> Maybe KnownGender
-> Maybe Text
-> Maybe Text
-> Maybe ComparedFace
-> Celebrity)
-> Parser (Maybe Double)
-> Parser
(Maybe [Text]
-> Maybe KnownGender
-> Maybe Text
-> Maybe Text
-> Maybe ComparedFace
-> Celebrity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MatchConfidence")
Parser
(Maybe [Text]
-> Maybe KnownGender
-> Maybe Text
-> Maybe Text
-> Maybe ComparedFace
-> Celebrity)
-> Parser (Maybe [Text])
-> Parser
(Maybe KnownGender
-> Maybe Text -> Maybe Text -> Maybe ComparedFace -> Celebrity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Urls" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe KnownGender
-> Maybe Text -> Maybe Text -> Maybe ComparedFace -> Celebrity)
-> Parser (Maybe KnownGender)
-> Parser
(Maybe Text -> Maybe Text -> Maybe ComparedFace -> Celebrity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KnownGender)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KnownGender")
Parser
(Maybe Text -> Maybe Text -> Maybe ComparedFace -> Celebrity)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe ComparedFace -> Celebrity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe Text -> Maybe ComparedFace -> Celebrity)
-> Parser (Maybe Text) -> Parser (Maybe ComparedFace -> Celebrity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
Parser (Maybe ComparedFace -> Celebrity)
-> Parser (Maybe ComparedFace) -> Parser Celebrity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComparedFace)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Face")
)
instance Prelude.Hashable Celebrity
instance Prelude.NFData Celebrity