{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Rekognition.Types.FaceDetail
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Rekognition.Types.FaceDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.AgeRange
import Amazonka.Rekognition.Types.Beard
import Amazonka.Rekognition.Types.BoundingBox
import Amazonka.Rekognition.Types.Emotion
import Amazonka.Rekognition.Types.EyeOpen
import Amazonka.Rekognition.Types.Eyeglasses
import Amazonka.Rekognition.Types.Gender
import Amazonka.Rekognition.Types.ImageQuality
import Amazonka.Rekognition.Types.Landmark
import Amazonka.Rekognition.Types.MouthOpen
import Amazonka.Rekognition.Types.Mustache
import Amazonka.Rekognition.Types.Pose
import Amazonka.Rekognition.Types.Smile
import Amazonka.Rekognition.Types.Sunglasses

-- | Structure containing attributes of the face that the algorithm detected.
--
-- A @FaceDetail@ object contains either the default facial attributes or
-- all facial attributes. The default attributes are @BoundingBox@,
-- @Confidence@, @Landmarks@, @Pose@, and @Quality@.
--
-- GetFaceDetection is the only Amazon Rekognition Video stored video
-- operation that can return a @FaceDetail@ object with all attributes. To
-- specify which attributes to return, use the @FaceAttributes@ input
-- parameter for StartFaceDetection. The following Amazon Rekognition Video
-- operations return only the default attributes. The corresponding Start
-- operations don\'t have a @FaceAttributes@ input parameter.
--
-- -   GetCelebrityRecognition
--
-- -   GetPersonTracking
--
-- -   GetFaceSearch
--
-- The Amazon Rekognition Image DetectFaces and IndexFaces operations can
-- return all facial attributes. To specify which attributes to return, use
-- the @Attributes@ input parameter for @DetectFaces@. For @IndexFaces@,
-- use the @DetectAttributes@ input parameter.
--
-- /See:/ 'newFaceDetail' smart constructor.
data FaceDetail = FaceDetail'
  { -- | The estimated age range, in years, for the face. Low represents the
    -- lowest estimated age and High represents the highest estimated age.
    FaceDetail -> Maybe AgeRange
ageRange :: Prelude.Maybe AgeRange,
    -- | Indicates whether or not the face is wearing sunglasses, and the
    -- confidence level in the determination.
    FaceDetail -> Maybe Sunglasses
sunglasses :: Prelude.Maybe Sunglasses,
    -- | Indicates whether or not the mouth on the face is open, and the
    -- confidence level in the determination.
    FaceDetail -> Maybe MouthOpen
mouthOpen :: Prelude.Maybe MouthOpen,
    -- | Bounding box of the face. Default attribute.
    FaceDetail -> Maybe BoundingBox
boundingBox :: Prelude.Maybe BoundingBox,
    -- | The emotions that appear to be expressed on the face, and the confidence
    -- level in the determination. The API is only making a determination of
    -- the physical appearance of a person\'s face. It is not a determination
    -- of the person’s internal emotional state and should not be used in such
    -- a way. For example, a person pretending to have a sad face might not be
    -- sad emotionally.
    FaceDetail -> Maybe [Emotion]
emotions :: Prelude.Maybe [Emotion],
    -- | Indicates whether or not the eyes on the face are open, and the
    -- confidence level in the determination.
    FaceDetail -> Maybe EyeOpen
eyesOpen :: Prelude.Maybe EyeOpen,
    -- | Indicates the pose of the face as determined by its pitch, roll, and
    -- yaw. Default attribute.
    FaceDetail -> Maybe Pose
pose :: Prelude.Maybe Pose,
    -- | Confidence level that the bounding box contains a face (and not a
    -- different object such as a tree). Default attribute.
    FaceDetail -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
    -- | The predicted gender of a detected face.
    FaceDetail -> Maybe Gender
gender :: Prelude.Maybe Gender,
    -- | Identifies image brightness and sharpness. Default attribute.
    FaceDetail -> Maybe ImageQuality
quality :: Prelude.Maybe ImageQuality,
    -- | Indicates whether or not the face is wearing eye glasses, and the
    -- confidence level in the determination.
    FaceDetail -> Maybe Eyeglasses
eyeglasses :: Prelude.Maybe Eyeglasses,
    -- | Indicates whether or not the face has a beard, and the confidence level
    -- in the determination.
    FaceDetail -> Maybe Beard
beard :: Prelude.Maybe Beard,
    -- | Indicates whether or not the face has a mustache, and the confidence
    -- level in the determination.
    FaceDetail -> Maybe Mustache
mustache :: Prelude.Maybe Mustache,
    -- | Indicates whether or not the face is smiling, and the confidence level
    -- in the determination.
    FaceDetail -> Maybe Smile
smile :: Prelude.Maybe Smile,
    -- | Indicates the location of landmarks on the face. Default attribute.
    FaceDetail -> Maybe [Landmark]
landmarks :: Prelude.Maybe [Landmark]
  }
  deriving (FaceDetail -> FaceDetail -> Bool
(FaceDetail -> FaceDetail -> Bool)
-> (FaceDetail -> FaceDetail -> Bool) -> Eq FaceDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaceDetail -> FaceDetail -> Bool
$c/= :: FaceDetail -> FaceDetail -> Bool
== :: FaceDetail -> FaceDetail -> Bool
$c== :: FaceDetail -> FaceDetail -> Bool
Prelude.Eq, ReadPrec [FaceDetail]
ReadPrec FaceDetail
Int -> ReadS FaceDetail
ReadS [FaceDetail]
(Int -> ReadS FaceDetail)
-> ReadS [FaceDetail]
-> ReadPrec FaceDetail
-> ReadPrec [FaceDetail]
-> Read FaceDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaceDetail]
$creadListPrec :: ReadPrec [FaceDetail]
readPrec :: ReadPrec FaceDetail
$creadPrec :: ReadPrec FaceDetail
readList :: ReadS [FaceDetail]
$creadList :: ReadS [FaceDetail]
readsPrec :: Int -> ReadS FaceDetail
$creadsPrec :: Int -> ReadS FaceDetail
Prelude.Read, Int -> FaceDetail -> ShowS
[FaceDetail] -> ShowS
FaceDetail -> String
(Int -> FaceDetail -> ShowS)
-> (FaceDetail -> String)
-> ([FaceDetail] -> ShowS)
-> Show FaceDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaceDetail] -> ShowS
$cshowList :: [FaceDetail] -> ShowS
show :: FaceDetail -> String
$cshow :: FaceDetail -> String
showsPrec :: Int -> FaceDetail -> ShowS
$cshowsPrec :: Int -> FaceDetail -> ShowS
Prelude.Show, (forall x. FaceDetail -> Rep FaceDetail x)
-> (forall x. Rep FaceDetail x -> FaceDetail) -> Generic FaceDetail
forall x. Rep FaceDetail x -> FaceDetail
forall x. FaceDetail -> Rep FaceDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaceDetail x -> FaceDetail
$cfrom :: forall x. FaceDetail -> Rep FaceDetail x
Prelude.Generic)

