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