{-# 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.CloudWatchEvents.Types.Replay where
import Amazonka.CloudWatchEvents.Types.ReplayState
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Replay = Replay'
{
Replay -> Maybe Text
eventSourceArn :: Prelude.Maybe Prelude.Text,
Replay -> Maybe ReplayState
state :: Prelude.Maybe ReplayState,
Replay -> Maybe POSIX
eventEndTime :: Prelude.Maybe Core.POSIX,
Replay -> Maybe POSIX
replayStartTime :: Prelude.Maybe Core.POSIX,
Replay -> Maybe POSIX
replayEndTime :: Prelude.Maybe Core.POSIX,
Replay -> Maybe POSIX
eventLastReplayedTime :: Prelude.Maybe Core.POSIX,
Replay -> Maybe POSIX
eventStartTime :: Prelude.Maybe Core.POSIX,
Replay -> Maybe Text
replayName :: Prelude.Maybe Prelude.Text,
Replay -> Maybe Text
stateReason :: Prelude.Maybe Prelude.Text
}
deriving (Replay -> Replay -> Bool
(Replay -> Replay -> Bool)
-> (Replay -> Replay -> Bool) -> Eq Replay
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Replay -> Replay -> Bool
$c/= :: Replay -> Replay -> Bool
== :: Replay -> Replay -> Bool
$c== :: Replay -> Replay -> Bool
Prelude.Eq, ReadPrec [Replay]
ReadPrec Replay
Int -> ReadS Replay
ReadS [Replay]
(Int -> ReadS Replay)
-> ReadS [Replay]
-> ReadPrec Replay
-> ReadPrec [Replay]
-> Read Replay
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Replay]
$creadListPrec :: ReadPrec [Replay]
readPrec :: ReadPrec Replay
$creadPrec :: ReadPrec Replay
readList :: ReadS [Replay]
$creadList :: ReadS [Replay]
readsPrec :: Int -> ReadS Replay
$creadsPrec :: Int -> ReadS Replay
Prelude.Read, Int -> Replay -> ShowS
[Replay] -> ShowS
Replay -> String
(Int -> Replay -> ShowS)
-> (Replay -> String) -> ([Replay] -> ShowS) -> Show Replay
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Replay] -> ShowS
$cshowList :: [Replay] -> ShowS
show :: Replay -> String
$cshow :: Replay -> String
showsPrec :: Int -> Replay -> ShowS
$cshowsPrec :: Int -> Replay -> ShowS
Prelude.Show, (forall x. Replay -> Rep Replay x)
-> (forall x. Rep Replay x -> Replay) -> Generic Replay
forall x. Rep Replay x -> Replay
forall x. Replay -> Rep Replay x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Replay x -> Replay
$cfrom :: forall x. Replay -> Rep Replay x
Prelude.Generic)
newReplay ::
Replay
newReplay :: Replay
newReplay =
Replay' :: Maybe Text
-> Maybe ReplayState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay
Replay'
{ $sel:eventSourceArn:Replay' :: Maybe Text
eventSourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:state:Replay' :: Maybe ReplayState
state = Maybe ReplayState
forall a. Maybe a
Prelude.Nothing,
$sel:eventEndTime:Replay' :: Maybe POSIX
eventEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:replayStartTime:Replay' :: Maybe POSIX
replayStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:replayEndTime:Replay' :: Maybe POSIX
replayEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:eventLastReplayedTime:Replay' :: Maybe POSIX
eventLastReplayedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:eventStartTime:Replay' :: Maybe POSIX
eventStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:replayName:Replay' :: Maybe Text
replayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stateReason:Replay' :: Maybe Text
stateReason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
replay_eventSourceArn :: Lens.Lens' Replay (Prelude.Maybe Prelude.Text)
replay_eventSourceArn :: (Maybe Text -> f (Maybe Text)) -> Replay -> f Replay
replay_eventSourceArn = (Replay -> Maybe Text)
-> (Replay -> Maybe Text -> Replay)
-> Lens Replay Replay (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe Text
eventSourceArn :: Maybe Text
$sel:eventSourceArn:Replay' :: Replay -> Maybe Text
eventSourceArn} -> Maybe Text
eventSourceArn) (\s :: Replay
s@Replay' {} Maybe Text
a -> Replay
s {$sel:eventSourceArn:Replay' :: Maybe Text
eventSourceArn = Maybe Text
a} :: Replay)
replay_state :: Lens.Lens' Replay (Prelude.Maybe ReplayState)
replay_state :: (Maybe ReplayState -> f (Maybe ReplayState)) -> Replay -> f Replay
replay_state = (Replay -> Maybe ReplayState)
-> (Replay -> Maybe ReplayState -> Replay)
-> Lens Replay Replay (Maybe ReplayState) (Maybe ReplayState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe ReplayState
state :: Maybe ReplayState
$sel:state:Replay' :: Replay -> Maybe ReplayState
state} -> Maybe ReplayState
state) (\s :: Replay
s@Replay' {} Maybe ReplayState
a -> Replay
s {$sel:state:Replay' :: Maybe ReplayState
state = Maybe ReplayState
a} :: Replay)
replay_eventEndTime :: Lens.Lens' Replay (Prelude.Maybe Prelude.UTCTime)
replay_eventEndTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Replay -> f Replay
replay_eventEndTime = (Replay -> Maybe POSIX)
-> (Replay -> Maybe POSIX -> Replay)
-> Lens Replay Replay (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe POSIX
eventEndTime :: Maybe POSIX
$sel:eventEndTime:Replay' :: Replay -> Maybe POSIX
eventEndTime} -> Maybe POSIX
eventEndTime) (\s :: Replay
s@Replay' {} Maybe POSIX
a -> Replay
s {$sel:eventEndTime:Replay' :: Maybe POSIX
eventEndTime = Maybe POSIX
a} :: Replay) ((Maybe POSIX -> f (Maybe POSIX)) -> Replay -> f Replay)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Replay
-> f Replay
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
replay_replayStartTime :: Lens.Lens' Replay (Prelude.Maybe Prelude.UTCTime)
replay_replayStartTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Replay -> f Replay
replay_replayStartTime = (Replay -> Maybe POSIX)
-> (Replay -> Maybe POSIX -> Replay)
-> Lens Replay Replay (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe POSIX
replayStartTime :: Maybe POSIX
$sel:replayStartTime:Replay' :: Replay -> Maybe POSIX
replayStartTime} -> Maybe POSIX
replayStartTime) (\s :: Replay
s@Replay' {} Maybe POSIX
a -> Replay
s {$sel:replayStartTime:Replay' :: Maybe POSIX
replayStartTime = Maybe POSIX
a} :: Replay) ((Maybe POSIX -> f (Maybe POSIX)) -> Replay -> f Replay)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Replay
-> f Replay
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
replay_replayEndTime :: Lens.Lens' Replay (Prelude.Maybe Prelude.UTCTime)
replay_replayEndTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Replay -> f Replay
replay_replayEndTime = (Replay -> Maybe POSIX)
-> (Replay -> Maybe POSIX -> Replay)
-> Lens Replay Replay (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe POSIX
replayEndTime :: Maybe POSIX
$sel:replayEndTime:Replay' :: Replay -> Maybe POSIX
replayEndTime} -> Maybe POSIX
replayEndTime) (\s :: Replay
s@Replay' {} Maybe POSIX
a -> Replay
s {$sel:replayEndTime:Replay' :: Maybe POSIX
replayEndTime = Maybe POSIX
a} :: Replay) ((Maybe POSIX -> f (Maybe POSIX)) -> Replay -> f Replay)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Replay
-> f Replay
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
replay_eventLastReplayedTime :: Lens.Lens' Replay (Prelude.Maybe Prelude.UTCTime)
replay_eventLastReplayedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Replay -> f Replay
replay_eventLastReplayedTime = (Replay -> Maybe POSIX)
-> (Replay -> Maybe POSIX -> Replay)
-> Lens Replay Replay (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe POSIX
eventLastReplayedTime :: Maybe POSIX
$sel:eventLastReplayedTime:Replay' :: Replay -> Maybe POSIX
eventLastReplayedTime} -> Maybe POSIX
eventLastReplayedTime) (\s :: Replay
s@Replay' {} Maybe POSIX
a -> Replay
s {$sel:eventLastReplayedTime:Replay' :: Maybe POSIX
eventLastReplayedTime = Maybe POSIX
a} :: Replay) ((Maybe POSIX -> f (Maybe POSIX)) -> Replay -> f Replay)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Replay
-> f Replay
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
replay_eventStartTime :: Lens.Lens' Replay (Prelude.Maybe Prelude.UTCTime)
replay_eventStartTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Replay -> f Replay
replay_eventStartTime = (Replay -> Maybe POSIX)
-> (Replay -> Maybe POSIX -> Replay)
-> Lens Replay Replay (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe POSIX
eventStartTime :: Maybe POSIX
$sel:eventStartTime:Replay' :: Replay -> Maybe POSIX
eventStartTime} -> Maybe POSIX
eventStartTime) (\s :: Replay
s@Replay' {} Maybe POSIX
a -> Replay
s {$sel:eventStartTime:Replay' :: Maybe POSIX
eventStartTime = Maybe POSIX
a} :: Replay) ((Maybe POSIX -> f (Maybe POSIX)) -> Replay -> f Replay)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Replay
-> f Replay
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
replay_replayName :: Lens.Lens' Replay (Prelude.Maybe Prelude.Text)
replay_replayName :: (Maybe Text -> f (Maybe Text)) -> Replay -> f Replay
replay_replayName = (Replay -> Maybe Text)
-> (Replay -> Maybe Text -> Replay)
-> Lens Replay Replay (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe Text
replayName :: Maybe Text
$sel:replayName:Replay' :: Replay -> Maybe Text
replayName} -> Maybe Text
replayName) (\s :: Replay
s@Replay' {} Maybe Text
a -> Replay
s {$sel:replayName:Replay' :: Maybe Text
replayName = Maybe Text
a} :: Replay)
replay_stateReason :: Lens.Lens' Replay (Prelude.Maybe Prelude.Text)
replay_stateReason :: (Maybe Text -> f (Maybe Text)) -> Replay -> f Replay
replay_stateReason = (Replay -> Maybe Text)
-> (Replay -> Maybe Text -> Replay)
-> Lens Replay Replay (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Replay' {Maybe Text
stateReason :: Maybe Text
$sel:stateReason:Replay' :: Replay -> Maybe Text
stateReason} -> Maybe Text
stateReason) (\s :: Replay
s@Replay' {} Maybe Text
a -> Replay
s {$sel:stateReason:Replay' :: Maybe Text
stateReason = Maybe Text
a} :: Replay)
instance Core.FromJSON Replay where
parseJSON :: Value -> Parser Replay
parseJSON =
String -> (Object -> Parser Replay) -> Value -> Parser Replay
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Replay"
( \Object
x ->
Maybe Text
-> Maybe ReplayState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay
Replay'
(Maybe Text
-> Maybe ReplayState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
-> Parser (Maybe Text)
-> Parser
(Maybe ReplayState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
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
"EventSourceArn")
Parser
(Maybe ReplayState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
-> Parser (Maybe ReplayState)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplayState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
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
"EventEndTime")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
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
"ReplayStartTime")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Replay)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX -> Maybe POSIX -> Maybe Text -> Maybe Text -> Replay)
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
"ReplayEndTime")
Parser
(Maybe POSIX -> Maybe POSIX -> Maybe Text -> Maybe Text -> Replay)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Replay)
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
"EventLastReplayedTime")
Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Replay)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Replay)
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
"EventStartTime")
Parser (Maybe Text -> Maybe Text -> Replay)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Replay)
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
"ReplayName")
Parser (Maybe Text -> Replay)
-> Parser (Maybe Text) -> Parser Replay
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
"StateReason")
)
instance Prelude.Hashable Replay
instance Prelude.NFData Replay