-- |
-- Create a value of 'FaceDetail' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'ageRange', 'faceDetail_ageRange' - The estimated age range, in years, for the face. Low represents the
-- lowest estimated age and High represents the highest estimated age.
--
-- 'sunglasses', 'faceDetail_sunglasses' - Indicates whether or not the face is wearing sunglasses, and the
-- confidence level in the determination.
--
-- 'mouthOpen', 'faceDetail_mouthOpen' - Indicates whether or not the mouth on the face is open, and the
-- confidence level in the determination.
--
-- 'boundingBox', 'faceDetail_boundingBox' - Bounding box of the face. Default attribute.
--
-- 'emotions', 'faceDetail_emotions' - The emotions that appear to be expressed on the face, and the confidence
-- level in the determination. The API is only making a determination of
-- the physical appearance of a person\'s face. It is not a determination
-- of the person’s internal emotional state and should not be used in such
-- a way. For example, a person pretending to have a sad face might not be
-- sad emotionally.
--
-- 'eyesOpen', 'faceDetail_eyesOpen' - Indicates whether or not the eyes on the face are open, and the
-- confidence level in the determination.
--
-- 'pose', 'faceDetail_pose' - Indicates the pose of the face as determined by its pitch, roll, and
-- yaw. Default attribute.
--
-- 'confidence', 'faceDetail_confidence' - Confidence level that the bounding box contains a face (and not a
-- different object such as a tree). Default attribute.
--
-- 'gender', 'faceDetail_gender' - The predicted gender of a detected face.
--
-- 'quality', 'faceDetail_quality' - Identifies image brightness and sharpness. Default attribute.
--
-- 'eyeglasses', 'faceDetail_eyeglasses' - Indicates whether or not the face is wearing eye glasses, and the
-- confidence level in the determination.
--
-- 'beard', 'faceDetail_beard' - Indicates whether or not the face has a beard, and the confidence level
-- in the determination.
--
-- 'mustache', 'faceDetail_mustache' - Indicates whether or not the face has a mustache, and the confidence
-- level in the determination.
--
-- 'smile', 'faceDetail_smile' - Indicates whether or not the face is smiling, and the confidence level
-- in the determination.
--
-- 'landmarks', 'faceDetail_landmarks' - Indicates the location of landmarks on the face. Default attribute.
newFaceDetail ::
  FaceDetail
