{-# 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.ApplicationAggregatedStatus
-- 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.ApplicationAggregatedStatus 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.ApplicationHealthStatus
import Amazonka.MGN.Types.ApplicationProgressStatus
import qualified Amazonka.Prelude as Prelude

-- | Application aggregated status.
--
-- /See:/ 'newApplicationAggregatedStatus' smart constructor.
data ApplicationAggregatedStatus = ApplicationAggregatedStatus'
  { -- | Application aggregated status health status.
    ApplicationAggregatedStatus -> Maybe ApplicationHealthStatus
healthStatus :: Prelude.Maybe ApplicationHealthStatus,
    -- | Application aggregated status last update dateTime.
    ApplicationAggregatedStatus -> Maybe Text
lastUpdateDateTime :: Prelude.Maybe Prelude.Text,
    -- | Application aggregated status progress status.
    ApplicationAggregatedStatus -> Maybe ApplicationProgressStatus
progressStatus :: Prelude.Maybe ApplicationProgressStatus,
    -- | Application aggregated status total source servers amount.
    ApplicationAggregatedStatus -> Maybe Natural
totalSourceServers :: Prelude.Maybe Prelude.Natural
  }
  deriving (ApplicationAggregatedStatus -> ApplicationAggregatedStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationAggregatedStatus -> ApplicationAggregatedStatus -> Bool
$c/= :: ApplicationAggregatedStatus -> ApplicationAggregatedStatus -> Bool
== :: ApplicationAggregatedStatus -> ApplicationAggregatedStatus -> Bool
$c== :: ApplicationAggregatedStatus -> ApplicationAggregatedStatus -> Bool
Prelude.Eq, ReadPrec [ApplicationAggregatedStatus]
ReadPrec ApplicationAggregatedStatus
Int -> ReadS ApplicationAggregatedStatus
ReadS [ApplicationAggregatedStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationAggregatedStatus]
$creadListPrec :: ReadPrec [ApplicationAggregatedStatus]
readPrec :: ReadPrec ApplicationAggregatedStatus
$creadPrec :: ReadPrec ApplicationAggregatedStatus
readList :: ReadS [ApplicationAggregatedStatus]
$creadList :: ReadS [ApplicationAggregatedStatus]
readsPrec :: Int -> ReadS ApplicationAggregatedStatus
$creadsPrec :: Int -> ReadS ApplicationAggregatedStatus
Prelude.Read, Int -> ApplicationAggregatedStatus -> ShowS
[ApplicationAggregatedStatus] -> ShowS
ApplicationAggregatedStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationAggregatedStatus] -> ShowS
$cshowList :: [ApplicationAggregatedStatus] -> ShowS
show :: ApplicationAggregatedStatus -> String
$cshow :: ApplicationAggregatedStatus -> String
showsPrec :: Int -> ApplicationAggregatedStatus -> ShowS
$cshowsPrec :: Int -> ApplicationAggregatedStatus -> ShowS
Prelude.Show, forall x.
Rep ApplicationAggregatedStatus x -> ApplicationAggregatedStatus
forall x.
ApplicationAggregatedStatus -> Rep ApplicationAggregatedStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationAggregatedStatus x -> ApplicationAggregatedStatus
$cfrom :: forall x.
ApplicationAggregatedStatus -> Rep ApplicationAggregatedStatus x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationAggregatedStatus' 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', 'applicationAggregatedStatus_healthStatus' - Application aggregated status health status.
--
-- 'lastUpdateDateTime', 'applicationAggregatedStatus_lastUpdateDateTime' - Application aggregated status last update dateTime.
--
-- 'progressStatus', 'applicationAggregatedStatus_progressStatus' - Application aggregated status progress status.
--
-- 'totalSourceServers', 'applicationAggregatedStatus_totalSourceServers' - Application aggregated status total source servers amount.
newApplicationAggregatedStatus ::
  ApplicationAggregatedStatus
newApplicationAggregatedStatus :: ApplicationAggregatedStatus
newApplicationAggregatedStatus =
  ApplicationAggregatedStatus'
    { $sel:healthStatus:ApplicationAggregatedStatus' :: Maybe ApplicationHealthStatus
healthStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateDateTime:ApplicationAggregatedStatus' :: Maybe Text
lastUpdateDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:progressStatus:ApplicationAggregatedStatus' :: Maybe ApplicationProgressStatus
progressStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:totalSourceServers:ApplicationAggregatedStatus' :: Maybe Natural
totalSourceServers = forall a. Maybe a
Prelude.Nothing
    }

-- | Application aggregated status health status.
applicationAggregatedStatus_healthStatus :: Lens.Lens' ApplicationAggregatedStatus (Prelude.Maybe ApplicationHealthStatus)
applicationAggregatedStatus_healthStatus :: Lens' ApplicationAggregatedStatus (Maybe ApplicationHealthStatus)
applicationAggregatedStatus_healthStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationAggregatedStatus' {Maybe ApplicationHealthStatus
healthStatus :: Maybe ApplicationHealthStatus
$sel:healthStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationHealthStatus
healthStatus} -> Maybe ApplicationHealthStatus
healthStatus) (\s :: ApplicationAggregatedStatus
s@ApplicationAggregatedStatus' {} Maybe ApplicationHealthStatus
a -> ApplicationAggregatedStatus
s {$sel:healthStatus:ApplicationAggregatedStatus' :: Maybe ApplicationHealthStatus
healthStatus = Maybe ApplicationHealthStatus
a} :: ApplicationAggregatedStatus)

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

