{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchEvents.DescribeReplay
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves details about a replay. Use @DescribeReplay@ to determine the
-- progress of a running replay. A replay processes events to replay based
-- on the time in the event, and replays them using 1 minute intervals. If
-- you use @StartReplay@ and specify an @EventStartTime@ and an
-- @EventEndTime@ that covers a 20 minute time range, the events are
-- replayed from the first minute of that 20 minute range first. Then the
-- events from the second minute are replayed. You can use @DescribeReplay@
-- to determine the progress of a replay. The value returned for
-- @EventLastReplayedTime@ indicates the time within the specified time
-- range associated with the last event replayed.
module Amazonka.CloudWatchEvents.DescribeReplay
  ( -- * Creating a Request
    DescribeReplay (..),
    newDescribeReplay,

    -- * Request Lenses
    describeReplay_replayName,

    -- * Destructuring the Response
    DescribeReplayResponse (..),
    newDescribeReplayResponse,

    -- * Response Lenses
    describeReplayResponse_description,
    describeReplayResponse_destination,
    describeReplayResponse_eventEndTime,
    describeReplayResponse_eventLastReplayedTime,
    describeReplayResponse_eventSourceArn,
    describeReplayResponse_eventStartTime,
    describeReplayResponse_replayArn,
    describeReplayResponse_replayEndTime,
    describeReplayResponse_replayName,
    describeReplayResponse_replayStartTime,
    describeReplayResponse_state,
    describeReplayResponse_stateReason,
    describeReplayResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeReplay' smart constructor.
data DescribeReplay = DescribeReplay'
  { -- | The name of the replay to retrieve.
    DescribeReplay -> Text
replayName :: Prelude.Text
  }
  deriving (DescribeReplay -> DescribeReplay -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReplay -> DescribeReplay -> Bool
$c/= :: DescribeReplay -> DescribeReplay -> Bool
== :: DescribeReplay -> DescribeReplay -> Bool
$c== :: DescribeReplay -> DescribeReplay -> Bool
Prelude.Eq, ReadPrec [DescribeReplay]
ReadPrec DescribeReplay
Int -> ReadS DescribeReplay
ReadS [DescribeReplay]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReplay]
$creadListPrec :: ReadPrec [DescribeReplay]
readPrec :: ReadPrec DescribeReplay
$creadPrec :: ReadPrec DescribeReplay
readList :: ReadS [DescribeReplay]
$creadList :: ReadS [DescribeReplay]
readsPrec :: Int -> ReadS DescribeReplay
$creadsPrec :: Int -> ReadS DescribeReplay
Prelude.Read, Int -> DescribeReplay -> ShowS
[DescribeReplay] -> ShowS
DescribeReplay -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReplay] -> ShowS
$cshowList :: [DescribeReplay] -> ShowS
show :: DescribeReplay -> String
$cshow :: DescribeReplay -> String
showsPrec :: Int -> DescribeReplay -> ShowS
$cshowsPrec :: Int -> DescribeReplay -> ShowS
Prelude.Show, forall x. Rep DescribeReplay x -> DescribeReplay
forall x. DescribeReplay -> Rep DescribeReplay x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReplay x -> DescribeReplay
$cfrom :: forall x. DescribeReplay -> Rep DescribeReplay x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReplay' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'replayName', 'describeReplay_replayName' - The name of the replay to retrieve.
newDescribeReplay ::
  -- | 'replayName'
  Prelude.Text ->
  DescribeReplay
newDescribeReplay :: Text -> DescribeReplay
newDescribeReplay Text
pReplayName_ =
  DescribeReplay' {$sel:replayName:DescribeReplay' :: Text
replayName = Text
pReplayName_}

-- | The name of the replay to retrieve.
describeReplay_replayName :: Lens.Lens' DescribeReplay Prelude.Text
describeReplay_replayName :: Lens' DescribeReplay Text
describeReplay_replayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplay' {Text
replayName :: Text
$sel:replayName:DescribeReplay' :: DescribeReplay -> Text
replayName} -> Text
replayName) (\s :: DescribeReplay
s@DescribeReplay' {} Text
a -> DescribeReplay
s {$sel:replayName:DescribeReplay' :: Text
replayName = Text
a} :: DescribeReplay)

