{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Label
data LabelDetection = LabelDetection'
{
LabelDetection -> Maybe Natural
durationMillis :: Prelude.Maybe Prelude.Natural,
LabelDetection -> Maybe Natural
endTimestampMillis :: Prelude.Maybe Prelude.Natural,
LabelDetection -> Maybe Label
label :: Prelude.Maybe Label,
LabelDetection -> Maybe Natural
startTimestampMillis :: Prelude.Maybe Prelude.Natural,
LabelDetection -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer
}
deriving (LabelDetection -> LabelDetection -> Bool
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]
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
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. 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'
{ $sel:durationMillis:LabelDetection' :: Maybe Natural
durationMillis = forall a. Maybe a
Prelude.Nothing,
$sel:endTimestampMillis:LabelDetection' :: Maybe Natural
endTimestampMillis = forall a. Maybe a
Prelude.Nothing,
$sel:label:LabelDetection' :: Maybe Label
label = forall a. Maybe a
Prelude.Nothing,
$sel:startTimestampMillis:LabelDetection' :: Maybe Natural
startTimestampMillis = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:LabelDetection' :: Maybe Integer
timestamp = forall a. Maybe a
Prelude.Nothing
}
labelDetection_durationMillis :: Lens.Lens' LabelDetection (Prelude.Maybe Prelude.Natural)
labelDetection_durationMillis :: Lens' LabelDetection (Maybe Natural)
labelDetection_durationMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelDetection' {Maybe Natural
durationMillis :: Maybe Natural
$sel:durationMillis:LabelDetection' :: LabelDetection -> Maybe Natural
durationMillis} -> Maybe Natural
durationMillis) (\s :: LabelDetection
s@LabelDetection' {} Maybe Natural
a -> LabelDetection
s {$sel:durationMillis:LabelDetection' :: Maybe Natural
durationMillis = Maybe Natural
a} :: LabelDetection)
labelDetection_endTimestampMillis :: Lens.Lens' LabelDetection (Prelude.Maybe Prelude.Natural)
labelDetection_endTimestampMillis :: Lens' LabelDetection (Maybe Natural)
labelDetection_endTimestampMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelDetection' {Maybe Natural
endTimestampMillis :: Maybe Natural
$sel:endTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
endTimestampMillis} -> Maybe Natural
endTimestampMillis) (\s :: LabelDetection
s@LabelDetection' {} Maybe Natural
a -> LabelDetection
s {$sel:endTimestampMillis:LabelDetection' :: Maybe Natural
endTimestampMillis = Maybe Natural
a} :: LabelDetection)
labelDetection_label :: Lens.Lens' LabelDetection (Prelude.Maybe Label)
labelDetection_label :: Lens' LabelDetection (Maybe Label)
labelDetection_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_startTimestampMillis :: Lens.Lens' LabelDetection (Prelude.Maybe Prelude.Natural)
labelDetection_startTimestampMillis :: Lens' LabelDetection (Maybe Natural)
labelDetection_startTimestampMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelDetection' {Maybe Natural
startTimestampMillis :: Maybe Natural
$sel:startTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
startTimestampMillis} -> Maybe Natural
startTimestampMillis) (\s :: LabelDetection
s@LabelDetection' {} Maybe Natural
a -> LabelDetection
s {$sel:startTimestampMillis:LabelDetection' :: Maybe Natural
startTimestampMillis = Maybe Natural
a} :: LabelDetection)
labelDetection_timestamp :: Lens.Lens' LabelDetection (Prelude.Maybe Prelude.Integer)
labelDetection_timestamp :: Lens' LabelDetection (Maybe Integer)
labelDetection_timestamp = 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 Data.FromJSON LabelDetection where
parseJSON :: Value -> Parser LabelDetection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LabelDetection"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Label
-> Maybe Natural
-> Maybe Integer
-> LabelDetection
LabelDetection'
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
"DurationMillis")
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
"EndTimestampMillis")
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
"Label")
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
"StartTimestampMillis")
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
"Timestamp")
)
instance Prelude.Hashable LabelDetection where
hashWithSalt :: Int -> LabelDetection -> Int
hashWithSalt Int
_salt LabelDetection' {Maybe Integer
Maybe Natural
Maybe Label
timestamp :: Maybe Integer
startTimestampMillis :: Maybe Natural
label :: Maybe Label
endTimestampMillis :: Maybe Natural
durationMillis :: Maybe Natural
$sel:timestamp:LabelDetection' :: LabelDetection -> Maybe Integer
$sel:startTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
$sel:label:LabelDetection' :: LabelDetection -> Maybe Label
$sel:endTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
$sel:durationMillis:LabelDetection' :: LabelDetection -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
durationMillis
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
endTimestampMillis
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Label
label
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
startTimestampMillis
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
timestamp
instance Prelude.NFData LabelDetection where
rnf :: LabelDetection -> ()
rnf LabelDetection' {Maybe Integer
Maybe Natural
Maybe Label
timestamp :: Maybe Integer
startTimestampMillis :: Maybe Natural
label :: Maybe Label
endTimestampMillis :: Maybe Natural
durationMillis :: Maybe Natural
$sel:timestamp:LabelDetection' :: LabelDetection -> Maybe Integer
$sel:startTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
$sel:label:LabelDetection' :: LabelDetection -> Maybe Label
$sel:endTimestampMillis:LabelDetection' :: LabelDetection -> Maybe Natural
$sel:durationMillis:LabelDetection' :: LabelDetection -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
durationMillis
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
endTimestampMillis
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Label
label
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
startTimestampMillis
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
timestamp