newFaceDetail :: FaceDetail
newFaceDetail =
  FaceDetail' :: Maybe AgeRange
-> Maybe Sunglasses
-> Maybe MouthOpen
-> Maybe BoundingBox
-> Maybe [Emotion]
-> Maybe EyeOpen
-> Maybe Pose
-> Maybe Double
-> Maybe Gender
-> Maybe ImageQuality
-> Maybe Eyeglasses
-> Maybe Beard
-> Maybe Mustache
-> Maybe Smile
-> Maybe [Landmark]
-> FaceDetail
FaceDetail'
    { $sel:ageRange:FaceDetail' :: Maybe AgeRange
ageRange = Maybe AgeRange
forall a. Maybe a
Prelude.Nothing,
      $sel:sunglasses:FaceDetail' :: Maybe Sunglasses
sunglasses = Maybe Sunglasses
forall a. Maybe a
Prelude.Nothing,
      $sel:mouthOpen:FaceDetail' :: Maybe MouthOpen
mouthOpen = Maybe MouthOpen
forall a. Maybe a
Prelude.Nothing,
      $sel:boundingBox:FaceDetail' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
forall a. Maybe a
Prelude.Nothing,
      $sel:emotions:FaceDetail' :: Maybe [Emotion]
emotions = Maybe [Emotion]
forall a. Maybe a
Prelude.Nothing,
      $sel:eyesOpen:FaceDetail' :: Maybe EyeOpen
eyesOpen = Maybe EyeOpen
forall a. Maybe a
Prelude.Nothing,
      $sel:pose:FaceDetail' :: Maybe Pose
pose = Maybe Pose
forall a. Maybe a
Prelude.Nothing,
      $sel:confidence:FaceDetail' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:gender:FaceDetail' :: Maybe Gender
gender = Maybe Gender
forall a. Maybe a
Prelude.Nothing,
      $sel:quality:FaceDetail' :: Maybe ImageQuality
quality = Maybe ImageQuality
forall a. Maybe a
Prelude.Nothing,
      $sel:eyeglasses:FaceDetail' :: Maybe Eyeglasses
eyeglasses = Maybe Eyeglasses
forall a. Maybe a
Prelude.Nothing,
      $sel:beard:FaceDetail' :: Maybe Beard
beard = Maybe Beard
forall a. Maybe a
Prelude.Nothing,
      $sel:mustache:FaceDetail' :: Maybe Mustache
mustache = Maybe Mustache
forall a. Maybe a
Prelude.Nothing,
      $sel:smile:FaceDetail' :: Maybe Smile
smile = Maybe Smile
forall a. Maybe a
Prelude.Nothing,
      $sel:landmarks:FaceDetail' :: Maybe [Landmark]
landmarks = Maybe [Landmark]
forall a. Maybe a
Prelude.Nothing
    }

