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