{-# 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.Synthetics.Types.CanaryTimeline where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CanaryTimeline = CanaryTimeline'
{
CanaryTimeline -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
CanaryTimeline -> Maybe POSIX
lastStarted :: Prelude.Maybe Core.POSIX,
CanaryTimeline -> Maybe POSIX
lastStopped :: Prelude.Maybe Core.POSIX,
CanaryTimeline -> Maybe POSIX
lastModified :: Prelude.Maybe Core.POSIX
}
deriving (CanaryTimeline -> CanaryTimeline -> Bool
(CanaryTimeline -> CanaryTimeline -> Bool)
-> (CanaryTimeline -> CanaryTimeline -> Bool) -> Eq CanaryTimeline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CanaryTimeline -> CanaryTimeline -> Bool
$c/= :: CanaryTimeline -> CanaryTimeline -> Bool
== :: CanaryTimeline -> CanaryTimeline -> Bool
$c== :: CanaryTimeline -> CanaryTimeline -> Bool
Prelude.Eq, ReadPrec [CanaryTimeline]
ReadPrec CanaryTimeline
Int -> ReadS CanaryTimeline
ReadS [CanaryTimeline]
(Int -> ReadS CanaryTimeline)
-> ReadS [CanaryTimeline]
-> ReadPrec CanaryTimeline
-> ReadPrec [CanaryTimeline]
-> Read CanaryTimeline
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CanaryTimeline]
$creadListPrec :: ReadPrec [CanaryTimeline]
readPrec :: ReadPrec CanaryTimeline
$creadPrec :: ReadPrec CanaryTimeline
readList :: ReadS [CanaryTimeline]
$creadList :: ReadS [CanaryTimeline]
readsPrec :: Int -> ReadS CanaryTimeline
$creadsPrec :: Int -> ReadS CanaryTimeline
Prelude.Read, Int -> CanaryTimeline -> ShowS
[CanaryTimeline] -> ShowS
CanaryTimeline -> String
(Int -> CanaryTimeline -> ShowS)
-> (CanaryTimeline -> String)
-> ([CanaryTimeline] -> ShowS)
-> Show CanaryTimeline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CanaryTimeline] -> ShowS
$cshowList :: [CanaryTimeline] -> ShowS
show :: CanaryTimeline -> String
$cshow :: CanaryTimeline -> String
showsPrec :: Int -> CanaryTimeline -> ShowS
$cshowsPrec :: Int -> CanaryTimeline -> ShowS
Prelude.Show, (forall x. CanaryTimeline -> Rep CanaryTimeline x)
-> (forall x. Rep CanaryTimeline x -> CanaryTimeline)
-> Generic CanaryTimeline
forall x. Rep CanaryTimeline x -> CanaryTimeline
forall x. CanaryTimeline -> Rep CanaryTimeline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CanaryTimeline x -> CanaryTimeline
$cfrom :: forall x. CanaryTimeline -> Rep CanaryTimeline x
Prelude.Generic)
newCanaryTimeline ::
CanaryTimeline
newCanaryTimeline :: CanaryTimeline
newCanaryTimeline =
CanaryTimeline' :: Maybe POSIX
-> Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> CanaryTimeline
CanaryTimeline'
{ $sel:created:CanaryTimeline' :: Maybe POSIX
created = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastStarted:CanaryTimeline' :: Maybe POSIX
lastStarted = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastStopped:CanaryTimeline' :: Maybe POSIX
lastStopped = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastModified:CanaryTimeline' :: Maybe POSIX
lastModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
canaryTimeline_created :: Lens.Lens' CanaryTimeline (Prelude.Maybe Prelude.UTCTime)
canaryTimeline_created :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline -> f CanaryTimeline
canaryTimeline_created = (CanaryTimeline -> Maybe POSIX)
-> (CanaryTimeline -> Maybe POSIX -> CanaryTimeline)
-> Lens CanaryTimeline CanaryTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryTimeline' {Maybe POSIX
created :: Maybe POSIX
$sel:created:CanaryTimeline' :: CanaryTimeline -> Maybe POSIX
created} -> Maybe POSIX
created) (\s :: CanaryTimeline
s@CanaryTimeline' {} Maybe POSIX
a -> CanaryTimeline
s {$sel:created:CanaryTimeline' :: Maybe POSIX
created = Maybe POSIX
a} :: CanaryTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> CanaryTimeline -> f CanaryTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline
-> f CanaryTimeline
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
canaryTimeline_lastStarted :: Lens.Lens' CanaryTimeline (Prelude.Maybe Prelude.UTCTime)
canaryTimeline_lastStarted :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline -> f CanaryTimeline
canaryTimeline_lastStarted = (CanaryTimeline -> Maybe POSIX)
-> (CanaryTimeline -> Maybe POSIX -> CanaryTimeline)
-> Lens CanaryTimeline CanaryTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryTimeline' {Maybe POSIX
lastStarted :: Maybe POSIX
$sel:lastStarted:CanaryTimeline' :: CanaryTimeline -> Maybe POSIX
lastStarted} -> Maybe POSIX
lastStarted) (\s :: CanaryTimeline
s@CanaryTimeline' {} Maybe POSIX
a -> CanaryTimeline
s {$sel:lastStarted:CanaryTimeline' :: Maybe POSIX
lastStarted = Maybe POSIX
a} :: CanaryTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> CanaryTimeline -> f CanaryTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline
-> f CanaryTimeline
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
canaryTimeline_lastStopped :: Lens.Lens' CanaryTimeline (Prelude.Maybe Prelude.UTCTime)
canaryTimeline_lastStopped :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline -> f CanaryTimeline
canaryTimeline_lastStopped = (CanaryTimeline -> Maybe POSIX)
-> (CanaryTimeline -> Maybe POSIX -> CanaryTimeline)
-> Lens CanaryTimeline CanaryTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryTimeline' {Maybe POSIX
lastStopped :: Maybe POSIX
$sel:lastStopped:CanaryTimeline' :: CanaryTimeline -> Maybe POSIX
lastStopped} -> Maybe POSIX
lastStopped) (\s :: CanaryTimeline
s@CanaryTimeline' {} Maybe POSIX
a -> CanaryTimeline
s {$sel:lastStopped:CanaryTimeline' :: Maybe POSIX
lastStopped = Maybe POSIX
a} :: CanaryTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> CanaryTimeline -> f CanaryTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline
-> f CanaryTimeline
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
canaryTimeline_lastModified :: Lens.Lens' CanaryTimeline (Prelude.Maybe Prelude.UTCTime)
canaryTimeline_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline -> f CanaryTimeline
canaryTimeline_lastModified = (CanaryTimeline -> Maybe POSIX)
-> (CanaryTimeline -> Maybe POSIX -> CanaryTimeline)
-> Lens CanaryTimeline CanaryTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryTimeline' {Maybe POSIX
lastModified :: Maybe POSIX
$sel:lastModified:CanaryTimeline' :: CanaryTimeline -> Maybe POSIX
lastModified} -> Maybe POSIX
lastModified) (\s :: CanaryTimeline
s@CanaryTimeline' {} Maybe POSIX
a -> CanaryTimeline
s {$sel:lastModified:CanaryTimeline' :: Maybe POSIX
lastModified = Maybe POSIX
a} :: CanaryTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> CanaryTimeline -> f CanaryTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CanaryTimeline
-> f CanaryTimeline
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 CanaryTimeline where
parseJSON :: Value -> Parser CanaryTimeline
parseJSON =
String
-> (Object -> Parser CanaryTimeline)
-> Value
-> Parser CanaryTimeline
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CanaryTimeline"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> CanaryTimeline
CanaryTimeline'
(Maybe POSIX
-> Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> CanaryTimeline)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> CanaryTimeline)
forall (f :: * -> *) a b. Functor 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
"Created")
Parser
(Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> CanaryTimeline)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe POSIX -> CanaryTimeline)
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
"LastStarted")
Parser (Maybe POSIX -> Maybe POSIX -> CanaryTimeline)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> CanaryTimeline)
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
"LastStopped")
Parser (Maybe POSIX -> CanaryTimeline)
-> Parser (Maybe POSIX) -> Parser CanaryTimeline
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
"LastModified")
)
instance Prelude.Hashable CanaryTimeline
instance Prelude.NFData CanaryTimeline