{-# 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.MigrationHubStrategy.Types.DataCollectionDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MigrationHubStrategy.Types.DataCollectionDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.AssessmentStatus
import qualified Amazonka.Prelude as Prelude

-- | Detailed information about an assessment.
--
-- /See:/ 'newDataCollectionDetails' smart constructor.
data DataCollectionDetails = DataCollectionDetails'
  { -- | The time the assessment completes.
    DataCollectionDetails -> Maybe POSIX
completionTime :: Prelude.Maybe Data.POSIX,
    -- | The number of failed servers in the assessment.
    DataCollectionDetails -> Maybe Int
failed :: Prelude.Maybe Prelude.Int,
    -- | The number of servers with the assessment status @IN_PROGESS@.
    DataCollectionDetails -> Maybe Int
inProgress :: Prelude.Maybe Prelude.Int,
    -- | The total number of servers in the assessment.
    DataCollectionDetails -> Maybe Int
servers :: Prelude.Maybe Prelude.Int,
    -- | The start time of assessment.
    DataCollectionDetails -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the assessment.
    DataCollectionDetails -> Maybe AssessmentStatus
status :: Prelude.Maybe AssessmentStatus,
    -- | The status message of the assessment.
    DataCollectionDetails -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The number of successful servers in the assessment.
    DataCollectionDetails -> Maybe Int
success :: Prelude.Maybe Prelude.Int
  }
  deriving (DataCollectionDetails -> DataCollectionDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataCollectionDetails -> DataCollectionDetails -> Bool
$c/= :: DataCollectionDetails -> DataCollectionDetails -> Bool
== :: DataCollectionDetails -> DataCollectionDetails -> Bool
$c== :: DataCollectionDetails -> DataCollectionDetails -> Bool
Prelude.Eq, ReadPrec [DataCollectionDetails]
ReadPrec DataCollectionDetails
Int -> ReadS DataCollectionDetails
ReadS [DataCollectionDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataCollectionDetails]
$creadListPrec :: ReadPrec [DataCollectionDetails]
readPrec :: ReadPrec DataCollectionDetails
$creadPrec :: ReadPrec DataCollectionDetails
readList :: ReadS [DataCollectionDetails]
$creadList :: ReadS [DataCollectionDetails]
readsPrec :: Int -> ReadS DataCollectionDetails
$creadsPrec :: Int -> ReadS DataCollectionDetails
Prelude.Read, Int -> DataCollectionDetails -> ShowS
[DataCollectionDetails] -> ShowS
DataCollectionDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataCollectionDetails] -> ShowS
$cshowList :: [DataCollectionDetails] -> ShowS
show :: DataCollectionDetails -> String
$cshow :: DataCollectionDetails -> String
showsPrec :: Int -> DataCollectionDetails -> ShowS
$cshowsPrec :: Int -> DataCollectionDetails -> ShowS
Prelude.Show, forall x. Rep DataCollectionDetails x -> DataCollectionDetails
forall x. DataCollectionDetails -> Rep DataCollectionDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataCollectionDetails x -> DataCollectionDetails
$cfrom :: forall x. DataCollectionDetails -> Rep DataCollectionDetails x
Prelude.Generic)

-- |
-- Create a value of 'DataCollectionDetails' 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:
--
-- 'completionTime', 'dataCollectionDetails_completionTime' - The time the assessment completes.
--
-- 'failed', 'dataCollectionDetails_failed' - The number of failed servers in the assessment.
--
-- 'inProgress', 'dataCollectionDetails_inProgress' - The number of servers with the assessment status @IN_PROGESS@.
--
-- 'servers', 'dataCollectionDetails_servers' - The total number of servers in the assessment.
--
-- 'startTime', 'dataCollectionDetails_startTime' - The start time of assessment.
--
-- 'status', 'dataCollectionDetails_status' - The status of the assessment.
--
-- 'statusMessage', 'dataCollectionDetails_statusMessage' - The status message of the assessment.
--
-- 'success', 'dataCollectionDetails_success' - The number of successful servers in the assessment.
newDataCollectionDetails ::
  DataCollectionDetails
newDataCollectionDetails :: DataCollectionDetails
newDataCollectionDetails =
  DataCollectionDetails'
    { $sel:completionTime:DataCollectionDetails' :: Maybe POSIX
completionTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:failed:DataCollectionDetails' :: Maybe Int
failed = forall a. Maybe a
Prelude.Nothing,
      $sel:inProgress:DataCollectionDetails' :: Maybe Int
inProgress = forall a. Maybe a
Prelude.Nothing,
      $sel:servers:DataCollectionDetails' :: Maybe Int
servers = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:DataCollectionDetails' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DataCollectionDetails' :: Maybe AssessmentStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:DataCollectionDetails' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:success:DataCollectionDetails' :: Maybe Int
success = forall a. Maybe a
Prelude.Nothing
    }

-- | The time the assessment completes.
dataCollectionDetails_completionTime :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.UTCTime)
dataCollectionDetails_completionTime :: Lens' DataCollectionDetails (Maybe UTCTime)
dataCollectionDetails_completionTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe POSIX
completionTime :: Maybe POSIX
$sel:completionTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
completionTime} -> Maybe POSIX
completionTime) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe POSIX
a -> DataCollectionDetails
s {$sel:completionTime:DataCollectionDetails' :: Maybe POSIX
completionTime = Maybe POSIX
a} :: DataCollectionDetails) 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 number of failed servers in the assessment.
dataCollectionDetails_failed :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.Int)
dataCollectionDetails_failed :: Lens' DataCollectionDetails (Maybe Int)
dataCollectionDetails_failed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe Int
failed :: Maybe Int
$sel:failed:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
failed} -> Maybe Int
failed) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe Int
a -> DataCollectionDetails
s {$sel:failed:DataCollectionDetails' :: Maybe Int
failed = Maybe Int
a} :: DataCollectionDetails)