-- | The estimated age range, in years, for the face. Low represents the
-- lowest estimated age and High represents the highest estimated age.
faceDetail_ageRange :: Lens.Lens' FaceDetail (Prelude.Maybe AgeRange)
faceDetail_ageRange :: (Maybe AgeRange -> f (Maybe AgeRange))
-> FaceDetail -> f FaceDetail
faceDetail_ageRange = (FaceDetail -> Maybe AgeRange)
-> (FaceDetail -> Maybe AgeRange -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe AgeRange) (Maybe AgeRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe AgeRange
ageRange :: Maybe AgeRange
$sel:ageRange:FaceDetail' :: FaceDetail -> Maybe AgeRange
ageRange} -> Maybe AgeRange
ageRange) (\s :: FaceDetail
s@FaceDetail' {} Maybe AgeRange
a -> FaceDetail
s {$sel:ageRange:FaceDetail' :: Maybe AgeRange
ageRange = Maybe AgeRange
a} :: FaceDetail)

-- | Indicates whether or not the face is wearing sunglasses, and the
-- confidence level in the determination.
faceDetail_sunglasses :: Lens.Lens' FaceDetail (Prelude.Maybe Sunglasses)
faceDetail_sunglasses :: (Maybe Sunglasses -> f (Maybe Sunglasses))
-> FaceDetail -> f FaceDetail
faceDetail_sunglasses = (FaceDetail -> Maybe Sunglasses)
-> (FaceDetail -> Maybe Sunglasses -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Sunglasses) (Maybe Sunglasses)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Sunglasses
sunglasses :: Maybe Sunglasses
$sel:sunglasses:FaceDetail' :: FaceDetail -> Maybe Sunglasses
sunglasses} -> Maybe Sunglasses
sunglasses) (\s :: FaceDetail
s@FaceDetail' {} Maybe Sunglasses
a -> FaceDetail
s {$sel:sunglasses:FaceDetail' :: Maybe Sunglasses
sunglasses = Maybe Sunglasses
a} :: FaceDetail)

-- | Indicates whether or not the mouth on the face is open, and the
-- confidence level in the determination.
faceDetail_mouthOpen :: Lens.Lens' FaceDetail (Prelude.Maybe MouthOpen)
faceDetail_mouthOpen :: (Maybe MouthOpen -> f (Maybe MouthOpen))
-> FaceDetail -> f FaceDetail
faceDetail_mouthOpen = (FaceDetail -> Maybe MouthOpen)
-> (FaceDetail -> Maybe MouthOpen -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe MouthOpen) (Maybe MouthOpen)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe MouthOpen
mouthOpen :: Maybe MouthOpen
$sel:mouthOpen:FaceDetail' :: FaceDetail -> Maybe MouthOpen
mouthOpen} -> Maybe MouthOpen
mouthOpen) (\s :: FaceDetail
s@FaceDetail' {} Maybe MouthOpen
a -> FaceDetail
s {$sel:mouthOpen:FaceDetail' :: Maybe MouthOpen
mouthOpen = Maybe MouthOpen
a} :: FaceDetail)

-- | Bounding box of the face. Default attribute.
faceDetail_boundingBox :: Lens.Lens' FaceDetail (Prelude.Maybe BoundingBox)
faceDetail_boundingBox :: (Maybe BoundingBox -> f (Maybe BoundingBox))
-> FaceDetail -> f FaceDetail
faceDetail_boundingBox = (FaceDetail -> Maybe BoundingBox)
-> (FaceDetail -> Maybe BoundingBox -> FaceDetail)
-> Lens
     FaceDetail FaceDetail (Maybe BoundingBox) (Maybe BoundingBox)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe BoundingBox
boundingBox :: Maybe BoundingBox
$sel:boundingBox:FaceDetail' :: FaceDetail -> Maybe BoundingBox
boundingBox} -> Maybe BoundingBox
boundingBox) (\s :: FaceDetail
s@FaceDetail' {} Maybe BoundingBox
a -> FaceDetail
s {$sel:boundingBox:FaceDetail' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
a} :: FaceDetail)