-- | Application aggregated status progress status.
applicationAggregatedStatus_progressStatus :: Lens.Lens' ApplicationAggregatedStatus (Prelude.Maybe ApplicationProgressStatus)
applicationAggregatedStatus_progressStatus :: Lens' ApplicationAggregatedStatus (Maybe ApplicationProgressStatus)
applicationAggregatedStatus_progressStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationAggregatedStatus' {Maybe ApplicationProgressStatus
progressStatus :: Maybe ApplicationProgressStatus
$sel:progressStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationProgressStatus
progressStatus} -> Maybe ApplicationProgressStatus
progressStatus) (\s :: ApplicationAggregatedStatus
s@ApplicationAggregatedStatus' {} Maybe ApplicationProgressStatus
a -> ApplicationAggregatedStatus
s {$sel:progressStatus:ApplicationAggregatedStatus' :: Maybe ApplicationProgressStatus
progressStatus = Maybe ApplicationProgressStatus
a} :: ApplicationAggregatedStatus)

-- | Application aggregated status total source servers amount.
applicationAggregatedStatus_totalSourceServers :: Lens.Lens' ApplicationAggregatedStatus (Prelude.Maybe Prelude.Natural)
applicationAggregatedStatus_totalSourceServers :: Lens' ApplicationAggregatedStatus (Maybe Natural)
applicationAggregatedStatus_totalSourceServers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationAggregatedStatus' {Maybe Natural
totalSourceServers :: Maybe Natural
$sel:totalSourceServers:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe Natural
totalSourceServers} -> Maybe Natural
totalSourceServers) (\s :: ApplicationAggregatedStatus
s@ApplicationAggregatedStatus' {} Maybe Natural
a -> ApplicationAggregatedStatus
s {$sel:totalSourceServers:ApplicationAggregatedStatus' :: Maybe Natural
totalSourceServers = Maybe Natural
a} :: ApplicationAggregatedStatus)

instance Data.FromJSON ApplicationAggregatedStatus where
  parseJSON :: Value -> Parser ApplicationAggregatedStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationAggregatedStatus"
      ( \Object
x ->
          Maybe ApplicationHealthStatus
-> Maybe Text
-> Maybe ApplicationProgressStatus
-> Maybe Natural
-> ApplicationAggregatedStatus
ApplicationAggregatedStatus'
            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
"totalSourceServers")
      )

instance Prelude.Hashable ApplicationAggregatedStatus where
  hashWithSalt :: Int -> ApplicationAggregatedStatus -> Int
hashWithSalt Int
_salt ApplicationAggregatedStatus' {Maybe Natural
Maybe Text
Maybe ApplicationHealthStatus
Maybe ApplicationProgressStatus
totalSourceServers :: Maybe Natural
progressStatus :: Maybe ApplicationProgressStatus
lastUpdateDateTime :: Maybe Text
healthStatus :: Maybe ApplicationHealthStatus
$sel:totalSourceServers:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe Natural
$sel:progressStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationProgressStatus
$sel:lastUpdateDateTime:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe Text
$sel:healthStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationHealthStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationHealthStatus
healthStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdateDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationProgressStatus
progressStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
totalSourceServers

instance Prelude.NFData ApplicationAggregatedStatus where
  rnf :: ApplicationAggregatedStatus -> ()
rnf ApplicationAggregatedStatus' {Maybe Natural
Maybe Text
Maybe ApplicationHealthStatus
Maybe ApplicationProgressStatus
totalSourceServers :: Maybe Natural
progressStatus :: Maybe ApplicationProgressStatus
lastUpdateDateTime :: Maybe Text
healthStatus :: Maybe ApplicationHealthStatus
$sel:totalSourceServers:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe Natural
$sel:progressStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationProgressStatus
$sel:lastUpdateDateTime:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe Text
$sel:healthStatus:ApplicationAggregatedStatus' :: ApplicationAggregatedStatus -> Maybe ApplicationHealthStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ApplicationHealthStatus
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 ApplicationProgressStatus
progressStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
totalSourceServers