instance Core.AWSRequest DescribeReplay where
  type
    AWSResponse DescribeReplay =
      DescribeReplayResponse
  request :: (Service -> Service) -> DescribeReplay -> Request DescribeReplay
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeReplay
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeReplay)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe ReplayDestination
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe ReplayState
-> Maybe Text
-> Int
-> DescribeReplayResponse
DescribeReplayResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Destination")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventEndTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventLastReplayedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventSourceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventStartTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplayArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplayEndTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplayStartTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StateReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeReplay where
  hashWithSalt :: Int -> DescribeReplay -> Int
hashWithSalt Int
_salt DescribeReplay' {Text
replayName :: Text
$sel:replayName:DescribeReplay' :: DescribeReplay -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
replayName

instance Prelude.NFData DescribeReplay where
  rnf :: DescribeReplay -> ()
rnf DescribeReplay' {Text
replayName :: Text
$sel:replayName:DescribeReplay' :: DescribeReplay -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
replayName

instance Data.ToHeaders DescribeReplay where
  toHeaders :: DescribeReplay -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSEvents.DescribeReplay" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeReplay where
  toJSON :: DescribeReplay -> Value
toJSON DescribeReplay' {Text
replayName :: Text
$sel:replayName:DescribeReplay' :: DescribeReplay -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ReplayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
replayName)]
      )

instance Data.ToPath DescribeReplay where
  toPath :: DescribeReplay -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeReplay where
  toQuery :: DescribeReplay -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeReplayResponse' smart constructor.