-- | The emotions that appear to be expressed on the face, and the confidence
-- level in the determination. The API is only making a determination of
-- the physical appearance of a person\'s face. It is not a determination
-- of the person’s internal emotional state and should not be used in such
-- a way. For example, a person pretending to have a sad face might not be
-- sad emotionally.
faceDetail_emotions :: Lens.Lens' FaceDetail (Prelude.Maybe [Emotion])
faceDetail_emotions :: (Maybe [Emotion] -> f (Maybe [Emotion]))
-> FaceDetail -> f FaceDetail
faceDetail_emotions = (FaceDetail -> Maybe [Emotion])
-> (FaceDetail -> Maybe [Emotion] -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe [Emotion]) (Maybe [Emotion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe [Emotion]
emotions :: Maybe [Emotion]
$sel:emotions:FaceDetail' :: FaceDetail -> Maybe [Emotion]
emotions} -> Maybe [Emotion]
emotions) (\s :: FaceDetail
s@FaceDetail' {} Maybe [Emotion]
a -> FaceDetail
s {$sel:emotions:FaceDetail' :: Maybe [Emotion]
emotions = Maybe [Emotion]
a} :: FaceDetail) ((Maybe [Emotion] -> f (Maybe [Emotion]))
 -> FaceDetail -> f FaceDetail)
-> ((Maybe [Emotion] -> f (Maybe [Emotion]))
    -> Maybe [Emotion] -> f (Maybe [Emotion]))
-> (Maybe [Emotion] -> f (Maybe [Emotion]))
-> FaceDetail
-> f FaceDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Emotion] [Emotion] [Emotion] [Emotion]
-> Iso
     (Maybe [Emotion])
     (Maybe [Emotion])
     (Maybe [Emotion])
     (Maybe [Emotion])
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 [Emotion] [Emotion] [Emotion] [Emotion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether or not the eyes on the face are open, and the
-- confidence level in the determination.
faceDetail_eyesOpen :: Lens.Lens' FaceDetail (Prelude.Maybe EyeOpen)
faceDetail_eyesOpen :: (Maybe EyeOpen -> f (Maybe EyeOpen)) -> FaceDetail -> f FaceDetail
faceDetail_eyesOpen = (FaceDetail -> Maybe EyeOpen)
-> (FaceDetail -> Maybe EyeOpen -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe EyeOpen) (Maybe EyeOpen)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe EyeOpen
eyesOpen :: Maybe EyeOpen
$sel:eyesOpen:FaceDetail' :: FaceDetail -> Maybe EyeOpen
eyesOpen} -> Maybe EyeOpen
eyesOpen) (\s :: FaceDetail
s@FaceDetail' {} Maybe EyeOpen
a -> FaceDetail
s {$sel:eyesOpen:FaceDetail' :: Maybe EyeOpen
eyesOpen = Maybe EyeOpen
a} :: FaceDetail)

-- | Indicates the pose of the face as determined by its pitch, roll, and
-- yaw. Default attribute.
faceDetail_pose :: Lens.Lens' FaceDetail (Prelude.Maybe Pose)
faceDetail_pose :: (Maybe Pose -> f (Maybe Pose)) -> FaceDetail -> f FaceDetail
faceDetail_pose = (FaceDetail -> Maybe Pose)
-> (FaceDetail -> Maybe Pose -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Pose) (Maybe Pose)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Pose
pose :: Maybe Pose
$sel:pose:FaceDetail' :: FaceDetail -> Maybe Pose
pose} -> Maybe Pose
pose) (\s :: FaceDetail
s@FaceDetail' {} Maybe Pose
a -> FaceDetail
s {$sel:pose:FaceDetail' :: Maybe Pose
pose = Maybe Pose
a} :: FaceDetail)

-- | Confidence level that the bounding box contains a face (and not a
-- different object such as a tree). Default attribute.
faceDetail_confidence :: Lens.Lens' FaceDetail (Prelude.Maybe Prelude.Double)
faceDetail_confidence :: (Maybe Double -> f (Maybe Double)) -> FaceDetail -> f FaceDetail
faceDetail_confidence = (FaceDetail -> Maybe Double)
-> (FaceDetail -> Maybe Double -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Double
confidence :: Maybe Double
$sel:confidence:FaceDetail' :: FaceDetail -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: FaceDetail
s@FaceDetail' {} Maybe Double
a -> FaceDetail
s {$sel:confidence:FaceDetail' :: Maybe Double
confidence = Maybe Double
a} :: FaceDetail)

