{-# 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 #-}

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

-- |
-- Module      : Amazonka.DMS.Types.ReplicationTaskStats
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DMS.Types.ReplicationTaskStats where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | In response to a request by the @DescribeReplicationTasks@ operation,
-- this object provides a collection of statistics about a replication
-- task.
--
-- /See:/ 'newReplicationTaskStats' smart constructor.
data ReplicationTaskStats = ReplicationTaskStats'
  { -- | The date the replication task was stopped.
    ReplicationTaskStats -> Maybe POSIX
stopDate :: Prelude.Maybe Core.POSIX,
    -- | The percent complete for the full load migration task.
    ReplicationTaskStats -> Maybe Int
fullLoadProgressPercent :: Prelude.Maybe Prelude.Int,
    -- | The date the replication task full load was started.
    ReplicationTaskStats -> Maybe POSIX
fullLoadStartDate :: Prelude.Maybe Core.POSIX,
    -- | The elapsed time of the task, in milliseconds.
    ReplicationTaskStats -> Maybe Integer
elapsedTimeMillis :: Prelude.Maybe Prelude.Integer,
    -- | The date the replication task was started either with a fresh start or a
    -- resume. For more information, see
    -- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html#DMS-StartReplicationTask-request-StartReplicationTaskType StartReplicationTaskType>.
    ReplicationTaskStats -> Maybe POSIX
startDate :: Prelude.Maybe Core.POSIX,
    -- | The number of errors that have occurred during this task.
    ReplicationTaskStats -> Maybe Int
tablesErrored :: Prelude.Maybe Prelude.Int,
    -- | The date the replication task full load was completed.
    ReplicationTaskStats -> Maybe POSIX
fullLoadFinishDate :: Prelude.Maybe Core.POSIX,
    -- | The number of tables loaded for this task.
    ReplicationTaskStats -> Maybe Int
tablesLoaded :: Prelude.Maybe Prelude.Int,
    -- | The number of tables queued for this task.
    ReplicationTaskStats -> Maybe Int
tablesQueued :: Prelude.Maybe Prelude.Int,
    -- | The number of tables currently loading for this task.
    ReplicationTaskStats -> Maybe Int
tablesLoading :: Prelude.Maybe Prelude.Int,
    -- | The date the replication task was started either with a fresh start or a
    -- target reload.
    ReplicationTaskStats -> Maybe POSIX
freshStartDate :: Prelude.Maybe Core.POSIX
  }
  deriving (ReplicationTaskStats -> ReplicationTaskStats -> Bool
(ReplicationTaskStats -> ReplicationTaskStats -> Bool)
-> (ReplicationTaskStats -> ReplicationTaskStats -> Bool)
-> Eq ReplicationTaskStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationTaskStats -> ReplicationTaskStats -> Bool
$c/= :: ReplicationTaskStats -> ReplicationTaskStats -> Bool
== :: ReplicationTaskStats -> ReplicationTaskStats -> Bool
$c== :: ReplicationTaskStats -> ReplicationTaskStats -> Bool
Prelude.Eq, ReadPrec [ReplicationTaskStats]
ReadPrec ReplicationTaskStats
Int -> ReadS ReplicationTaskStats
ReadS [ReplicationTaskStats]
(Int -> ReadS ReplicationTaskStats)
-> ReadS [ReplicationTaskStats]
-> ReadPrec ReplicationTaskStats
-> ReadPrec [ReplicationTaskStats]
-> Read ReplicationTaskStats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationTaskStats]
$creadListPrec :: ReadPrec [ReplicationTaskStats]
readPrec :: ReadPrec ReplicationTaskStats
$creadPrec :: ReadPrec ReplicationTaskStats
readList :: ReadS [ReplicationTaskStats]
$creadList :: ReadS [ReplicationTaskStats]
readsPrec :: Int -> ReadS ReplicationTaskStats
$creadsPrec :: Int -> ReadS ReplicationTaskStats
Prelude.Read, Int -> ReplicationTaskStats -> ShowS
[ReplicationTaskStats] -> ShowS
ReplicationTaskStats -> String
(Int -> ReplicationTaskStats -> ShowS)
-> (ReplicationTaskStats -> String)
-> ([ReplicationTaskStats] -> ShowS)
-> Show ReplicationTaskStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationTaskStats] -> ShowS
$cshowList :: [ReplicationTaskStats] -> ShowS
show :: ReplicationTaskStats -> String
$cshow :: ReplicationTaskStats -> String
showsPrec :: Int -> ReplicationTaskStats -> ShowS
$cshowsPrec :: Int -> ReplicationTaskStats -> ShowS
Prelude.Show, (forall x. ReplicationTaskStats -> Rep ReplicationTaskStats x)
-> (forall x. Rep ReplicationTaskStats x -> ReplicationTaskStats)
-> Generic ReplicationTaskStats
forall x. Rep ReplicationTaskStats x -> ReplicationTaskStats
forall x. ReplicationTaskStats -> Rep ReplicationTaskStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationTaskStats x -> ReplicationTaskStats
$cfrom :: forall x. ReplicationTaskStats -> Rep ReplicationTaskStats x
Prelude.Generic)

