{-# 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.UnindexedFace where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.FaceDetail
import Amazonka.Rekognition.Types.Reason
data UnindexedFace = UnindexedFace'
{
UnindexedFace -> Maybe [Reason]
reasons :: Prelude.Maybe [Reason],
UnindexedFace -> Maybe FaceDetail
faceDetail :: Prelude.Maybe FaceDetail
}
deriving (UnindexedFace -> UnindexedFace -> Bool
(UnindexedFace -> UnindexedFace -> Bool)
-> (UnindexedFace -> UnindexedFace -> Bool) -> Eq UnindexedFace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnindexedFace -> UnindexedFace -> Bool
$c/= :: UnindexedFace -> UnindexedFace -> Bool
== :: UnindexedFace -> UnindexedFace -> Bool
$c== :: UnindexedFace -> UnindexedFace -> Bool
Prelude.Eq, ReadPrec [UnindexedFace]
ReadPrec UnindexedFace
Int -> ReadS UnindexedFace
ReadS [UnindexedFace]
(Int -> ReadS UnindexedFace)
-> ReadS [UnindexedFace]
-> ReadPrec UnindexedFace
-> ReadPrec [UnindexedFace]
-> Read UnindexedFace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnindexedFace]
$creadListPrec :: ReadPrec [UnindexedFace]
readPrec :: ReadPrec UnindexedFace
$creadPrec :: ReadPrec UnindexedFace
readList :: ReadS [UnindexedFace]
$creadList :: ReadS [UnindexedFace]
readsPrec :: Int -> ReadS UnindexedFace
$creadsPrec :: Int -> ReadS UnindexedFace
Prelude.Read, Int -> UnindexedFace -> ShowS
[UnindexedFace] -> ShowS
UnindexedFace -> String
(Int -> UnindexedFace -> ShowS)
-> (UnindexedFace -> String)
-> ([UnindexedFace] -> ShowS)
-> Show UnindexedFace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnindexedFace] -> ShowS
$cshowList :: [UnindexedFace] -> ShowS
show :: UnindexedFace -> String
$cshow :: UnindexedFace -> String
showsPrec :: Int -> UnindexedFace -> ShowS
$cshowsPrec :: Int -> UnindexedFace -> ShowS
Prelude.Show, (forall x. UnindexedFace -> Rep UnindexedFace x)
-> (forall x. Rep UnindexedFace x -> UnindexedFace)
-> Generic UnindexedFace
forall x. Rep UnindexedFace x -> UnindexedFace
forall x. UnindexedFace -> Rep UnindexedFace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnindexedFace x -> UnindexedFace
$cfrom :: forall x. UnindexedFace -> Rep UnindexedFace x
Prelude.Generic)
newUnindexedFace ::
UnindexedFace
newUnindexedFace :: UnindexedFace
newUnindexedFace =
UnindexedFace' :: Maybe [Reason] -> Maybe FaceDetail -> UnindexedFace
UnindexedFace'
{ $sel:reasons:UnindexedFace' :: Maybe [Reason]
reasons = Maybe [Reason]
forall a. Maybe a
Prelude.Nothing,
$sel:faceDetail:UnindexedFace' :: Maybe FaceDetail
faceDetail = Maybe FaceDetail
forall a. Maybe a
Prelude.Nothing
}
unindexedFace_reasons :: Lens.Lens' UnindexedFace (Prelude.Maybe [Reason])
unindexedFace_reasons :: (Maybe [Reason] -> f (Maybe [Reason]))
-> UnindexedFace -> f UnindexedFace
unindexedFace_reasons = (UnindexedFace -> Maybe [Reason])
-> (UnindexedFace -> Maybe [Reason] -> UnindexedFace)
-> Lens
UnindexedFace UnindexedFace (Maybe [Reason]) (Maybe [Reason])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnindexedFace' {Maybe [Reason]
reasons :: Maybe [Reason]
$sel:reasons:UnindexedFace' :: UnindexedFace -> Maybe [Reason]
reasons} -> Maybe [Reason]
reasons) (\s :: UnindexedFace
s@UnindexedFace' {} Maybe [Reason]
a -> UnindexedFace
s {$sel:reasons:UnindexedFace' :: Maybe [Reason]
reasons = Maybe [Reason]
a} :: UnindexedFace) ((Maybe [Reason] -> f (Maybe [Reason]))
-> UnindexedFace -> f UnindexedFace)
-> ((Maybe [Reason] -> f (Maybe [Reason]))
-> Maybe [Reason] -> f (Maybe [Reason]))
-> (Maybe [Reason] -> f (Maybe [Reason]))
-> UnindexedFace
-> f UnindexedFace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Reason] [Reason] [Reason] [Reason]
-> Iso
(Maybe [Reason]) (Maybe [Reason]) (Maybe [Reason]) (Maybe [Reason])
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 [Reason] [Reason] [Reason] [Reason]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
unindexedFace_faceDetail :: Lens.Lens' UnindexedFace (Prelude.Maybe FaceDetail)
unindexedFace_faceDetail :: (Maybe FaceDetail -> f (Maybe FaceDetail))
-> UnindexedFace -> f UnindexedFace
unindexedFace_faceDetail = (UnindexedFace -> Maybe FaceDetail)
-> (UnindexedFace -> Maybe FaceDetail -> UnindexedFace)
-> Lens
UnindexedFace UnindexedFace (Maybe FaceDetail) (Maybe FaceDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnindexedFace' {Maybe FaceDetail
faceDetail :: Maybe FaceDetail
$sel:faceDetail:UnindexedFace' :: UnindexedFace -> Maybe FaceDetail
faceDetail} -> Maybe FaceDetail
faceDetail) (\s :: UnindexedFace
s@UnindexedFace' {} Maybe FaceDetail
a -> UnindexedFace
s {$sel:faceDetail:UnindexedFace' :: Maybe FaceDetail
faceDetail = Maybe FaceDetail
a} :: UnindexedFace)
instance Core.FromJSON UnindexedFace where
parseJSON :: Value -> Parser UnindexedFace
parseJSON =
String
-> (Object -> Parser UnindexedFace)
-> Value
-> Parser UnindexedFace
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UnindexedFace"
( \Object
x ->
Maybe [Reason] -> Maybe FaceDetail -> UnindexedFace
UnindexedFace'
(Maybe [Reason] -> Maybe FaceDetail -> UnindexedFace)
-> Parser (Maybe [Reason])
-> Parser (Maybe FaceDetail -> UnindexedFace)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Reason]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reasons" Parser (Maybe (Maybe [Reason]))
-> Maybe [Reason] -> Parser (Maybe [Reason])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Reason]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe FaceDetail -> UnindexedFace)
-> Parser (Maybe FaceDetail) -> Parser UnindexedFace
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
"FaceDetail")
)
instance Prelude.Hashable UnindexedFace
instance Prelude.NFData UnindexedFace