data DescribeReplayResponse = DescribeReplayResponse'
  { -- | The description of the replay.
    DescribeReplayResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A @ReplayDestination@ object that contains details about the replay.
    DescribeReplayResponse -> Maybe ReplayDestination
destination :: Prelude.Maybe ReplayDestination,
    -- | The time stamp for the last event that was replayed from the archive.
    DescribeReplayResponse -> Maybe POSIX
eventEndTime :: Prelude.Maybe Data.POSIX,
    -- | The time that the event was last replayed.
    DescribeReplayResponse -> Maybe POSIX
eventLastReplayedTime :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the archive events were replayed from.
    DescribeReplayResponse -> Maybe Text
eventSourceArn :: Prelude.Maybe Prelude.Text,
    -- | The time stamp of the first event that was last replayed from the
    -- archive.
    DescribeReplayResponse -> Maybe POSIX
eventStartTime :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the replay.
    DescribeReplayResponse -> Maybe Text
replayArn :: Prelude.Maybe Prelude.Text,
    -- | A time stamp for the time that the replay stopped.
    DescribeReplayResponse -> Maybe POSIX
replayEndTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the replay.
    DescribeReplayResponse -> Maybe Text
replayName :: Prelude.Maybe Prelude.Text,
    -- | A time stamp for the time that the replay started.
    DescribeReplayResponse -> Maybe POSIX
replayStartTime :: Prelude.Maybe Data.POSIX,
    -- | The current state of the replay.
    DescribeReplayResponse -> Maybe ReplayState
state :: Prelude.Maybe ReplayState,
    -- | The reason that the replay is in the current state.
    DescribeReplayResponse -> Maybe Text
stateReason :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeReplayResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeReplayResponse -> DescribeReplayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReplayResponse -> DescribeReplayResponse -> Bool
$c/= :: DescribeReplayResponse -> DescribeReplayResponse -> Bool
== :: DescribeReplayResponse -> DescribeReplayResponse -> Bool
$c== :: DescribeReplayResponse -> DescribeReplayResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReplayResponse]
ReadPrec DescribeReplayResponse
Int -> ReadS DescribeReplayResponse
ReadS [DescribeReplayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReplayResponse]
$creadListPrec :: ReadPrec [DescribeReplayResponse]
readPrec :: ReadPrec DescribeReplayResponse
$creadPrec :: ReadPrec DescribeReplayResponse
readList :: ReadS [DescribeReplayResponse]
$creadList :: ReadS [DescribeReplayResponse]
readsPrec :: Int -> ReadS DescribeReplayResponse
$creadsPrec :: Int -> ReadS DescribeReplayResponse
Prelude.Read, Int -> DescribeReplayResponse -> ShowS
[DescribeReplayResponse] -> ShowS
DescribeReplayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReplayResponse] -> ShowS
$cshowList :: [DescribeReplayResponse] -> ShowS
show :: DescribeReplayResponse -> String
$cshow :: DescribeReplayResponse -> String
showsPrec :: Int -> DescribeReplayResponse -> ShowS
$cshowsPrec :: Int -> DescribeReplayResponse -> ShowS
Prelude.Show, forall x. Rep DescribeReplayResponse x -> DescribeReplayResponse
forall x. DescribeReplayResponse -> Rep DescribeReplayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReplayResponse x -> DescribeReplayResponse
$cfrom :: forall x. DescribeReplayResponse -> Rep DescribeReplayResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReplayResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'description', 'describeReplayResponse_description' - The description of the replay.
--
-- 'destination', 'describeReplayResponse_destination' - A @ReplayDestination@ object that contains details about the replay.
--
-- 'eventEndTime', 'describeReplayResponse_eventEndTime' - The time stamp for the last event that was replayed from the archive.
--
-- 'eventLastReplayedTime', 'describeReplayResponse_eventLastReplayedTime' - The time that the event was last replayed.
--
-- 'eventSourceArn', 'describeReplayResponse_eventSourceArn' - The ARN of the archive events were replayed from.
--
-- 'eventStartTime', 'describeReplayResponse_eventStartTime' - The time stamp of the first event that was last replayed from the
-- archive.
--
-- 'replayArn', 'describeReplayResponse_replayArn' - The ARN of the replay.
--
-- 'replayEndTime', 'describeReplayResponse_replayEndTime' - A time stamp for the time that the replay stopped.
--
-- 'replayName', 'describeReplayResponse_replayName' - The name of the replay.
--
-- 'replayStartTime', 'describeReplayResponse_replayStartTime' - A time stamp for the time that the replay started.
--
-- 'state', 'describeReplayResponse_state' - The current state of the replay.
--
-- 'stateReason', 'describeReplayResponse_stateReason' - The reason that the replay is in the current state.
--
-- 'httpStatus', 'describeReplayResponse_httpStatus' - The response's http status code.
newDescribeReplayResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeReplayResponse
newDescribeReplayResponse :: Int -> DescribeReplayResponse
newDescribeReplayResponse Int
pHttpStatus_ =
  DescribeReplayResponse'
    { $sel:description:DescribeReplayResponse' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:destination:DescribeReplayResponse' :: Maybe ReplayDestination
destination = forall a. Maybe a
Prelude.Nothing,
      $sel:eventEndTime:DescribeReplayResponse' :: Maybe POSIX
eventEndTime = forall a. Maybe a
Prelude.Nothing,
      $sel:eventLastReplayedTime:DescribeReplayResponse' :: Maybe POSIX
eventLastReplayedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:eventSourceArn:DescribeReplayResponse' :: Maybe Text
eventSourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:eventStartTime:DescribeReplayResponse' :: Maybe POSIX
eventStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:replayArn:DescribeReplayResponse' :: Maybe Text
replayArn = forall a. Maybe a
Prelude.Nothing,
      $sel:replayEndTime:DescribeReplayResponse' :: Maybe POSIX
replayEndTime = forall a. Maybe a
Prelude.Nothing,
      $sel:replayName:DescribeReplayResponse' :: Maybe Text
replayName = forall a. Maybe a
Prelude.Nothing,
      $sel:replayStartTime:DescribeReplayResponse' :: Maybe POSIX
replayStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeReplayResponse' :: Maybe ReplayState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:stateReason:DescribeReplayResponse' :: Maybe Text
stateReason = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeReplayResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The description of the replay.
describeReplayResponse_description :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.Text)
describeReplayResponse_description :: Lens' DescribeReplayResponse (Maybe Text)
describeReplayResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe Text
a -> DescribeReplayResponse
s {$sel:description:DescribeReplayResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeReplayResponse)