-- |
-- Create a value of 'ReplicationTaskStats' 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:
--
-- 'stopDate', 'replicationTaskStats_stopDate' - The date the replication task was stopped.
--
-- 'fullLoadProgressPercent', 'replicationTaskStats_fullLoadProgressPercent' - The percent complete for the full load migration task.
--
-- 'fullLoadStartDate', 'replicationTaskStats_fullLoadStartDate' - The date the replication task full load was started.
--
-- 'elapsedTimeMillis', 'replicationTaskStats_elapsedTimeMillis' - The elapsed time of the task, in milliseconds.
--
-- 'startDate', 'replicationTaskStats_startDate' - The date the replication task was started either with a fresh start or a
-- resume. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html#DMS-StartReplicationTask-request-StartReplicationTaskType StartReplicationTaskType>.
--
-- 'tablesErrored', 'replicationTaskStats_tablesErrored' - The number of errors that have occurred during this task.
--
-- 'fullLoadFinishDate', 'replicationTaskStats_fullLoadFinishDate' - The date the replication task full load was completed.
--
-- 'tablesLoaded', 'replicationTaskStats_tablesLoaded' - The number of tables loaded for this task.
--
-- 'tablesQueued', 'replicationTaskStats_tablesQueued' - The number of tables queued for this task.
--
-- 'tablesLoading', 'replicationTaskStats_tablesLoading' - The number of tables currently loading for this task.
--
-- 'freshStartDate', 'replicationTaskStats_freshStartDate' - The date the replication task was started either with a fresh start or a
-- target reload.
newReplicationTaskStats ::
  ReplicationTaskStats
newReplicationTaskStats :: ReplicationTaskStats
newReplicationTaskStats =
  ReplicationTaskStats' :: Maybe POSIX
-> Maybe Int
-> Maybe POSIX
-> Maybe Integer
-> Maybe POSIX
-> Maybe Int
-> Maybe POSIX
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe POSIX
-> ReplicationTaskStats
ReplicationTaskStats'
    { $sel:stopDate:ReplicationTaskStats' :: Maybe POSIX
stopDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:fullLoadProgressPercent:ReplicationTaskStats' :: Maybe Int
fullLoadProgressPercent = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:fullLoadStartDate:ReplicationTaskStats' :: Maybe POSIX
fullLoadStartDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:elapsedTimeMillis:ReplicationTaskStats' :: Maybe Integer
elapsedTimeMillis = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:ReplicationTaskStats' :: Maybe POSIX
startDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:tablesErrored:ReplicationTaskStats' :: Maybe Int
tablesErrored = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:fullLoadFinishDate:ReplicationTaskStats' :: Maybe POSIX
fullLoadFinishDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:tablesLoaded:ReplicationTaskStats' :: Maybe Int
tablesLoaded = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tablesQueued:ReplicationTaskStats' :: Maybe Int
tablesQueued = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tablesLoading:ReplicationTaskStats' :: Maybe Int
tablesLoading = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:freshStartDate:ReplicationTaskStats' :: Maybe POSIX
freshStartDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The date the replication task was stopped.
replicationTaskStats_stopDate :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.UTCTime)
replicationTaskStats_stopDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_stopDate = (ReplicationTaskStats -> Maybe POSIX)
-> (ReplicationTaskStats -> Maybe POSIX -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe POSIX
stopDate :: Maybe POSIX
$sel:stopDate:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe POSIX
stopDate} -> Maybe POSIX
stopDate) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe POSIX
a -> ReplicationTaskStats
s {$sel:stopDate:ReplicationTaskStats' :: Maybe POSIX
stopDate = Maybe POSIX
a} :: ReplicationTaskStats) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationTaskStats -> f ReplicationTaskStats)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats
-> f ReplicationTaskStats
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

