{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoScalingThresholds = AutoScalingThresholds'
{
AutoScalingThresholds -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
AutoScalingThresholds -> Maybe Natural
ignoreMetricsTime :: Prelude.Maybe Prelude.Natural,
AutoScalingThresholds -> Maybe Double
loadThreshold :: Prelude.Maybe Prelude.Double,
AutoScalingThresholds -> Maybe Natural
thresholdsWaitTime :: Prelude.Maybe Prelude.Natural,
AutoScalingThresholds -> Maybe [Text]
alarms :: Prelude.Maybe [Prelude.Text],
AutoScalingThresholds -> Maybe Double
memoryThreshold :: Prelude.Maybe Prelude.Double,
AutoScalingThresholds -> Maybe Double
cpuThreshold :: Prelude.Maybe Prelude.Double
}
deriving (AutoScalingThresholds -> AutoScalingThresholds -> Bool
(AutoScalingThresholds -> AutoScalingThresholds -> Bool)
-> (AutoScalingThresholds -> AutoScalingThresholds -> Bool)
-> Eq AutoScalingThresholds
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]
(Int -> ReadS AutoScalingThresholds)
-> ReadS [AutoScalingThresholds]
-> ReadPrec AutoScalingThresholds
-> ReadPrec [AutoScalingThresholds]
-> Read 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
(Int -> AutoScalingThresholds -> ShowS)
-> (AutoScalingThresholds -> String)
-> ([AutoScalingThresholds] -> ShowS)
-> Show AutoScalingThresholds
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. AutoScalingThresholds -> Rep AutoScalingThresholds x)
-> (forall x. Rep AutoScalingThresholds x -> AutoScalingThresholds)
-> Generic AutoScalingThresholds
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' :: Maybe Int
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds
AutoScalingThresholds'
{ $sel:instanceCount:AutoScalingThresholds' :: Maybe Int
instanceCount =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:ignoreMetricsTime:AutoScalingThresholds' :: Maybe Natural
ignoreMetricsTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:loadThreshold:AutoScalingThresholds' :: Maybe Double
loadThreshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:thresholdsWaitTime:AutoScalingThresholds' :: Maybe Natural
thresholdsWaitTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:alarms:AutoScalingThresholds' :: Maybe [Text]
alarms = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:memoryThreshold:AutoScalingThresholds' :: Maybe Double
memoryThreshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:cpuThreshold:AutoScalingThresholds' :: Maybe Double
cpuThreshold = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
autoScalingThresholds_instanceCount :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Int)
autoScalingThresholds_instanceCount :: (Maybe Int -> f (Maybe Int))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_instanceCount = (AutoScalingThresholds -> Maybe Int)
-> (AutoScalingThresholds -> Maybe Int -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds AutoScalingThresholds (Maybe Int) (Maybe Int)
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_ignoreMetricsTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_ignoreMetricsTime :: (Maybe Natural -> f (Maybe Natural))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_ignoreMetricsTime = (AutoScalingThresholds -> Maybe Natural)
-> (AutoScalingThresholds
-> Maybe Natural -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe Natural)
(Maybe Natural)
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_loadThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_loadThreshold :: (Maybe Double -> f (Maybe Double))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_loadThreshold = (AutoScalingThresholds -> Maybe Double)
-> (AutoScalingThresholds -> Maybe Double -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe Double)
(Maybe Double)
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_thresholdsWaitTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_thresholdsWaitTime :: (Maybe Natural -> f (Maybe Natural))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_thresholdsWaitTime = (AutoScalingThresholds -> Maybe Natural)
-> (AutoScalingThresholds
-> Maybe Natural -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe Natural)
(Maybe Natural)
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)
autoScalingThresholds_alarms :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe [Prelude.Text])
autoScalingThresholds_alarms :: (Maybe [Text] -> f (Maybe [Text]))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_alarms = (AutoScalingThresholds -> Maybe [Text])
-> (AutoScalingThresholds -> Maybe [Text] -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe [Text])
(Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
-> AutoScalingThresholds -> f AutoScalingThresholds)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AutoScalingThresholds
-> f AutoScalingThresholds
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
autoScalingThresholds_memoryThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_memoryThreshold :: (Maybe Double -> f (Maybe Double))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_memoryThreshold = (AutoScalingThresholds -> Maybe Double)
-> (AutoScalingThresholds -> Maybe Double -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe Double)
(Maybe Double)
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_cpuThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_cpuThreshold :: (Maybe Double -> f (Maybe Double))
-> AutoScalingThresholds -> f AutoScalingThresholds
autoScalingThresholds_cpuThreshold = (AutoScalingThresholds -> Maybe Double)
-> (AutoScalingThresholds -> Maybe Double -> AutoScalingThresholds)
-> Lens
AutoScalingThresholds
AutoScalingThresholds
(Maybe Double)
(Maybe Double)
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)
instance Core.FromJSON AutoScalingThresholds where
parseJSON :: Value -> Parser AutoScalingThresholds
parseJSON =
String
-> (Object -> Parser AutoScalingThresholds)
-> Value
-> Parser AutoScalingThresholds
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoScalingThresholds"
( \Object
x ->
Maybe Int
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds
AutoScalingThresholds'
(Maybe Int
-> Maybe Natural
-> Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
-> Parser (Maybe Int)
-> Parser
(Maybe Natural
-> Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceCount")
Parser
(Maybe Natural
-> Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
-> Parser (Maybe Natural)
-> Parser
(Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IgnoreMetricsTime")
Parser
(Maybe Double
-> Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
-> Parser (Maybe Double)
-> Parser
(Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LoadThreshold")
Parser
(Maybe Natural
-> Maybe [Text]
-> Maybe Double
-> Maybe Double
-> AutoScalingThresholds)
-> Parser (Maybe Natural)
-> Parser
(Maybe [Text]
-> Maybe Double -> Maybe Double -> AutoScalingThresholds)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ThresholdsWaitTime")
Parser
(Maybe [Text]
-> Maybe Double -> Maybe Double -> AutoScalingThresholds)
-> Parser (Maybe [Text])
-> Parser (Maybe Double -> Maybe Double -> AutoScalingThresholds)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Alarms" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Double -> Maybe Double -> AutoScalingThresholds)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> AutoScalingThresholds)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MemoryThreshold")
Parser (Maybe Double -> AutoScalingThresholds)
-> Parser (Maybe Double) -> Parser AutoScalingThresholds
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CpuThreshold")
)
instance Prelude.Hashable AutoScalingThresholds
instance Prelude.NFData AutoScalingThresholds
instance Core.ToJSON AutoScalingThresholds where
toJSON :: AutoScalingThresholds -> Value
toJSON AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
cpuThreshold :: Maybe Double
memoryThreshold :: Maybe Double
alarms :: Maybe [Text]
thresholdsWaitTime :: Maybe Natural
loadThreshold :: Maybe Double
ignoreMetricsTime :: Maybe Natural
instanceCount :: Maybe Int
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InstanceCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instanceCount,
(Text
"IgnoreMetricsTime" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
ignoreMetricsTime,
(Text
"LoadThreshold" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
loadThreshold,
(Text
"ThresholdsWaitTime" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thresholdsWaitTime,
(Text
"Alarms" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
alarms,
(Text
"MemoryThreshold" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
memoryThreshold,
(Text
"CpuThreshold" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
cpuThreshold
]
)