-- | The predicted gender of a detected face.
faceDetail_gender :: Lens.Lens' FaceDetail (Prelude.Maybe Gender)
faceDetail_gender :: (Maybe Gender -> f (Maybe Gender)) -> FaceDetail -> f FaceDetail
faceDetail_gender = (FaceDetail -> Maybe Gender)
-> (FaceDetail -> Maybe Gender -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Gender) (Maybe Gender)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Gender
gender :: Maybe Gender
$sel:gender:FaceDetail' :: FaceDetail -> Maybe Gender
gender} -> Maybe Gender
gender) (\s :: FaceDetail
s@FaceDetail' {} Maybe Gender
a -> FaceDetail
s {$sel:gender:FaceDetail' :: Maybe Gender
gender = Maybe Gender
a} :: FaceDetail)

-- | Identifies image brightness and sharpness. Default attribute.
faceDetail_quality :: Lens.Lens' FaceDetail (Prelude.Maybe ImageQuality)
faceDetail_quality :: (Maybe ImageQuality -> f (Maybe ImageQuality))
-> FaceDetail -> f FaceDetail
faceDetail_quality = (FaceDetail -> Maybe ImageQuality)
-> (FaceDetail -> Maybe ImageQuality -> FaceDetail)
-> Lens
     FaceDetail FaceDetail (Maybe ImageQuality) (Maybe ImageQuality)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe ImageQuality
quality :: Maybe ImageQuality
$sel:quality:FaceDetail' :: FaceDetail -> Maybe ImageQuality
quality} -> Maybe ImageQuality
quality) (\s :: FaceDetail
s@FaceDetail' {} Maybe ImageQuality
a -> FaceDetail
s {$sel:quality:FaceDetail' :: Maybe ImageQuality
quality = Maybe ImageQuality
a} :: FaceDetail)

-- | Indicates whether or not the face is wearing eye glasses, and the
-- confidence level in the determination.
faceDetail_eyeglasses :: Lens.Lens' FaceDetail (Prelude.Maybe Eyeglasses)
faceDetail_eyeglasses :: (Maybe Eyeglasses -> f (Maybe Eyeglasses))
-> FaceDetail -> f FaceDetail
faceDetail_eyeglasses = (FaceDetail -> Maybe Eyeglasses)
-> (FaceDetail -> Maybe Eyeglasses -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Eyeglasses) (Maybe Eyeglasses)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Eyeglasses
eyeglasses :: Maybe Eyeglasses
$sel:eyeglasses:FaceDetail' :: FaceDetail -> Maybe Eyeglasses
eyeglasses} -> Maybe Eyeglasses
eyeglasses) (\s :: FaceDetail
s@FaceDetail' {} Maybe Eyeglasses
a -> FaceDetail
s {$sel:eyeglasses:FaceDetail' :: Maybe Eyeglasses
eyeglasses = Maybe Eyeglasses
a} :: FaceDetail)

-- | Indicates whether or not the face has a beard, and the confidence level
-- in the determination.
faceDetail_beard :: Lens.Lens' FaceDetail (Prelude.Maybe Beard)
faceDetail_beard :: (Maybe Beard -> f (Maybe Beard)) -> FaceDetail -> f FaceDetail
faceDetail_beard = (FaceDetail -> Maybe Beard)
-> (FaceDetail -> Maybe Beard -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Beard) (Maybe Beard)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Beard
beard :: Maybe Beard
$sel:beard:FaceDetail' :: FaceDetail -> Maybe Beard
beard} -> Maybe Beard
beard) (\s :: FaceDetail
s@FaceDetail' {} Maybe Beard
a -> FaceDetail
s {$sel:beard:FaceDetail' :: Maybe Beard
beard = Maybe Beard
a} :: FaceDetail)