-- | The number of servers with the assessment status @IN_PROGESS@.
dataCollectionDetails_inProgress :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.Int)
dataCollectionDetails_inProgress :: Lens' DataCollectionDetails (Maybe Int)
dataCollectionDetails_inProgress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe Int
inProgress :: Maybe Int
$sel:inProgress:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
inProgress} -> Maybe Int
inProgress) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe Int
a -> DataCollectionDetails
s {$sel:inProgress:DataCollectionDetails' :: Maybe Int
inProgress = Maybe Int
a} :: DataCollectionDetails)

-- | The total number of servers in the assessment.
dataCollectionDetails_servers :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.Int)
dataCollectionDetails_servers :: Lens' DataCollectionDetails (Maybe Int)
dataCollectionDetails_servers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe Int
servers :: Maybe Int
$sel:servers:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
servers} -> Maybe Int
servers) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe Int
a -> DataCollectionDetails
s {$sel:servers:DataCollectionDetails' :: Maybe Int
servers = Maybe Int
a} :: DataCollectionDetails)

-- | The start time of assessment.
dataCollectionDetails_startTime :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.UTCTime)
dataCollectionDetails_startTime :: Lens' DataCollectionDetails (Maybe UTCTime)
dataCollectionDetails_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe POSIX
a -> DataCollectionDetails
s {$sel:startTime:DataCollectionDetails' :: Maybe POSIX
startTime = Maybe POSIX
a} :: DataCollectionDetails) 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 status of the assessment.
dataCollectionDetails_status :: Lens.Lens' DataCollectionDetails (Prelude.Maybe AssessmentStatus)
dataCollectionDetails_status :: Lens' DataCollectionDetails (Maybe AssessmentStatus)
dataCollectionDetails_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe AssessmentStatus
status :: Maybe AssessmentStatus
$sel:status:DataCollectionDetails' :: DataCollectionDetails -> Maybe AssessmentStatus
status} -> Maybe AssessmentStatus
status) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe AssessmentStatus
a -> DataCollectionDetails
s {$sel:status:DataCollectionDetails' :: Maybe AssessmentStatus
status = Maybe AssessmentStatus
a} :: DataCollectionDetails)

-- | The status message of the assessment.
dataCollectionDetails_statusMessage :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.Text)
dataCollectionDetails_statusMessage :: Lens' DataCollectionDetails (Maybe Text)
dataCollectionDetails_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:DataCollectionDetails' :: DataCollectionDetails -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe Text
a -> DataCollectionDetails
s {$sel:statusMessage:DataCollectionDetails' :: Maybe Text
statusMessage = Maybe Text
a} :: DataCollectionDetails)

-- | The number of successful servers in the assessment.
dataCollectionDetails_success :: Lens.Lens' DataCollectionDetails (Prelude.Maybe Prelude.Int)
dataCollectionDetails_success :: Lens' DataCollectionDetails (Maybe Int)
dataCollectionDetails_success = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCollectionDetails' {Maybe Int
success :: Maybe Int
$sel:success:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
success} -> Maybe Int
success) (\s :: DataCollectionDetails
s@DataCollectionDetails' {} Maybe Int
a -> DataCollectionDetails
s {$sel:success:DataCollectionDetails' :: Maybe Int
success = Maybe Int
a} :: DataCollectionDetails)

instance Data.FromJSON DataCollectionDetails where
  parseJSON :: Value -> Parser DataCollectionDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DataCollectionDetails"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe POSIX
-> Maybe AssessmentStatus
-> Maybe Text
-> Maybe Int
-> DataCollectionDetails
DataCollectionDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"completionTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failed")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inProgress")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"servers")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"startTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"success")
      )

instance Prelude.Hashable DataCollectionDetails where
  hashWithSalt :: Int -> DataCollectionDetails -> Int
hashWithSalt Int
_salt DataCollectionDetails' {Maybe Int
Maybe Text
Maybe POSIX
Maybe AssessmentStatus
success :: Maybe Int
statusMessage :: Maybe Text
status :: Maybe AssessmentStatus
startTime :: Maybe POSIX
servers :: Maybe Int
inProgress :: Maybe Int
failed :: Maybe Int
completionTime :: Maybe POSIX
$sel:success:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:statusMessage:DataCollectionDetails' :: DataCollectionDetails -> Maybe Text
$sel:status:DataCollectionDetails' :: DataCollectionDetails -> Maybe AssessmentStatus
$sel:startTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
$sel:servers:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:inProgress:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:failed:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:completionTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
completionTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
failed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
inProgress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
servers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssessmentStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
success

instance Prelude.NFData DataCollectionDetails where
  rnf :: DataCollectionDetails -> ()
rnf DataCollectionDetails' {Maybe Int
Maybe Text
Maybe POSIX
Maybe AssessmentStatus
success :: Maybe Int
statusMessage :: Maybe Text
status :: Maybe AssessmentStatus
startTime :: Maybe POSIX
servers :: Maybe Int
inProgress :: Maybe Int
failed :: Maybe Int
completionTime :: Maybe POSIX
$sel:success:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:statusMessage:DataCollectionDetails' :: DataCollectionDetails -> Maybe Text
$sel:status:DataCollectionDetails' :: DataCollectionDetails -> Maybe AssessmentStatus
$sel:startTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
$sel:servers:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:inProgress:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:failed:DataCollectionDetails' :: DataCollectionDetails -> Maybe Int
$sel:completionTime:DataCollectionDetails' :: DataCollectionDetails -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
completionTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
failed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
inProgress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
servers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssessmentStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
success