{-# 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.MGN.Types.WaveAggregatedStatus
-- 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.MGN.Types.WaveAggregatedStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MGN.Types.WaveHealthStatus
import Amazonka.MGN.Types.WaveProgressStatus
import qualified Amazonka.Prelude as Prelude

-- | Wave aggregated status.
--
-- /See:/ 'newWaveAggregatedStatus' smart constructor.
data WaveAggregatedStatus = WaveAggregatedStatus'
  { -- | Wave aggregated status health status.
    WaveAggregatedStatus -> Maybe WaveHealthStatus
healthStatus :: Prelude.Maybe WaveHealthStatus,
    -- | Wave aggregated status last update dateTime.
    WaveAggregatedStatus -> Maybe Text
lastUpdateDateTime :: Prelude.Maybe Prelude.Text,
    -- | Wave aggregated status progress status.
    WaveAggregatedStatus -> Maybe WaveProgressStatus
progressStatus :: Prelude.Maybe WaveProgressStatus,
    -- | DateTime marking when the first source server in the wave started
    -- replication.
    WaveAggregatedStatus -> Maybe Text
replicationStartedDateTime :: Prelude.Maybe Prelude.Text,
    -- | Wave aggregated status total applications amount.
    WaveAggregatedStatus -> Maybe Natural
totalApplications :: Prelude.Maybe Prelude.Natural
  }
  deriving (WaveAggregatedStatus -> WaveAggregatedStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaveAggregatedStatus -> WaveAggregatedStatus -> Bool
$c/= :: WaveAggregatedStatus -> WaveAggregatedStatus -> Bool
== :: WaveAggregatedStatus -> WaveAggregatedStatus -> Bool
$c== :: WaveAggregatedStatus -> WaveAggregatedStatus -> Bool
Prelude.Eq, ReadPrec [WaveAggregatedStatus]
ReadPrec WaveAggregatedStatus
Int -> ReadS WaveAggregatedStatus
ReadS [WaveAggregatedStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WaveAggregatedStatus]
$creadListPrec :: ReadPrec [WaveAggregatedStatus]
readPrec :: ReadPrec WaveAggregatedStatus
$creadPrec :: ReadPrec WaveAggregatedStatus
readList :: ReadS [WaveAggregatedStatus]
$creadList :: ReadS [WaveAggregatedStatus]
readsPrec :: Int -> ReadS WaveAggregatedStatus
$creadsPrec :: Int -> ReadS WaveAggregatedStatus
Prelude.Read, Int -> WaveAggregatedStatus -> ShowS
[WaveAggregatedStatus] -> ShowS
WaveAggregatedStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WaveAggregatedStatus] -> ShowS
$cshowList :: [WaveAggregatedStatus] -> ShowS
show :: WaveAggregatedStatus -> String
$cshow :: WaveAggregatedStatus -> String
showsPrec :: Int -> WaveAggregatedStatus -> ShowS
$cshowsPrec :: Int -> WaveAggregatedStatus -> ShowS
Prelude.Show, forall x. Rep WaveAggregatedStatus x -> WaveAggregatedStatus
forall x. WaveAggregatedStatus -> Rep WaveAggregatedStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WaveAggregatedStatus x -> WaveAggregatedStatus
$cfrom :: forall x. WaveAggregatedStatus -> Rep WaveAggregatedStatus x
Prelude.Generic)

-- |
-- Create a value of 'WaveAggregatedStatus' 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:
--
-- 'healthStatus', 'waveAggregatedStatus_healthStatus' - Wave aggregated status health status.
--
-- 'lastUpdateDateTime', 'waveAggregatedStatus_lastUpdateDateTime' - Wave aggregated status last update dateTime.
--
-- 'progressStatus', 'waveAggregatedStatus_progressStatus' - Wave aggregated status progress status.
--
-- 'replicationStartedDateTime', 'waveAggregatedStatus_replicationStartedDateTime' - DateTime marking when the first source server in the wave started
-- replication.
--
-- 'totalApplications', 'waveAggregatedStatus_totalApplications' - Wave aggregated status total applications amount.
newWaveAggregatedStatus ::
  WaveAggregatedStatus
