{-# 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.PersonDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.BoundingBox
import Amazonka.Rekognition.Types.FaceDetail
data PersonDetail = PersonDetail'
{
PersonDetail -> Maybe BoundingBox
boundingBox :: Prelude.Maybe BoundingBox,
PersonDetail -> Maybe Integer
index :: Prelude.Maybe Prelude.Integer,
PersonDetail -> Maybe FaceDetail
face :: Prelude.Maybe FaceDetail
}
deriving (PersonDetail -> PersonDetail -> Bool
(PersonDetail -> PersonDetail -> Bool)
-> (PersonDetail -> PersonDetail -> Bool) -> Eq PersonDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PersonDetail -> PersonDetail -> Bool
$c/= :: PersonDetail -> PersonDetail -> Bool
== :: PersonDetail -> PersonDetail -> Bool
$c== :: PersonDetail -> PersonDetail -> Bool
Prelude.Eq, ReadPrec [PersonDetail]
ReadPrec PersonDetail
Int -> ReadS PersonDetail
ReadS [PersonDetail]
(Int -> ReadS PersonDetail)
-> ReadS [PersonDetail]
-> ReadPrec PersonDetail
-> ReadPrec [PersonDetail]
-> Read PersonDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PersonDetail]
$creadListPrec :: ReadPrec [PersonDetail]
readPrec :: ReadPrec PersonDetail
$creadPrec :: ReadPrec PersonDetail
readList :: ReadS [PersonDetail]
$creadList :: ReadS [PersonDetail]
readsPrec :: Int -> ReadS PersonDetail
$creadsPrec :: Int -> ReadS PersonDetail
Prelude.Read, Int -> PersonDetail -> ShowS
[PersonDetail] -> ShowS
PersonDetail -> String
(Int -> PersonDetail -> ShowS)
-> (PersonDetail -> String)
-> ([PersonDetail] -> ShowS)
-> Show PersonDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PersonDetail] -> ShowS
$cshowList :: [PersonDetail] -> ShowS
show :: PersonDetail -> String
$cshow :: PersonDetail -> String
showsPrec :: Int -> PersonDetail -> ShowS
$cshowsPrec :: Int -> PersonDetail -> ShowS
Prelude.Show, (forall x. PersonDetail -> Rep PersonDetail x)
-> (forall x. Rep PersonDetail x -> PersonDetail)
-> Generic PersonDetail
forall x. Rep PersonDetail x -> PersonDetail
forall x. PersonDetail -> Rep PersonDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PersonDetail x -> PersonDetail
$cfrom :: forall x. PersonDetail -> Rep PersonDetail x
Prelude.Generic)
newPersonDetail ::
PersonDetail
newPersonDetail :: PersonDetail
newPersonDetail =
PersonDetail' :: Maybe BoundingBox
-> Maybe Integer -> Maybe FaceDetail -> PersonDetail
PersonDetail'
{ $sel:boundingBox:PersonDetail' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
forall a. Maybe a
Prelude.Nothing,
$sel:index:PersonDetail' :: Maybe Integer
index = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:face:PersonDetail' :: Maybe FaceDetail
face = Maybe FaceDetail
forall a. Maybe a
Prelude.Nothing
}
personDetail_boundingBox :: Lens.Lens' PersonDetail (Prelude.Maybe BoundingBox)
personDetail_boundingBox :: (Maybe BoundingBox -> f (Maybe BoundingBox))
-> PersonDetail -> f PersonDetail
personDetail_boundingBox = (PersonDetail -> Maybe BoundingBox)
-> (PersonDetail -> Maybe BoundingBox -> PersonDetail)
-> Lens
PersonDetail PersonDetail (Maybe BoundingBox) (Maybe BoundingBox)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonDetail' {Maybe BoundingBox
boundingBox :: Maybe BoundingBox
$sel:boundingBox:PersonDetail' :: PersonDetail -> Maybe BoundingBox
boundingBox} -> Maybe BoundingBox
boundingBox) (\s :: PersonDetail
s@PersonDetail' {} Maybe BoundingBox
a -> PersonDetail
s {$sel:boundingBox:PersonDetail' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
a} :: PersonDetail)
personDetail_index :: Lens.Lens' PersonDetail (Prelude.Maybe Prelude.Integer)
personDetail_index :: (Maybe Integer -> f (Maybe Integer))
-> PersonDetail -> f PersonDetail
personDetail_index = (PersonDetail -> Maybe Integer)
-> (PersonDetail -> Maybe Integer -> PersonDetail)
-> Lens PersonDetail PersonDetail (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonDetail' {Maybe Integer
index :: Maybe Integer
$sel:index:PersonDetail' :: PersonDetail -> Maybe Integer
index} -> Maybe Integer
index) (\s :: PersonDetail
s@PersonDetail' {} Maybe Integer
a -> PersonDetail
s {$sel:index:PersonDetail' :: Maybe Integer
index = Maybe Integer
a} :: PersonDetail)
personDetail_face :: Lens.Lens' PersonDetail (Prelude.Maybe FaceDetail)
personDetail_face :: (Maybe FaceDetail -> f (Maybe FaceDetail))
-> PersonDetail -> f PersonDetail
personDetail_face = (PersonDetail -> Maybe FaceDetail)
-> (PersonDetail -> Maybe FaceDetail -> PersonDetail)
-> Lens
PersonDetail PersonDetail (Maybe FaceDetail) (Maybe FaceDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PersonDetail' {Maybe FaceDetail
face :: Maybe FaceDetail
$sel:face:PersonDetail' :: PersonDetail -> Maybe FaceDetail
face} -> Maybe FaceDetail
face) (\s :: PersonDetail
s@PersonDetail' {} Maybe FaceDetail
a -> PersonDetail
s {$sel:face:PersonDetail' :: Maybe FaceDetail
face = Maybe FaceDetail
a} :: PersonDetail)
instance Core.FromJSON PersonDetail where
parseJSON :: Value -> Parser PersonDetail
parseJSON =
String
-> (Object -> Parser PersonDetail) -> Value -> Parser PersonDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PersonDetail"
( \Object
x ->
Maybe BoundingBox
-> Maybe Integer -> Maybe FaceDetail -> PersonDetail
PersonDetail'
(Maybe BoundingBox
-> Maybe Integer -> Maybe FaceDetail -> PersonDetail)
-> Parser (Maybe BoundingBox)
-> Parser (Maybe Integer -> Maybe FaceDetail -> PersonDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe BoundingBox)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BoundingBox")
Parser (Maybe Integer -> Maybe FaceDetail -> PersonDetail)
-> Parser (Maybe Integer)
-> Parser (Maybe FaceDetail -> PersonDetail)
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
"Index")
Parser (Maybe FaceDetail -> PersonDetail)
-> Parser (Maybe FaceDetail) -> Parser PersonDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FaceDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Face")
)
instance Prelude.Hashable PersonDetail
instance Prelude.NFData PersonDetail