-- | A @ReplayDestination@ object that contains details about the replay.
describeReplayResponse_destination :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe ReplayDestination)
describeReplayResponse_destination :: Lens' DescribeReplayResponse (Maybe ReplayDestination)
describeReplayResponse_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe ReplayDestination
destination :: Maybe ReplayDestination
$sel:destination:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe ReplayDestination
destination} -> Maybe ReplayDestination
destination) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe ReplayDestination
a -> DescribeReplayResponse
s {$sel:destination:DescribeReplayResponse' :: Maybe ReplayDestination
destination = Maybe ReplayDestination
a} :: DescribeReplayResponse)

-- | The time stamp for the last event that was replayed from the archive.
describeReplayResponse_eventEndTime :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.UTCTime)
describeReplayResponse_eventEndTime :: Lens' DescribeReplayResponse (Maybe UTCTime)
describeReplayResponse_eventEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe POSIX
eventEndTime :: Maybe POSIX
$sel:eventEndTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
eventEndTime} -> Maybe POSIX
eventEndTime) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe POSIX
a -> DescribeReplayResponse
s {$sel:eventEndTime:DescribeReplayResponse' :: Maybe POSIX
eventEndTime = Maybe POSIX
a} :: DescribeReplayResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time that the event was last replayed.
describeReplayResponse_eventLastReplayedTime :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.UTCTime)
describeReplayResponse_eventLastReplayedTime :: Lens' DescribeReplayResponse (Maybe UTCTime)
describeReplayResponse_eventLastReplayedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe POSIX
eventLastReplayedTime :: Maybe POSIX
$sel:eventLastReplayedTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
eventLastReplayedTime} -> Maybe POSIX
eventLastReplayedTime) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe POSIX
a -> DescribeReplayResponse
s {$sel:eventLastReplayedTime:DescribeReplayResponse' :: Maybe POSIX
eventLastReplayedTime = Maybe POSIX
a} :: DescribeReplayResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the archive events were replayed from.
describeReplayResponse_eventSourceArn :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.Text)
describeReplayResponse_eventSourceArn :: Lens' DescribeReplayResponse (Maybe Text)
describeReplayResponse_eventSourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe Text
eventSourceArn :: Maybe Text
$sel:eventSourceArn:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
eventSourceArn} -> Maybe Text
eventSourceArn) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe Text
a -> DescribeReplayResponse
s {$sel:eventSourceArn:DescribeReplayResponse' :: Maybe Text
eventSourceArn = Maybe Text
a} :: DescribeReplayResponse)

-- | The time stamp of the first event that was last replayed from the
-- archive.
describeReplayResponse_eventStartTime :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.UTCTime)
describeReplayResponse_eventStartTime :: Lens' DescribeReplayResponse (Maybe UTCTime)
describeReplayResponse_eventStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe POSIX
eventStartTime :: Maybe POSIX
$sel:eventStartTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
eventStartTime} -> Maybe POSIX
eventStartTime) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe POSIX
a -> DescribeReplayResponse
s {$sel:eventStartTime:DescribeReplayResponse' :: Maybe POSIX
eventStartTime = Maybe POSIX
a} :: DescribeReplayResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the replay.
describeReplayResponse_replayArn :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.Text)
describeReplayResponse_replayArn :: Lens' DescribeReplayResponse (Maybe Text)
describeReplayResponse_replayArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe Text
replayArn :: Maybe Text
$sel:replayArn:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
replayArn} -> Maybe Text
replayArn) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe Text
a -> DescribeReplayResponse
s {$sel:replayArn:DescribeReplayResponse' :: Maybe Text
replayArn = Maybe Text
a} :: DescribeReplayResponse)

-- | A time stamp for the time that the replay stopped.
describeReplayResponse_replayEndTime :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.UTCTime)
describeReplayResponse_replayEndTime :: Lens' DescribeReplayResponse (Maybe UTCTime)
describeReplayResponse_replayEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe POSIX
replayEndTime :: Maybe POSIX
$sel:replayEndTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
replayEndTime} -> Maybe POSIX
replayEndTime) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe POSIX
a -> DescribeReplayResponse
s {$sel:replayEndTime:DescribeReplayResponse' :: Maybe POSIX
replayEndTime = Maybe POSIX
a} :: DescribeReplayResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the replay.
describeReplayResponse_replayName :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.Text)
describeReplayResponse_replayName :: Lens' DescribeReplayResponse (Maybe Text)
describeReplayResponse_replayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe Text
replayName :: Maybe Text
$sel:replayName:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
replayName} -> Maybe Text
replayName) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe Text
a -> DescribeReplayResponse
s {$sel:replayName:DescribeReplayResponse' :: Maybe Text
replayName = Maybe Text
a} :: DescribeReplayResponse)

