{-# 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.IoTEventsData.Types.DetectorSummary where
import qualified Amazonka.Core as Core
import Amazonka.IoTEventsData.Types.DetectorStateSummary
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DetectorSummary = DetectorSummary'
{
DetectorSummary -> Maybe Text
keyValue :: Prelude.Maybe Prelude.Text,
DetectorSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
DetectorSummary -> Maybe DetectorStateSummary
state :: Prelude.Maybe DetectorStateSummary,
DetectorSummary -> Maybe Text
detectorModelName :: Prelude.Maybe Prelude.Text,
DetectorSummary -> Maybe Text
detectorModelVersion :: Prelude.Maybe Prelude.Text,
DetectorSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
}
deriving (DetectorSummary -> DetectorSummary -> Bool
(DetectorSummary -> DetectorSummary -> Bool)
-> (DetectorSummary -> DetectorSummary -> Bool)
-> Eq DetectorSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectorSummary -> DetectorSummary -> Bool
$c/= :: DetectorSummary -> DetectorSummary -> Bool
== :: DetectorSummary -> DetectorSummary -> Bool
$c== :: DetectorSummary -> DetectorSummary -> Bool
Prelude.Eq, ReadPrec [DetectorSummary]
ReadPrec DetectorSummary
Int -> ReadS DetectorSummary
ReadS [DetectorSummary]
(Int -> ReadS DetectorSummary)
-> ReadS [DetectorSummary]
-> ReadPrec DetectorSummary
-> ReadPrec [DetectorSummary]
-> Read DetectorSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectorSummary]
$creadListPrec :: ReadPrec [DetectorSummary]
readPrec :: ReadPrec DetectorSummary
$creadPrec :: ReadPrec DetectorSummary
readList :: ReadS [DetectorSummary]
$creadList :: ReadS [DetectorSummary]
readsPrec :: Int -> ReadS DetectorSummary
$creadsPrec :: Int -> ReadS DetectorSummary
Prelude.Read, Int -> DetectorSummary -> ShowS
[DetectorSummary] -> ShowS
DetectorSummary -> String
(Int -> DetectorSummary -> ShowS)
-> (DetectorSummary -> String)
-> ([DetectorSummary] -> ShowS)
-> Show DetectorSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectorSummary] -> ShowS
$cshowList :: [DetectorSummary] -> ShowS
show :: DetectorSummary -> String
$cshow :: DetectorSummary -> String
showsPrec :: Int -> DetectorSummary -> ShowS
$cshowsPrec :: Int -> DetectorSummary -> ShowS
Prelude.Show, (forall x. DetectorSummary -> Rep DetectorSummary x)
-> (forall x. Rep DetectorSummary x -> DetectorSummary)
-> Generic DetectorSummary
forall x. Rep DetectorSummary x -> DetectorSummary
forall x. DetectorSummary -> Rep DetectorSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectorSummary x -> DetectorSummary
$cfrom :: forall x. DetectorSummary -> Rep DetectorSummary x
Prelude.Generic)
newDetectorSummary ::
DetectorSummary
newDetectorSummary :: DetectorSummary
newDetectorSummary =
DetectorSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe DetectorStateSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> DetectorSummary
DetectorSummary'
{ $sel:keyValue:DetectorSummary' :: Maybe Text
keyValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:DetectorSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:state:DetectorSummary' :: Maybe DetectorStateSummary
state = Maybe DetectorStateSummary
forall a. Maybe a
Prelude.Nothing,
$sel:detectorModelName:DetectorSummary' :: Maybe Text
detectorModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:detectorModelVersion:DetectorSummary' :: Maybe Text
detectorModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:DetectorSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
detectorSummary_keyValue :: Lens.Lens' DetectorSummary (Prelude.Maybe Prelude.Text)
detectorSummary_keyValue :: (Maybe Text -> f (Maybe Text))
-> DetectorSummary -> f DetectorSummary
detectorSummary_keyValue = (DetectorSummary -> Maybe Text)
-> (DetectorSummary -> Maybe Text -> DetectorSummary)
-> Lens DetectorSummary DetectorSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:DetectorSummary' :: DetectorSummary -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe Text
a -> DetectorSummary
s {$sel:keyValue:DetectorSummary' :: Maybe Text
keyValue = Maybe Text
a} :: DetectorSummary)
detectorSummary_creationTime :: Lens.Lens' DetectorSummary (Prelude.Maybe Prelude.UTCTime)
detectorSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectorSummary -> f DetectorSummary
detectorSummary_creationTime = (DetectorSummary -> Maybe POSIX)
-> (DetectorSummary -> Maybe POSIX -> DetectorSummary)
-> Lens DetectorSummary DetectorSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DetectorSummary' :: DetectorSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe POSIX
a -> DetectorSummary
s {$sel:creationTime:DetectorSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DetectorSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> DetectorSummary -> f DetectorSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectorSummary
-> f DetectorSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
detectorSummary_state :: Lens.Lens' DetectorSummary (Prelude.Maybe DetectorStateSummary)
detectorSummary_state :: (Maybe DetectorStateSummary -> f (Maybe DetectorStateSummary))
-> DetectorSummary -> f DetectorSummary
detectorSummary_state = (DetectorSummary -> Maybe DetectorStateSummary)
-> (DetectorSummary
-> Maybe DetectorStateSummary -> DetectorSummary)
-> Lens
DetectorSummary
DetectorSummary
(Maybe DetectorStateSummary)
(Maybe DetectorStateSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe DetectorStateSummary
state :: Maybe DetectorStateSummary
$sel:state:DetectorSummary' :: DetectorSummary -> Maybe DetectorStateSummary
state} -> Maybe DetectorStateSummary
state) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe DetectorStateSummary
a -> DetectorSummary
s {$sel:state:DetectorSummary' :: Maybe DetectorStateSummary
state = Maybe DetectorStateSummary
a} :: DetectorSummary)
detectorSummary_detectorModelName :: Lens.Lens' DetectorSummary (Prelude.Maybe Prelude.Text)
detectorSummary_detectorModelName :: (Maybe Text -> f (Maybe Text))
-> DetectorSummary -> f DetectorSummary
detectorSummary_detectorModelName = (DetectorSummary -> Maybe Text)
-> (DetectorSummary -> Maybe Text -> DetectorSummary)
-> Lens DetectorSummary DetectorSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe Text
detectorModelName :: Maybe Text
$sel:detectorModelName:DetectorSummary' :: DetectorSummary -> Maybe Text
detectorModelName} -> Maybe Text
detectorModelName) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe Text
a -> DetectorSummary
s {$sel:detectorModelName:DetectorSummary' :: Maybe Text
detectorModelName = Maybe Text
a} :: DetectorSummary)
detectorSummary_detectorModelVersion :: Lens.Lens' DetectorSummary (Prelude.Maybe Prelude.Text)
detectorSummary_detectorModelVersion :: (Maybe Text -> f (Maybe Text))
-> DetectorSummary -> f DetectorSummary
detectorSummary_detectorModelVersion = (DetectorSummary -> Maybe Text)
-> (DetectorSummary -> Maybe Text -> DetectorSummary)
-> Lens DetectorSummary DetectorSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe Text
detectorModelVersion :: Maybe Text
$sel:detectorModelVersion:DetectorSummary' :: DetectorSummary -> Maybe Text
detectorModelVersion} -> Maybe Text
detectorModelVersion) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe Text
a -> DetectorSummary
s {$sel:detectorModelVersion:DetectorSummary' :: Maybe Text
detectorModelVersion = Maybe Text
a} :: DetectorSummary)
detectorSummary_lastUpdateTime :: Lens.Lens' DetectorSummary (Prelude.Maybe Prelude.UTCTime)
detectorSummary_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectorSummary -> f DetectorSummary
detectorSummary_lastUpdateTime = (DetectorSummary -> Maybe POSIX)
-> (DetectorSummary -> Maybe POSIX -> DetectorSummary)
-> Lens DetectorSummary DetectorSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:DetectorSummary' :: DetectorSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: DetectorSummary
s@DetectorSummary' {} Maybe POSIX
a -> DetectorSummary
s {$sel:lastUpdateTime:DetectorSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: DetectorSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> DetectorSummary -> f DetectorSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DetectorSummary
-> f DetectorSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON DetectorSummary where
parseJSON :: Value -> Parser DetectorSummary
parseJSON =
String
-> (Object -> Parser DetectorSummary)
-> Value
-> Parser DetectorSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DetectorSummary"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe DetectorStateSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> DetectorSummary
DetectorSummary'
(Maybe Text
-> Maybe POSIX
-> Maybe DetectorStateSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> DetectorSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe DetectorStateSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> DetectorSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"keyValue")
Parser
(Maybe POSIX
-> Maybe DetectorStateSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> DetectorSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe DetectorStateSummary
-> Maybe Text -> Maybe Text -> Maybe POSIX -> DetectorSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
Parser
(Maybe DetectorStateSummary
-> Maybe Text -> Maybe Text -> Maybe POSIX -> DetectorSummary)
-> Parser (Maybe DetectorStateSummary)
-> Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> DetectorSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DetectorStateSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> DetectorSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> DetectorSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"detectorModelName")
Parser (Maybe Text -> Maybe POSIX -> DetectorSummary)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> DetectorSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"detectorModelVersion")
Parser (Maybe POSIX -> DetectorSummary)
-> Parser (Maybe POSIX) -> Parser DetectorSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
)
instance Prelude.Hashable DetectorSummary
instance Prelude.NFData DetectorSummary