newWaveAggregatedStatus :: WaveAggregatedStatus
newWaveAggregatedStatus =
  WaveAggregatedStatus'
    { $sel:healthStatus:WaveAggregatedStatus' :: Maybe WaveHealthStatus
healthStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateDateTime:WaveAggregatedStatus' :: Maybe Text
lastUpdateDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:progressStatus:WaveAggregatedStatus' :: Maybe WaveProgressStatus
progressStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationStartedDateTime:WaveAggregatedStatus' :: Maybe Text
replicationStartedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:totalApplications:WaveAggregatedStatus' :: Maybe Natural
totalApplications = forall a. Maybe a
Prelude.Nothing
    }

-- | Wave aggregated status health status.
waveAggregatedStatus_healthStatus :: Lens.Lens' WaveAggregatedStatus (Prelude.Maybe WaveHealthStatus)
waveAggregatedStatus_healthStatus :: Lens' WaveAggregatedStatus (Maybe WaveHealthStatus)
waveAggregatedStatus_healthStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaveAggregatedStatus' {Maybe WaveHealthStatus
healthStatus :: Maybe WaveHealthStatus
$sel:healthStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveHealthStatus
healthStatus} -> Maybe WaveHealthStatus
healthStatus) (\s :: WaveAggregatedStatus
s@WaveAggregatedStatus' {} Maybe WaveHealthStatus
a -> WaveAggregatedStatus
s {$sel:healthStatus:WaveAggregatedStatus' :: Maybe WaveHealthStatus
healthStatus = Maybe WaveHealthStatus
a} :: WaveAggregatedStatus)

-- | Wave aggregated status last update dateTime.
waveAggregatedStatus_lastUpdateDateTime :: Lens.Lens' WaveAggregatedStatus (Prelude.Maybe Prelude.Text)
waveAggregatedStatus_lastUpdateDateTime :: Lens' WaveAggregatedStatus (Maybe Text)
waveAggregatedStatus_lastUpdateDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaveAggregatedStatus' {Maybe Text
lastUpdateDateTime :: Maybe Text
$sel:lastUpdateDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
lastUpdateDateTime} -> Maybe Text
lastUpdateDateTime) (\s :: WaveAggregatedStatus
s@WaveAggregatedStatus' {} Maybe Text
a -> WaveAggregatedStatus
s {$sel:lastUpdateDateTime:WaveAggregatedStatus' :: Maybe Text
lastUpdateDateTime = Maybe Text
a} :: WaveAggregatedStatus)

-- | Wave aggregated status progress status.
waveAggregatedStatus_progressStatus :: Lens.Lens' WaveAggregatedStatus (Prelude.Maybe WaveProgressStatus)
waveAggregatedStatus_progressStatus :: Lens' WaveAggregatedStatus (Maybe WaveProgressStatus)
waveAggregatedStatus_progressStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaveAggregatedStatus' {Maybe WaveProgressStatus
progressStatus :: Maybe WaveProgressStatus
$sel:progressStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveProgressStatus
progressStatus} -> Maybe WaveProgressStatus
progressStatus) (\s :: WaveAggregatedStatus
s@WaveAggregatedStatus' {} Maybe WaveProgressStatus
a -> WaveAggregatedStatus
s {$sel:progressStatus:WaveAggregatedStatus' :: Maybe WaveProgressStatus
progressStatus = Maybe WaveProgressStatus
a} :: WaveAggregatedStatus)