-- | The percent complete for the full load migration task.
replicationTaskStats_fullLoadProgressPercent :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Int)
replicationTaskStats_fullLoadProgressPercent :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_fullLoadProgressPercent = (ReplicationTaskStats -> Maybe Int)
-> (ReplicationTaskStats -> Maybe Int -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats ReplicationTaskStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Int
fullLoadProgressPercent :: Maybe Int
$sel:fullLoadProgressPercent:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Int
fullLoadProgressPercent} -> Maybe Int
fullLoadProgressPercent) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Int
a -> ReplicationTaskStats
s {$sel:fullLoadProgressPercent:ReplicationTaskStats' :: Maybe Int
fullLoadProgressPercent = Maybe Int
a} :: ReplicationTaskStats)

-- | The date the replication task full load was started.
replicationTaskStats_fullLoadStartDate :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.UTCTime)
replicationTaskStats_fullLoadStartDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_fullLoadStartDate = (ReplicationTaskStats -> Maybe POSIX)
-> (ReplicationTaskStats -> Maybe POSIX -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe POSIX
fullLoadStartDate :: Maybe POSIX
$sel:fullLoadStartDate:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe POSIX
fullLoadStartDate} -> Maybe POSIX
fullLoadStartDate) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe POSIX
a -> ReplicationTaskStats
s {$sel:fullLoadStartDate:ReplicationTaskStats' :: Maybe POSIX
fullLoadStartDate = Maybe POSIX
a} :: ReplicationTaskStats) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationTaskStats -> f ReplicationTaskStats)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats
-> f ReplicationTaskStats
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

-- | The elapsed time of the task, in milliseconds.
replicationTaskStats_elapsedTimeMillis :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Integer)
replicationTaskStats_elapsedTimeMillis :: (Maybe Integer -> f (Maybe Integer))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_elapsedTimeMillis = (ReplicationTaskStats -> Maybe Integer)
-> (ReplicationTaskStats -> Maybe Integer -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Integer
elapsedTimeMillis :: Maybe Integer
$sel:elapsedTimeMillis:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Integer
elapsedTimeMillis} -> Maybe Integer
elapsedTimeMillis) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Integer
a -> ReplicationTaskStats
s {$sel:elapsedTimeMillis:ReplicationTaskStats' :: Maybe Integer
elapsedTimeMillis = Maybe Integer
a} :: ReplicationTaskStats)

-- | The date the replication task was started either with a fresh start or a
-- resume. For more information, see
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html#DMS-StartReplicationTask-request-StartReplicationTaskType StartReplicationTaskType>.
replicationTaskStats_startDate :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.UTCTime)
replicationTaskStats_startDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_startDate = (ReplicationTaskStats -> Maybe POSIX)
-> (ReplicationTaskStats -> Maybe POSIX -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe POSIX
startDate :: Maybe POSIX
$sel:startDate:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe POSIX
startDate} -> Maybe POSIX
startDate) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe POSIX
a -> ReplicationTaskStats
s {$sel:startDate:ReplicationTaskStats' :: Maybe POSIX
startDate = Maybe POSIX
a} :: ReplicationTaskStats) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationTaskStats -> f ReplicationTaskStats)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats
-> f ReplicationTaskStats
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

-- | The number of errors that have occurred during this task.
replicationTaskStats_tablesErrored :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Int)
replicationTaskStats_tablesErrored :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_tablesErrored = (ReplicationTaskStats -> Maybe Int)
-> (ReplicationTaskStats -> Maybe Int -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats ReplicationTaskStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Int
tablesErrored :: Maybe Int
$sel:tablesErrored:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Int
tablesErrored} -> Maybe Int
tablesErrored) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Int
a -> ReplicationTaskStats
s {$sel:tablesErrored:ReplicationTaskStats' :: Maybe Int
tablesErrored = Maybe Int
a} :: ReplicationTaskStats)

-- | The date the replication task full load was completed.
replicationTaskStats_fullLoadFinishDate :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.UTCTime)
replicationTaskStats_fullLoadFinishDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_fullLoadFinishDate = (ReplicationTaskStats -> Maybe POSIX)
-> (ReplicationTaskStats -> Maybe POSIX -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe POSIX
fullLoadFinishDate :: Maybe POSIX
$sel:fullLoadFinishDate:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe POSIX
fullLoadFinishDate} -> Maybe POSIX
fullLoadFinishDate) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe POSIX
a -> ReplicationTaskStats
s {$sel:fullLoadFinishDate:ReplicationTaskStats' :: Maybe POSIX
fullLoadFinishDate = Maybe POSIX
a} :: ReplicationTaskStats) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationTaskStats -> f ReplicationTaskStats)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats
-> f ReplicationTaskStats
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

