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