{-# 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.OpsWorks.Types.AutoScalingThresholds where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AutoScalingThresholds = AutoScalingThresholds'
{
AutoScalingThresholds -> Maybe [Text]
alarms :: Prelude.Maybe [Prelude.Text],
AutoScalingThresholds -> Maybe Double
cpuThreshold :: Prelude.Maybe Prelude.Double,
AutoScalingThresholds -> Maybe Natural
ignoreMetricsTime :: Prelude.Maybe Prelude.Natural,
AutoScalingThresholds -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
AutoScalingThresholds -> Maybe Double
loadThreshold :: Prelude.Maybe Prelude.Double,
AutoScalingThresholds -> Maybe Double
memoryThreshold :: Prelude.Maybe Prelude.Double,
AutoScalingThresholds -> Maybe Natural
thresholdsWaitTime :: Prelude.Maybe Prelude.Natural
}
deriving (AutoScalingThresholds -> AutoScalingThresholds -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
$c/= :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
== :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
$c== :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
Prelude.Eq, ReadPrec [AutoScalingThresholds]
ReadPrec AutoScalingThresholds
Int -> ReadS AutoScalingThresholds
ReadS [AutoScalingThresholds]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingThresholds]
$creadListPrec :: ReadPrec [AutoScalingThresholds]
readPrec :: ReadPrec AutoScalingThresholds
$creadPrec :: ReadPrec AutoScalingThresholds
readList :: ReadS [AutoScalingThresholds]
$creadList :: ReadS [AutoScalingThresholds]
readsPrec :: Int -> ReadS AutoScalingThresholds
$creadsPrec :: Int -> ReadS AutoScalingThresholds
Prelude.Read, Int -> AutoScalingThresholds -> ShowS
[AutoScalingThresholds] -> ShowS
AutoScalingThresholds -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingThresholds] -> ShowS
$cshowList :: [AutoScalingThresholds] -> ShowS
show :: AutoScalingThresholds -> String
$cshow :: AutoScalingThresholds -> String
showsPrec :: Int -> AutoScalingThresholds -> ShowS
$cshowsPrec :: Int -> AutoScalingThresholds -> ShowS
Prelude.Show, forall x. Rep AutoScalingThresholds x -> AutoScalingThresholds
forall x. AutoScalingThresholds -> Rep AutoScalingThresholds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoScalingThresholds x -> AutoScalingThresholds
$cfrom :: forall x. AutoScalingThresholds -> Rep AutoScalingThresholds x
Prelude.Generic)
newAutoScalingThresholds ::
AutoScalingThresholds
newAutoScalingThresholds :: AutoScalingThresholds
newAutoScalingThresholds =
AutoScalingThresholds'
{ $sel:alarms:AutoScalingThresholds' :: Maybe [Text]
alarms = forall a. Maybe a
Prelude.Nothing,
$sel:cpuThreshold:AutoScalingThresholds' :: Maybe Double
cpuThreshold = forall a. Maybe a
Prelude.Nothing,
$sel:ignoreMetricsTime:AutoScalingThresholds' :: Maybe Natural
ignoreMetricsTime = forall a. Maybe a
Prelude.Nothing,
$sel:instanceCount:AutoScalingThresholds' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
$sel:loadThreshold:AutoScalingThresholds' :: Maybe Double
loadThreshold = forall a. Maybe a
Prelude.Nothing,
$sel:memoryThreshold:AutoScalingThresholds' :: Maybe Double
memoryThreshold = forall a. Maybe a
Prelude.Nothing,
$sel:thresholdsWaitTime:AutoScalingThresholds' :: Maybe Natural
thresholdsWaitTime = forall a. Maybe a
Prelude.Nothing
}
autoScalingThresholds_alarms :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe [Prelude.Text])
autoScalingThresholds_alarms :: Lens' AutoScalingThresholds (Maybe [Text])
autoScalingThresholds_alarms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe [Text]
alarms :: Maybe [Text]
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
alarms} -> Maybe [Text]
alarms) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe [Text]
a -> AutoScalingThresholds
s {$sel:alarms:AutoScalingThresholds' :: Maybe [Text]
alarms = Maybe [Text]
a} :: AutoScalingThresholds) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
autoScalingThresholds_cpuThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_cpuThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_cpuThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
cpuThreshold :: Maybe Double
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
cpuThreshold} -> Maybe Double
cpuThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:cpuThreshold:AutoScalingThresholds' :: Maybe Double
cpuThreshold = Maybe Double
a} :: AutoScalingThresholds)
autoScalingThresholds_ignoreMetricsTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_ignoreMetricsTime :: Lens' AutoScalingThresholds (Maybe Natural)
autoScalingThresholds_ignoreMetricsTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Natural
ignoreMetricsTime :: Maybe Natural
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
ignoreMetricsTime} -> Maybe Natural
ignoreMetricsTime) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Natural
a -> AutoScalingThresholds
s {$sel:ignoreMetricsTime:AutoScalingThresholds' :: Maybe Natural
ignoreMetricsTime = Maybe Natural
a} :: AutoScalingThresholds)
autoScalingThresholds_instanceCount :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Int)
autoScalingThresholds_instanceCount :: Lens' AutoScalingThresholds (Maybe Int)
autoScalingThresholds_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Int
a -> AutoScalingThresholds
s {$sel:instanceCount:AutoScalingThresholds' :: Maybe Int
instanceCount = Maybe Int
a} :: AutoScalingThresholds)
autoScalingThresholds_loadThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_loadThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_loadThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
loadThreshold :: Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
loadThreshold} -> Maybe Double
loadThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:loadThreshold:AutoScalingThresholds' :: Maybe Double
loadThreshold = Maybe Double
a} :: AutoScalingThresholds)
autoScalingThresholds_memoryThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_memoryThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_memoryThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
memoryThreshold :: Maybe Double
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
memoryThreshold} -> Maybe Double
memoryThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:memoryThreshold:AutoScalingThresholds' :: Maybe Double
memoryThreshold = Maybe Double
a} :: AutoScalingThresholds)
autoScalingThresholds_thresholdsWaitTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_thresholdsWaitTime :: Lens' AutoScalingThresholds (Maybe Natural)
autoScalingThresholds_thresholdsWaitTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Natural
thresholdsWaitTime :: Maybe Natural
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
thresholdsWaitTime} -> Maybe Natural
thresholdsWaitTime) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Natural
a -> AutoScalingThresholds
s {$sel:thresholdsWaitTime:AutoScalingThresholds' :: Maybe Natural
thresholdsWaitTime = Maybe Natural
a} :: AutoScalingThresholds)
instance Data.FromJSON AutoScalingThresholds where
parseJSON :: Value -> Parser AutoScalingThresholds
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutoScalingThresholds"
( \Object
x ->
Maybe [Text]
-> Maybe Double
-> Maybe Natural
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Natural
-> AutoScalingThresholds
AutoScalingThresholds'
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
"Alarms" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"CpuThreshold")
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
"IgnoreMetricsTime")
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
"InstanceCount")
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
"LoadThreshold")
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
"MemoryThreshold")
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
"ThresholdsWaitTime")
)
instance Prelude.Hashable AutoScalingThresholds where
hashWithSalt :: Int -> AutoScalingThresholds -> Int
hashWithSalt Int
_salt AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
alarms
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
cpuThreshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
ignoreMetricsTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
loadThreshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
memoryThreshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
thresholdsWaitTime
instance Prelude.NFData AutoScalingThresholds where
rnf :: AutoScalingThresholds -> ()
rnf AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
alarms
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
cpuThreshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
ignoreMetricsTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
loadThreshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
memoryThreshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
thresholdsWaitTime
instance Data.ToJSON AutoScalingThresholds where
toJSON :: AutoScalingThresholds -> Value
toJSON AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Alarms" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
alarms,
(Key
"CpuThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
cpuThreshold,
(Key
"IgnoreMetricsTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
ignoreMetricsTime,
(Key
"InstanceCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instanceCount,
(Key
"LoadThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
loadThreshold,
(Key
"MemoryThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
memoryThreshold,
(Key
"ThresholdsWaitTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thresholdsWaitTime
]
)