{-# 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 #-}
module Amazonka.ElasticBeanstalk.Types.SystemStatus where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.CPUUtilization
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SystemStatus = SystemStatus'
{
SystemStatus -> Maybe CPUUtilization
cPUUtilization :: Prelude.Maybe CPUUtilization,
SystemStatus -> Maybe [Double]
loadAverage :: Prelude.Maybe [Prelude.Double]
}
deriving (SystemStatus -> SystemStatus -> Bool
(SystemStatus -> SystemStatus -> Bool)
-> (SystemStatus -> SystemStatus -> Bool) -> Eq SystemStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemStatus -> SystemStatus -> Bool
$c/= :: SystemStatus -> SystemStatus -> Bool
== :: SystemStatus -> SystemStatus -> Bool
$c== :: SystemStatus -> SystemStatus -> Bool
Prelude.Eq, ReadPrec [SystemStatus]
ReadPrec SystemStatus
Int -> ReadS SystemStatus
ReadS [SystemStatus]
(Int -> ReadS SystemStatus)
-> ReadS [SystemStatus]
-> ReadPrec SystemStatus
-> ReadPrec [SystemStatus]
-> Read SystemStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SystemStatus]
$creadListPrec :: ReadPrec [SystemStatus]
readPrec :: ReadPrec SystemStatus
$creadPrec :: ReadPrec SystemStatus
readList :: ReadS [SystemStatus]
$creadList :: ReadS [SystemStatus]
readsPrec :: Int -> ReadS SystemStatus
$creadsPrec :: Int -> ReadS SystemStatus
Prelude.Read, Int -> SystemStatus -> ShowS
[SystemStatus] -> ShowS
SystemStatus -> String
(Int -> SystemStatus -> ShowS)
-> (SystemStatus -> String)
-> ([SystemStatus] -> ShowS)
-> Show SystemStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SystemStatus] -> ShowS
$cshowList :: [SystemStatus] -> ShowS
show :: SystemStatus -> String
$cshow :: SystemStatus -> String
showsPrec :: Int -> SystemStatus -> ShowS
$cshowsPrec :: Int -> SystemStatus -> ShowS
Prelude.Show, (forall x. SystemStatus -> Rep SystemStatus x)
-> (forall x. Rep SystemStatus x -> SystemStatus)
-> Generic SystemStatus
forall x. Rep SystemStatus x -> SystemStatus
forall x. SystemStatus -> Rep SystemStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SystemStatus x -> SystemStatus
$cfrom :: forall x. SystemStatus -> Rep SystemStatus x
Prelude.Generic)
newSystemStatus ::
SystemStatus
newSystemStatus :: SystemStatus
newSystemStatus =
SystemStatus' :: Maybe CPUUtilization -> Maybe [Double] -> SystemStatus
SystemStatus'
{ $sel:cPUUtilization:SystemStatus' :: Maybe CPUUtilization
cPUUtilization = Maybe CPUUtilization
forall a. Maybe a
Prelude.Nothing,
$sel:loadAverage:SystemStatus' :: Maybe [Double]
loadAverage = Maybe [Double]
forall a. Maybe a
Prelude.Nothing
}
systemStatus_cPUUtilization :: Lens.Lens' SystemStatus (Prelude.Maybe CPUUtilization)
systemStatus_cPUUtilization :: (Maybe CPUUtilization -> f (Maybe CPUUtilization))
-> SystemStatus -> f SystemStatus
systemStatus_cPUUtilization = (SystemStatus -> Maybe CPUUtilization)
-> (SystemStatus -> Maybe CPUUtilization -> SystemStatus)
-> Lens
SystemStatus
SystemStatus
(Maybe CPUUtilization)
(Maybe CPUUtilization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemStatus' {Maybe CPUUtilization
cPUUtilization :: Maybe CPUUtilization
$sel:cPUUtilization:SystemStatus' :: SystemStatus -> Maybe CPUUtilization
cPUUtilization} -> Maybe CPUUtilization
cPUUtilization) (\s :: SystemStatus
s@SystemStatus' {} Maybe CPUUtilization
a -> SystemStatus
s {$sel:cPUUtilization:SystemStatus' :: Maybe CPUUtilization
cPUUtilization = Maybe CPUUtilization
a} :: SystemStatus)
systemStatus_loadAverage :: Lens.Lens' SystemStatus (Prelude.Maybe [Prelude.Double])
systemStatus_loadAverage :: (Maybe [Double] -> f (Maybe [Double]))
-> SystemStatus -> f SystemStatus
systemStatus_loadAverage = (SystemStatus -> Maybe [Double])
-> (SystemStatus -> Maybe [Double] -> SystemStatus)
-> Lens SystemStatus SystemStatus (Maybe [Double]) (Maybe [Double])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemStatus' {Maybe [Double]
loadAverage :: Maybe [Double]
$sel:loadAverage:SystemStatus' :: SystemStatus -> Maybe [Double]
loadAverage} -> Maybe [Double]
loadAverage) (\s :: SystemStatus
s@SystemStatus' {} Maybe [Double]
a -> SystemStatus
s {$sel:loadAverage:SystemStatus' :: Maybe [Double]
loadAverage = Maybe [Double]
a} :: SystemStatus) ((Maybe [Double] -> f (Maybe [Double]))
-> SystemStatus -> f SystemStatus)
-> ((Maybe [Double] -> f (Maybe [Double]))
-> Maybe [Double] -> f (Maybe [Double]))
-> (Maybe [Double] -> f (Maybe [Double]))
-> SystemStatus
-> f SystemStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Double] [Double] [Double] [Double]
-> Iso
(Maybe [Double]) (Maybe [Double]) (Maybe [Double]) (Maybe [Double])
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 [Double] [Double] [Double] [Double]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML SystemStatus where
parseXML :: [Node] -> Either String SystemStatus
parseXML [Node]
x =
Maybe CPUUtilization -> Maybe [Double] -> SystemStatus
SystemStatus'
(Maybe CPUUtilization -> Maybe [Double] -> SystemStatus)
-> Either String (Maybe CPUUtilization)
-> Either String (Maybe [Double] -> SystemStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe CPUUtilization)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CPUUtilization")
Either String (Maybe [Double] -> SystemStatus)
-> Either String (Maybe [Double]) -> Either String SystemStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LoadAverage" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Double]))
-> Either String (Maybe [Double])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Double])
-> [Node] -> Either String (Maybe [Double])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Double]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
instance Prelude.Hashable SystemStatus
instance Prelude.NFData SystemStatus