-- | A time stamp for the time that the replay started.
describeReplayResponse_replayStartTime :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.UTCTime)
describeReplayResponse_replayStartTime :: Lens' DescribeReplayResponse (Maybe UTCTime)
describeReplayResponse_replayStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe POSIX
replayStartTime :: Maybe POSIX
$sel:replayStartTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
replayStartTime} -> Maybe POSIX
replayStartTime) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe POSIX
a -> DescribeReplayResponse
s {$sel:replayStartTime:DescribeReplayResponse' :: Maybe POSIX
replayStartTime = Maybe POSIX
a} :: DescribeReplayResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The current state of the replay.
describeReplayResponse_state :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe ReplayState)
describeReplayResponse_state :: Lens' DescribeReplayResponse (Maybe ReplayState)
describeReplayResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe ReplayState
state :: Maybe ReplayState
$sel:state:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe ReplayState
state} -> Maybe ReplayState
state) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe ReplayState
a -> DescribeReplayResponse
s {$sel:state:DescribeReplayResponse' :: Maybe ReplayState
state = Maybe ReplayState
a} :: DescribeReplayResponse)

-- | The reason that the replay is in the current state.
describeReplayResponse_stateReason :: Lens.Lens' DescribeReplayResponse (Prelude.Maybe Prelude.Text)
describeReplayResponse_stateReason :: Lens' DescribeReplayResponse (Maybe Text)
describeReplayResponse_stateReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Maybe Text
stateReason :: Maybe Text
$sel:stateReason:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
stateReason} -> Maybe Text
stateReason) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Maybe Text
a -> DescribeReplayResponse
s {$sel:stateReason:DescribeReplayResponse' :: Maybe Text
stateReason = Maybe Text
a} :: DescribeReplayResponse)

-- | The response's http status code.
describeReplayResponse_httpStatus :: Lens.Lens' DescribeReplayResponse Prelude.Int
describeReplayResponse_httpStatus :: Lens' DescribeReplayResponse Int
describeReplayResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReplayResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReplayResponse' :: DescribeReplayResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReplayResponse
s@DescribeReplayResponse' {} Int
a -> DescribeReplayResponse
s {$sel:httpStatus:DescribeReplayResponse' :: Int
httpStatus = Int
a} :: DescribeReplayResponse)

instance Prelude.NFData DescribeReplayResponse where
  rnf :: DescribeReplayResponse -> ()
rnf DescribeReplayResponse' {Int
Maybe Text
Maybe POSIX
Maybe ReplayDestination
Maybe ReplayState
httpStatus :: Int
stateReason :: Maybe Text
state :: Maybe ReplayState
replayStartTime :: Maybe POSIX
replayName :: Maybe Text
replayEndTime :: Maybe POSIX
replayArn :: Maybe Text
eventStartTime :: Maybe POSIX
eventSourceArn :: Maybe Text
eventLastReplayedTime :: Maybe POSIX
eventEndTime :: Maybe POSIX
destination :: Maybe ReplayDestination
description :: Maybe Text
$sel:httpStatus:DescribeReplayResponse' :: DescribeReplayResponse -> Int
$sel:stateReason:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
$sel:state:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe ReplayState
$sel:replayStartTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
$sel:replayName:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
$sel:replayEndTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
$sel:replayArn:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
$sel:eventStartTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
$sel:eventSourceArn:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
$sel:eventLastReplayedTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
$sel:eventEndTime:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe POSIX
$sel:destination:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe ReplayDestination
$sel:description:DescribeReplayResponse' :: DescribeReplayResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplayDestination
destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
eventEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
eventLastReplayedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventSourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
eventStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replayArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
replayEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
replayStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplayState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stateReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus