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