{-# 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.Face where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.BoundingBox
data Face = Face'
{
Face -> Maybe Text
faceId :: Prelude.Maybe Prelude.Text,
Face -> Maybe BoundingBox
boundingBox :: Prelude.Maybe BoundingBox,
Face -> Maybe Text
externalImageId :: Prelude.Maybe Prelude.Text,
Face -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
Face -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text
}
deriving (Face -> Face -> Bool
(Face -> Face -> Bool) -> (Face -> Face -> Bool) -> Eq Face
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Face -> Face -> Bool
$c/= :: Face -> Face -> Bool
== :: Face -> Face -> Bool
$c== :: Face -> Face -> Bool
Prelude.Eq, ReadPrec [Face]
ReadPrec Face
Int -> ReadS Face
ReadS [Face]
(Int -> ReadS Face)
-> ReadS [Face] -> ReadPrec Face -> ReadPrec [Face] -> Read Face
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Face]
$creadListPrec :: ReadPrec [Face]
readPrec :: ReadPrec Face
$creadPrec :: ReadPrec Face
readList :: ReadS [Face]
$creadList :: ReadS [Face]
readsPrec :: Int -> ReadS Face
$creadsPrec :: Int -> ReadS Face
Prelude.Read, Int -> Face -> ShowS
[Face] -> ShowS
Face -> String
(Int -> Face -> ShowS)
-> (Face -> String) -> ([Face] -> ShowS) -> Show Face
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Face] -> ShowS
$cshowList :: [Face] -> ShowS
show :: Face -> String
$cshow :: Face -> String
showsPrec :: Int -> Face -> ShowS
$cshowsPrec :: Int -> Face -> ShowS
Prelude.Show, (forall x. Face -> Rep Face x)
-> (forall x. Rep Face x -> Face) -> Generic Face
forall x. Rep Face x -> Face
forall x. Face -> Rep Face x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Face x -> Face
$cfrom :: forall x. Face -> Rep Face x
Prelude.Generic)
newFace ::
Face
newFace :: Face
newFace =
Face' :: Maybe Text
-> Maybe BoundingBox
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Face
Face'
{ $sel:faceId:Face' :: Maybe Text
faceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:boundingBox:Face' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
forall a. Maybe a
Prelude.Nothing,
$sel:externalImageId:Face' :: Maybe Text
externalImageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:confidence:Face' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:imageId:Face' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
face_faceId :: Lens.Lens' Face (Prelude.Maybe Prelude.Text)
face_faceId :: (Maybe Text -> f (Maybe Text)) -> Face -> f Face
face_faceId = (Face -> Maybe Text)
-> (Face -> Maybe Text -> Face)
-> Lens Face Face (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Face' {Maybe Text
faceId :: Maybe Text
$sel:faceId:Face' :: Face -> Maybe Text
faceId} -> Maybe Text
faceId) (\s :: Face
s@Face' {} Maybe Text
a -> Face
s {$sel:faceId:Face' :: Maybe Text
faceId = Maybe Text
a} :: Face)
face_boundingBox :: Lens.Lens' Face (Prelude.Maybe BoundingBox)
face_boundingBox :: (Maybe BoundingBox -> f (Maybe BoundingBox)) -> Face -> f Face
face_boundingBox = (Face -> Maybe BoundingBox)
-> (Face -> Maybe BoundingBox -> Face)
-> Lens Face Face (Maybe BoundingBox) (Maybe BoundingBox)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Face' {Maybe BoundingBox
boundingBox :: Maybe BoundingBox
$sel:boundingBox:Face' :: Face -> Maybe BoundingBox
boundingBox} -> Maybe BoundingBox
boundingBox) (\s :: Face
s@Face' {} Maybe BoundingBox
a -> Face
s {$sel:boundingBox:Face' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
a} :: Face)
face_externalImageId :: Lens.Lens' Face (Prelude.Maybe Prelude.Text)
face_externalImageId :: (Maybe Text -> f (Maybe Text)) -> Face -> f Face
face_externalImageId = (Face -> Maybe Text)
-> (Face -> Maybe Text -> Face)
-> Lens Face Face (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Face' {Maybe Text
externalImageId :: Maybe Text
$sel:externalImageId:Face' :: Face -> Maybe Text
externalImageId} -> Maybe Text
externalImageId) (\s :: Face
s@Face' {} Maybe Text
a -> Face
s {$sel:externalImageId:Face' :: Maybe Text
externalImageId = Maybe Text
a} :: Face)
face_confidence :: Lens.Lens' Face (Prelude.Maybe Prelude.Double)
face_confidence :: (Maybe Double -> f (Maybe Double)) -> Face -> f Face
face_confidence = (Face -> Maybe Double)
-> (Face -> Maybe Double -> Face)
-> Lens Face Face (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Face' {Maybe Double
confidence :: Maybe Double
$sel:confidence:Face' :: Face -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: Face
s@Face' {} Maybe Double
a -> Face
s {$sel:confidence:Face' :: Maybe Double
confidence = Maybe Double
a} :: Face)
face_imageId :: Lens.Lens' Face (Prelude.Maybe Prelude.Text)
face_imageId :: (Maybe Text -> f (Maybe Text)) -> Face -> f Face
face_imageId = (Face -> Maybe Text)
-> (Face -> Maybe Text -> Face)
-> Lens Face Face (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Face' {Maybe Text
imageId :: Maybe Text
$sel:imageId:Face' :: Face -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: Face
s@Face' {} Maybe Text
a -> Face
s {$sel:imageId:Face' :: Maybe Text
imageId = Maybe Text
a} :: Face)
instance Core.FromJSON Face where
parseJSON :: Value -> Parser Face
parseJSON =
String -> (Object -> Parser Face) -> Value -> Parser Face
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Face"
( \Object
x ->
Maybe Text
-> Maybe BoundingBox
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Face
Face'
(Maybe Text
-> Maybe BoundingBox
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Face)
-> Parser (Maybe Text)
-> Parser
(Maybe BoundingBox
-> Maybe Text -> Maybe Double -> Maybe Text -> Face)
forall (f :: * -> *) a b. Functor 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
"FaceId")
Parser
(Maybe BoundingBox
-> Maybe Text -> Maybe Double -> Maybe Text -> Face)
-> Parser (Maybe BoundingBox)
-> Parser (Maybe Text -> Maybe Double -> Maybe Text -> Face)
forall (f :: * -> *) a b. Applicative f => 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 Text -> Maybe Double -> Maybe Text -> Face)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Text -> Face)
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
"ExternalImageId")
Parser (Maybe Double -> Maybe Text -> Face)
-> Parser (Maybe Double) -> Parser (Maybe Text -> Face)
forall (f :: * -> *) a b. Applicative f => 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
"Confidence")
Parser (Maybe Text -> Face) -> Parser (Maybe Text) -> Parser Face
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
"ImageId")
)
instance Prelude.Hashable Face
instance Prelude.NFData Face