{-# 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.ReplicationTaskAssessmentRunProgress
-- 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.ReplicationTaskAssessmentRunProgress where

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

-- | The progress values reported by the @AssessmentProgress@ response
-- element.
--
-- /See:/ 'newReplicationTaskAssessmentRunProgress' smart constructor.
data ReplicationTaskAssessmentRunProgress = ReplicationTaskAssessmentRunProgress'
  { -- | The number of individual assessments that are specified to run.
    ReplicationTaskAssessmentRunProgress -> Maybe Int
individualAssessmentCount :: Prelude.Maybe Prelude.Int,
    -- | The number of individual assessments that have completed, successfully
    -- or not.
    ReplicationTaskAssessmentRunProgress -> Maybe Int
individualAssessmentCompletedCount :: Prelude.Maybe Prelude.Int
  }
  deriving (ReplicationTaskAssessmentRunProgress
-> ReplicationTaskAssessmentRunProgress -> Bool
(ReplicationTaskAssessmentRunProgress
 -> ReplicationTaskAssessmentRunProgress -> Bool)
-> (ReplicationTaskAssessmentRunProgress
    -> ReplicationTaskAssessmentRunProgress -> Bool)
-> Eq ReplicationTaskAssessmentRunProgress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationTaskAssessmentRunProgress
-> ReplicationTaskAssessmentRunProgress -> Bool
$c/= :: ReplicationTaskAssessmentRunProgress
-> ReplicationTaskAssessmentRunProgress -> Bool
== :: ReplicationTaskAssessmentRunProgress
-> ReplicationTaskAssessmentRunProgress -> Bool
$c== :: ReplicationTaskAssessmentRunProgress
-> ReplicationTaskAssessmentRunProgress -> Bool
Prelude.Eq, ReadPrec [ReplicationTaskAssessmentRunProgress]
ReadPrec ReplicationTaskAssessmentRunProgress
Int -> ReadS ReplicationTaskAssessmentRunProgress
ReadS [ReplicationTaskAssessmentRunProgress]
(Int -> ReadS ReplicationTaskAssessmentRunProgress)
-> ReadS [ReplicationTaskAssessmentRunProgress]
-> ReadPrec ReplicationTaskAssessmentRunProgress
-> ReadPrec [ReplicationTaskAssessmentRunProgress]
-> Read ReplicationTaskAssessmentRunProgress
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationTaskAssessmentRunProgress]
$creadListPrec :: ReadPrec [ReplicationTaskAssessmentRunProgress]
readPrec :: ReadPrec ReplicationTaskAssessmentRunProgress
$creadPrec :: ReadPrec ReplicationTaskAssessmentRunProgress
readList :: ReadS [ReplicationTaskAssessmentRunProgress]
$creadList :: ReadS [ReplicationTaskAssessmentRunProgress]
readsPrec :: Int -> ReadS ReplicationTaskAssessmentRunProgress
$creadsPrec :: Int -> ReadS ReplicationTaskAssessmentRunProgress
Prelude.Read, Int -> ReplicationTaskAssessmentRunProgress -> ShowS
[ReplicationTaskAssessmentRunProgress] -> ShowS
ReplicationTaskAssessmentRunProgress -> String
(Int -> ReplicationTaskAssessmentRunProgress -> ShowS)
-> (ReplicationTaskAssessmentRunProgress -> String)
-> ([ReplicationTaskAssessmentRunProgress] -> ShowS)
-> Show ReplicationTaskAssessmentRunProgress
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationTaskAssessmentRunProgress] -> ShowS
$cshowList :: [ReplicationTaskAssessmentRunProgress] -> ShowS
show :: ReplicationTaskAssessmentRunProgress -> String
$cshow :: ReplicationTaskAssessmentRunProgress -> String
showsPrec :: Int -> ReplicationTaskAssessmentRunProgress -> ShowS
$cshowsPrec :: Int -> ReplicationTaskAssessmentRunProgress -> ShowS
Prelude.Show, (forall x.
 ReplicationTaskAssessmentRunProgress
 -> Rep ReplicationTaskAssessmentRunProgress x)
-> (forall x.
    Rep ReplicationTaskAssessmentRunProgress x
    -> ReplicationTaskAssessmentRunProgress)
-> Generic ReplicationTaskAssessmentRunProgress
forall x.
Rep ReplicationTaskAssessmentRunProgress x
-> ReplicationTaskAssessmentRunProgress
forall x.
ReplicationTaskAssessmentRunProgress
-> Rep ReplicationTaskAssessmentRunProgress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReplicationTaskAssessmentRunProgress x
-> ReplicationTaskAssessmentRunProgress
$cfrom :: forall x.
ReplicationTaskAssessmentRunProgress
-> Rep ReplicationTaskAssessmentRunProgress x
Prelude.Generic)

-- |
-- Create a value of 'ReplicationTaskAssessmentRunProgress' 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:
--
-- 'individualAssessmentCount', 'replicationTaskAssessmentRunProgress_individualAssessmentCount' - The number of individual assessments that are specified to run.
--
-- 'individualAssessmentCompletedCount', 'replicationTaskAssessmentRunProgress_individualAssessmentCompletedCount' - The number of individual assessments that have completed, successfully
-- or not.
newReplicationTaskAssessmentRunProgress ::
  ReplicationTaskAssessmentRunProgress
newReplicationTaskAssessmentRunProgress :: ReplicationTaskAssessmentRunProgress
newReplicationTaskAssessmentRunProgress =
  ReplicationTaskAssessmentRunProgress' :: Maybe Int -> Maybe Int -> ReplicationTaskAssessmentRunProgress
ReplicationTaskAssessmentRunProgress'
    { $sel:individualAssessmentCount:ReplicationTaskAssessmentRunProgress' :: Maybe Int
individualAssessmentCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:individualAssessmentCompletedCount:ReplicationTaskAssessmentRunProgress' :: Maybe Int
individualAssessmentCompletedCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of individual assessments that are specified to run.
replicationTaskAssessmentRunProgress_individualAssessmentCount :: Lens.Lens' ReplicationTaskAssessmentRunProgress (Prelude.Maybe Prelude.Int)
replicationTaskAssessmentRunProgress_individualAssessmentCount :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskAssessmentRunProgress
-> f ReplicationTaskAssessmentRunProgress
replicationTaskAssessmentRunProgress_individualAssessmentCount = (ReplicationTaskAssessmentRunProgress -> Maybe Int)
-> (ReplicationTaskAssessmentRunProgress
    -> Maybe Int -> ReplicationTaskAssessmentRunProgress)
-> Lens
     ReplicationTaskAssessmentRunProgress
     ReplicationTaskAssessmentRunProgress
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskAssessmentRunProgress' {Maybe Int
individualAssessmentCount :: Maybe Int
$sel:individualAssessmentCount:ReplicationTaskAssessmentRunProgress' :: ReplicationTaskAssessmentRunProgress -> Maybe Int
individualAssessmentCount} -> Maybe Int
individualAssessmentCount) (\s :: ReplicationTaskAssessmentRunProgress
s@ReplicationTaskAssessmentRunProgress' {} Maybe Int
a -> ReplicationTaskAssessmentRunProgress
s {$sel:individualAssessmentCount:ReplicationTaskAssessmentRunProgress' :: Maybe Int
individualAssessmentCount = Maybe Int
a} :: ReplicationTaskAssessmentRunProgress)

-- | The number of individual assessments that have completed, successfully
-- or not.
replicationTaskAssessmentRunProgress_individualAssessmentCompletedCount :: Lens.Lens' ReplicationTaskAssessmentRunProgress (Prelude.Maybe Prelude.Int)
replicationTaskAssessmentRunProgress_individualAssessmentCompletedCount :: (Maybe Int -> f (Maybe Int))
-> ReplicationTaskAssessmentRunProgress
-> f ReplicationTaskAssessmentRunProgress
replicationTaskAssessmentRunProgress_individualAssessmentCompletedCount = (ReplicationTaskAssessmentRunProgress -> Maybe Int)
-> (ReplicationTaskAssessmentRunProgress
    -> Maybe Int -> ReplicationTaskAssessmentRunProgress)
-> Lens
     ReplicationTaskAssessmentRunProgress
     ReplicationTaskAssessmentRunProgress
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTaskAssessmentRunProgress' {Maybe Int
individualAssessmentCompletedCount :: Maybe Int
$sel:individualAssessmentCompletedCount:ReplicationTaskAssessmentRunProgress' :: ReplicationTaskAssessmentRunProgress -> Maybe Int
individualAssessmentCompletedCount} -> Maybe Int
individualAssessmentCompletedCount) (\s :: ReplicationTaskAssessmentRunProgress
s@ReplicationTaskAssessmentRunProgress' {} Maybe Int
a -> ReplicationTaskAssessmentRunProgress
s {$sel:individualAssessmentCompletedCount:ReplicationTaskAssessmentRunProgress' :: Maybe Int
individualAssessmentCompletedCount = Maybe Int
a} :: ReplicationTaskAssessmentRunProgress)

instance
  Core.FromJSON
    ReplicationTaskAssessmentRunProgress
  where
  parseJSON :: Value -> Parser ReplicationTaskAssessmentRunProgress
parseJSON =
    String
-> (Object -> Parser ReplicationTaskAssessmentRunProgress)
-> Value
-> Parser ReplicationTaskAssessmentRunProgress
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReplicationTaskAssessmentRunProgress"
      ( \Object
x ->
          Maybe Int -> Maybe Int -> ReplicationTaskAssessmentRunProgress
ReplicationTaskAssessmentRunProgress'
            (Maybe Int -> Maybe Int -> ReplicationTaskAssessmentRunProgress)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> ReplicationTaskAssessmentRunProgress)
forall (f :: * -> *) a b. Functor 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
"IndividualAssessmentCount")
            Parser (Maybe Int -> ReplicationTaskAssessmentRunProgress)
-> Parser (Maybe Int)
-> Parser ReplicationTaskAssessmentRunProgress
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
"IndividualAssessmentCompletedCount")
      )

instance
  Prelude.Hashable
    ReplicationTaskAssessmentRunProgress

instance
  Prelude.NFData
    ReplicationTaskAssessmentRunProgress