-- | Indicates whether or not the face has a mustache, and the confidence
-- level in the determination.
faceDetail_mustache :: Lens.Lens' FaceDetail (Prelude.Maybe Mustache)
faceDetail_mustache :: (Maybe Mustache -> f (Maybe Mustache))
-> FaceDetail -> f FaceDetail
faceDetail_mustache = (FaceDetail -> Maybe Mustache)
-> (FaceDetail -> Maybe Mustache -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Mustache) (Maybe Mustache)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Mustache
mustache :: Maybe Mustache
$sel:mustache:FaceDetail' :: FaceDetail -> Maybe Mustache
mustache} -> Maybe Mustache
mustache) (\s :: FaceDetail
s@FaceDetail' {} Maybe Mustache
a -> FaceDetail
s {$sel:mustache:FaceDetail' :: Maybe Mustache
mustache = Maybe Mustache
a} :: FaceDetail)

-- | Indicates whether or not the face is smiling, and the confidence level
-- in the determination.
faceDetail_smile :: Lens.Lens' FaceDetail (Prelude.Maybe Smile)
faceDetail_smile :: (Maybe Smile -> f (Maybe Smile)) -> FaceDetail -> f FaceDetail
faceDetail_smile = (FaceDetail -> Maybe Smile)
-> (FaceDetail -> Maybe Smile -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe Smile) (Maybe Smile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe Smile
smile :: Maybe Smile
$sel:smile:FaceDetail' :: FaceDetail -> Maybe Smile
smile} -> Maybe Smile
smile) (\s :: FaceDetail
s@FaceDetail' {} Maybe Smile
a -> FaceDetail
s {$sel:smile:FaceDetail' :: Maybe Smile
smile = Maybe Smile
a} :: FaceDetail)

-- | Indicates the location of landmarks on the face. Default attribute.
faceDetail_landmarks :: Lens.Lens' FaceDetail (Prelude.Maybe [Landmark])
faceDetail_landmarks :: (Maybe [Landmark] -> f (Maybe [Landmark]))
-> FaceDetail -> f FaceDetail
faceDetail_landmarks = (FaceDetail -> Maybe [Landmark])
-> (FaceDetail -> Maybe [Landmark] -> FaceDetail)
-> Lens FaceDetail FaceDetail (Maybe [Landmark]) (Maybe [Landmark])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaceDetail' {Maybe [Landmark]
landmarks :: Maybe [Landmark]
$sel:landmarks:FaceDetail' :: FaceDetail -> Maybe [Landmark]
landmarks} -> Maybe [Landmark]
landmarks) (\s :: FaceDetail
s@FaceDetail' {} Maybe [Landmark]
a -> FaceDetail
s {$sel:landmarks:FaceDetail' :: Maybe [Landmark]
landmarks = Maybe [Landmark]
a} :: FaceDetail) ((Maybe [Landmark] -> f (Maybe [Landmark]))
 -> FaceDetail -> f FaceDetail)
-> ((Maybe [Landmark] -> f (Maybe [Landmark]))
    -> Maybe [Landmark] -> f (Maybe [Landmark]))
-> (Maybe [Landmark] -> f (Maybe [Landmark]))
-> FaceDetail
-> f FaceDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Landmark] [Landmark] [Landmark] [Landmark]
-> Iso
     (Maybe [Landmark])
     (Maybe [Landmark])
     (Maybe [Landmark])
     (Maybe [Landmark])
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 [Landmark] [Landmark] [Landmark] [Landmark]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON FaceDetail where
  parseJSON :: Value -> Parser FaceDetail
parseJSON =
    String