-- | The number of tables loaded for this task.
replicationTaskStats_tablesLoaded :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Int)
replicationTaskStats_tablesLoaded :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_tablesLoaded = (ReplicationTaskStats -> Maybe Int)
-> (ReplicationTaskStats -> Maybe Int -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats ReplicationTaskStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Int
tablesLoaded :: Maybe Int
$sel:tablesLoaded:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Int
tablesLoaded} -> Maybe Int
tablesLoaded) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Int
a -> ReplicationTaskStats
s {$sel:tablesLoaded:ReplicationTaskStats' :: Maybe Int
tablesLoaded = Maybe Int
a} :: ReplicationTaskStats)

-- | The number of tables queued for this task.
replicationTaskStats_tablesQueued :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Int)
replicationTaskStats_tablesQueued :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_tablesQueued = (ReplicationTaskStats -> Maybe Int)
-> (ReplicationTaskStats -> Maybe Int -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats ReplicationTaskStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Int
tablesQueued :: Maybe Int
$sel:tablesQueued:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Int
tablesQueued} -> Maybe Int
tablesQueued) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Int
a -> ReplicationTaskStats
s {$sel:tablesQueued:ReplicationTaskStats' :: Maybe Int
tablesQueued = Maybe Int
a} :: ReplicationTaskStats)

-- | The number of tables currently loading for this task.
replicationTaskStats_tablesLoading :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.Int)
replicationTaskStats_tablesLoading :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_tablesLoading = (ReplicationTaskStats -> Maybe Int)
-> (ReplicationTaskStats -> Maybe Int -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats ReplicationTaskStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe Int
tablesLoading :: Maybe Int
$sel:tablesLoading:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe Int
tablesLoading} -> Maybe Int
tablesLoading) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe Int
a -> ReplicationTaskStats
s {$sel:tablesLoading:ReplicationTaskStats' :: Maybe Int
tablesLoading = Maybe Int
a} :: ReplicationTaskStats)

-- | The date the replication task was started either with a fresh start or a
-- target reload.
replicationTaskStats_freshStartDate :: Lens.Lens' ReplicationTaskStats (Prelude.Maybe Prelude.UTCTime)
replicationTaskStats_freshStartDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats -> f ReplicationTaskStats
replicationTaskStats_freshStartDate = (ReplicationTaskStats -> Maybe POSIX)
-> (ReplicationTaskStats -> Maybe POSIX -> ReplicationTaskStats)
-> Lens
     ReplicationTaskStats
     ReplicationTaskStats
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskStats' {Maybe POSIX
freshStartDate :: Maybe POSIX
$sel:freshStartDate:ReplicationTaskStats' :: ReplicationTaskStats -> Maybe POSIX
freshStartDate} -> Maybe POSIX
freshStartDate) (\s :: ReplicationTaskStats
s@ReplicationTaskStats' {} Maybe POSIX
a -> ReplicationTaskStats
s {$sel:freshStartDate:ReplicationTaskStats' :: Maybe POSIX
freshStartDate = Maybe POSIX
a} :: ReplicationTaskStats) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationTaskStats -> f ReplicationTaskStats)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationTaskStats
-> f ReplicationTaskStats
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 ReplicationTaskStats where
  parseJSON :: Value -> Parser ReplicationTaskStats
parseJSON =
    String
-> (Object -> Parser ReplicationTaskStats)
-> Value
-> Parser ReplicationTaskStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReplicationTaskStats"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Int
-> Maybe POSIX
-> Maybe Integer
-> Maybe POSIX
-> Maybe Int
-> Maybe POSIX
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe POSIX
-> ReplicationTaskStats
ReplicationTaskStats'
            (Maybe POSIX
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe POSIX
 -> ReplicationTaskStats)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
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
"StopDate")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FullLoadProgressPercent")
            Parser
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
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
"FullLoadStartDate")
            Parser
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ElapsedTimeMillis")
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
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
"StartDate")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe POSIX
      -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TablesErrored")
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe POSIX
   -> ReplicationTaskStats)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
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
"FullLoadFinishDate")
            Parser
  (Maybe Int
   -> Maybe Int -> Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TablesLoaded")
            Parser
  (Maybe Int -> Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TablesQueued")
            Parser (Maybe Int -> Maybe POSIX -> ReplicationTaskStats)
-> Parser (Maybe Int)
-> Parser (Maybe POSIX -> ReplicationTaskStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TablesLoading")
            Parser (Maybe POSIX -> ReplicationTaskStats)
-> Parser (Maybe POSIX) -> Parser ReplicationTaskStats
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
"FreshStartDate")
      )

instance Prelude.Hashable ReplicationTaskStats

instance Prelude.NFData ReplicationTaskStats