-- | DateTime marking when the first source server in the wave started
-- replication.
waveAggregatedStatus_replicationStartedDateTime :: Lens.Lens' WaveAggregatedStatus (Prelude.Maybe Prelude.Text)
waveAggregatedStatus_replicationStartedDateTime :: Lens' WaveAggregatedStatus (Maybe Text)
waveAggregatedStatus_replicationStartedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaveAggregatedStatus' {Maybe Text
replicationStartedDateTime :: Maybe Text
$sel:replicationStartedDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
replicationStartedDateTime} -> Maybe Text
replicationStartedDateTime) (\s :: WaveAggregatedStatus
s@WaveAggregatedStatus' {} Maybe Text
a -> WaveAggregatedStatus
s {$sel:replicationStartedDateTime:WaveAggregatedStatus' :: Maybe Text
replicationStartedDateTime = Maybe Text
a} :: WaveAggregatedStatus)

-- | Wave aggregated status total applications amount.
waveAggregatedStatus_totalApplications :: Lens.Lens' WaveAggregatedStatus (Prelude.Maybe Prelude.Natural)
waveAggregatedStatus_totalApplications :: Lens' WaveAggregatedStatus (Maybe Natural)
waveAggregatedStatus_totalApplications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaveAggregatedStatus' {Maybe Natural
totalApplications :: Maybe Natural
$sel:totalApplications:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Natural
totalApplications} -> Maybe Natural
totalApplications) (\s :: WaveAggregatedStatus
s@WaveAggregatedStatus' {} Maybe Natural
a -> WaveAggregatedStatus
s {$sel:totalApplications:WaveAggregatedStatus' :: Maybe Natural
totalApplications = Maybe Natural
a} :: WaveAggregatedStatus)

instance Data.FromJSON WaveAggregatedStatus where
  parseJSON :: Value -> Parser WaveAggregatedStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WaveAggregatedStatus"
      ( \Object
x ->
          Maybe WaveHealthStatus
-> Maybe Text
-> Maybe WaveProgressStatus
-> Maybe Text
-> Maybe Natural
-> WaveAggregatedStatus
WaveAggregatedStatus'
            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
"healthStatus")
            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
"lastUpdateDateTime")
            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
"progressStatus")
            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
"replicationStartedDateTime")
            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
"totalApplications")
      )

instance Prelude.Hashable WaveAggregatedStatus where
  hashWithSalt :: Int -> WaveAggregatedStatus -> Int
hashWithSalt Int
_salt WaveAggregatedStatus' {Maybe Natural
Maybe Text
Maybe WaveHealthStatus
Maybe WaveProgressStatus
totalApplications :: Maybe Natural
replicationStartedDateTime :: Maybe Text
progressStatus :: Maybe WaveProgressStatus
lastUpdateDateTime :: Maybe Text
healthStatus :: Maybe WaveHealthStatus
$sel:totalApplications:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Natural
$sel:replicationStartedDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
$sel:progressStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveProgressStatus
$sel:lastUpdateDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
$sel:healthStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveHealthStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WaveHealthStatus
healthStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdateDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WaveProgressStatus
progressStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationStartedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
totalApplications

instance Prelude.NFData WaveAggregatedStatus where
  rnf :: WaveAggregatedStatus -> ()
rnf WaveAggregatedStatus' {Maybe Natural
Maybe Text
Maybe WaveHealthStatus
Maybe WaveProgressStatus
totalApplications :: Maybe Natural
replicationStartedDateTime :: Maybe Text
progressStatus :: Maybe WaveProgressStatus
lastUpdateDateTime :: Maybe Text
healthStatus :: Maybe WaveHealthStatus
$sel:totalApplications:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Natural
$sel:replicationStartedDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
$sel:progressStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveProgressStatus
$sel:lastUpdateDateTime:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe Text
$sel:healthStatus:WaveAggregatedStatus' :: WaveAggregatedStatus -> Maybe WaveHealthStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe WaveHealthStatus
healthStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastUpdateDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WaveProgressStatus
progressStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationStartedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
totalApplications