-> (Object -> Parser FaceDetail) -> Value -> Parser FaceDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FaceDetail"
      ( \Object
x ->
          Maybe AgeRange
-> Maybe Sunglasses
-> Maybe MouthOpen
-> Maybe BoundingBox
-> Maybe [Emotion]
-> Maybe EyeOpen
-> Maybe Pose
-> Maybe Double
-> Maybe Gender
-> Maybe ImageQuality
-> Maybe Eyeglasses
-> Maybe Beard
-> Maybe Mustache
-> Maybe Smile
-> Maybe [Landmark]
-> FaceDetail
FaceDetail'
            (Maybe AgeRange
 -> Maybe Sunglasses
 -> Maybe MouthOpen
 -> Maybe BoundingBox
 -> Maybe [Emotion]
 -> Maybe EyeOpen
 -> Maybe Pose
 -> Maybe Double
 -> Maybe Gender
 -> Maybe ImageQuality
 -> Maybe Eyeglasses
 -> Maybe Beard
 -> Maybe Mustache
 -> Maybe Smile
 -> Maybe [Landmark]
 -> FaceDetail)
-> Parser (Maybe AgeRange)
-> Parser
     (Maybe Sunglasses
      -> Maybe MouthOpen
      -> Maybe BoundingBox
      -> Maybe [Emotion]
      -> Maybe EyeOpen
      -> Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AgeRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AgeRange")
            Parser
  (Maybe Sunglasses
   -> Maybe MouthOpen
   -> Maybe BoundingBox
   -> Maybe [Emotion]
   -> Maybe EyeOpen
   -> Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe Sunglasses)
-> Parser
     (Maybe MouthOpen
      -> Maybe BoundingBox
      -> Maybe [Emotion]
      -> Maybe EyeOpen
      -> Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Sunglasses)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Sunglasses")
            Parser
  (Maybe MouthOpen
   -> Maybe BoundingBox
   -> Maybe [Emotion]
   -> Maybe EyeOpen
   -> Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe MouthOpen)
-> Parser
     (Maybe BoundingBox
      -> Maybe [Emotion]
      -> Maybe EyeOpen
      -> Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MouthOpen)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MouthOpen")
            Parser
  (Maybe BoundingBox
   -> Maybe [Emotion]
   -> Maybe EyeOpen
   -> Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe BoundingBox)
-> Parser
     (Maybe [Emotion]
      -> Maybe EyeOpen
      -> Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
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 [Emotion]
   -> Maybe EyeOpen
   -> Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe [Emotion])
-> Parser
     (Maybe EyeOpen
      -> Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Emotion]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Emotions" Parser (Maybe (Maybe [Emotion]))
-> Maybe [Emotion] -> Parser (Maybe [Emotion])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Emotion]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe EyeOpen
   -> Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe EyeOpen)
-> Parser
     (Maybe Pose
      -> Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EyeOpen)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EyesOpen")
            Parser
  (Maybe Pose
   -> Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe Pose)
-> Parser
     (Maybe Double
      -> Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Pose)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Pose")
            Parser
  (Maybe Double
   -> Maybe Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe Double)
-> Parser
     (Maybe Gender
      -> Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
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 Gender
   -> Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe Gender)
-> Parser
     (Maybe ImageQuality
      -> Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Gender)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Gender")
            Parser
  (Maybe ImageQuality
   -> Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe ImageQuality)
-> Parser
     (Maybe Eyeglasses
      -> Maybe Beard
      -> Maybe Mustache
      -> Maybe Smile
      -> Maybe [Landmark]
      -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageQuality)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Quality")
            Parser
  (Maybe Eyeglasses
   -> Maybe Beard
   -> Maybe Mustache
   -> Maybe Smile
   -> Maybe [Landmark]
   -> FaceDetail)
-> Parser (Maybe Eyeglasses)
-> Parser
     (Maybe Beard
      -> Maybe Mustache -> Maybe Smile -> Maybe [Landmark] -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Eyeglasses)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Eyeglasses")
            Parser
  (Maybe Beard
   -> Maybe Mustache -> Maybe Smile -> Maybe [Landmark] -> FaceDetail)
-> Parser (Maybe Beard)
-> Parser
     (Maybe Mustache -> Maybe Smile -> Maybe [Landmark] -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Beard)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Beard")
            Parser
  (Maybe Mustache -> Maybe Smile -> Maybe [Landmark] -> FaceDetail)
-> Parser (Maybe Mustache)
-> Parser (Maybe Smile -> Maybe [Landmark] -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mustache)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Mustache")
            Parser (Maybe Smile -> Maybe [Landmark] -> FaceDetail)
-> Parser (Maybe Smile) -> Parser (Maybe [Landmark] -> FaceDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Smile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Smile")
            Parser (Maybe [Landmark] -> FaceDetail)
-> Parser (Maybe [Landmark]) -> Parser FaceDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Landmark]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Landmarks" Parser (Maybe (Maybe [Landmark]))
-> Maybe [Landmark] -> Parser (Maybe [Landmark])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Landmark]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable FaceDetail

instance Prelude.NFData FaceDetail