{-# 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.ApplicationAutoScaling.Types.TargetTrackingScalingPolicyConfiguration where
import Amazonka.ApplicationAutoScaling.Types.CustomizedMetricSpecification
import Amazonka.ApplicationAutoScaling.Types.PredefinedMetricSpecification
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TargetTrackingScalingPolicyConfiguration = TargetTrackingScalingPolicyConfiguration'
{
TargetTrackingScalingPolicyConfiguration
-> Maybe PredefinedMetricSpecification
predefinedMetricSpecification :: Prelude.Maybe PredefinedMetricSpecification,
TargetTrackingScalingPolicyConfiguration -> Maybe Int
scaleInCooldown :: Prelude.Maybe Prelude.Int,
TargetTrackingScalingPolicyConfiguration
-> Maybe CustomizedMetricSpecification
customizedMetricSpecification :: Prelude.Maybe CustomizedMetricSpecification,
TargetTrackingScalingPolicyConfiguration -> Maybe Bool
disableScaleIn :: Prelude.Maybe Prelude.Bool,
TargetTrackingScalingPolicyConfiguration -> Maybe Int
scaleOutCooldown :: Prelude.Maybe Prelude.Int,
TargetTrackingScalingPolicyConfiguration -> Double
targetValue :: Prelude.Double
}
deriving (TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool
(TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool)
-> (TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool)
-> Eq TargetTrackingScalingPolicyConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool
$c/= :: TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool
== :: TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool
$c== :: TargetTrackingScalingPolicyConfiguration
-> TargetTrackingScalingPolicyConfiguration -> Bool
Prelude.Eq, ReadPrec [TargetTrackingScalingPolicyConfiguration]
ReadPrec TargetTrackingScalingPolicyConfiguration
Int -> ReadS TargetTrackingScalingPolicyConfiguration
ReadS [TargetTrackingScalingPolicyConfiguration]
(Int -> ReadS TargetTrackingScalingPolicyConfiguration)
-> ReadS [TargetTrackingScalingPolicyConfiguration]
-> ReadPrec TargetTrackingScalingPolicyConfiguration
-> ReadPrec [TargetTrackingScalingPolicyConfiguration]
-> Read TargetTrackingScalingPolicyConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetTrackingScalingPolicyConfiguration]
$creadListPrec :: ReadPrec [TargetTrackingScalingPolicyConfiguration]
readPrec :: ReadPrec TargetTrackingScalingPolicyConfiguration
$creadPrec :: ReadPrec TargetTrackingScalingPolicyConfiguration
readList :: ReadS [TargetTrackingScalingPolicyConfiguration]
$creadList :: ReadS [TargetTrackingScalingPolicyConfiguration]
readsPrec :: Int -> ReadS TargetTrackingScalingPolicyConfiguration
$creadsPrec :: Int -> ReadS TargetTrackingScalingPolicyConfiguration
Prelude.Read, Int -> TargetTrackingScalingPolicyConfiguration -> ShowS
[TargetTrackingScalingPolicyConfiguration] -> ShowS
TargetTrackingScalingPolicyConfiguration -> String
(Int -> TargetTrackingScalingPolicyConfiguration -> ShowS)
-> (TargetTrackingScalingPolicyConfiguration -> String)
-> ([TargetTrackingScalingPolicyConfiguration] -> ShowS)
-> Show TargetTrackingScalingPolicyConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetTrackingScalingPolicyConfiguration] -> ShowS
$cshowList :: [TargetTrackingScalingPolicyConfiguration] -> ShowS
show :: TargetTrackingScalingPolicyConfiguration -> String
$cshow :: TargetTrackingScalingPolicyConfiguration -> String
showsPrec :: Int -> TargetTrackingScalingPolicyConfiguration -> ShowS
$cshowsPrec :: Int -> TargetTrackingScalingPolicyConfiguration -> ShowS
Prelude.Show, (forall x.
TargetTrackingScalingPolicyConfiguration
-> Rep TargetTrackingScalingPolicyConfiguration x)
-> (forall x.
Rep TargetTrackingScalingPolicyConfiguration x
-> TargetTrackingScalingPolicyConfiguration)
-> Generic TargetTrackingScalingPolicyConfiguration
forall x.
Rep TargetTrackingScalingPolicyConfiguration x
-> TargetTrackingScalingPolicyConfiguration
forall x.
TargetTrackingScalingPolicyConfiguration
-> Rep TargetTrackingScalingPolicyConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TargetTrackingScalingPolicyConfiguration x
-> TargetTrackingScalingPolicyConfiguration
$cfrom :: forall x.
TargetTrackingScalingPolicyConfiguration
-> Rep TargetTrackingScalingPolicyConfiguration x
Prelude.Generic)
newTargetTrackingScalingPolicyConfiguration ::
Prelude.Double ->
TargetTrackingScalingPolicyConfiguration
newTargetTrackingScalingPolicyConfiguration :: Double -> TargetTrackingScalingPolicyConfiguration
newTargetTrackingScalingPolicyConfiguration
Double
pTargetValue_ =
TargetTrackingScalingPolicyConfiguration' :: Maybe PredefinedMetricSpecification
-> Maybe Int
-> Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration'
{ $sel:predefinedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: Maybe PredefinedMetricSpecification
predefinedMetricSpecification =
Maybe PredefinedMetricSpecification
forall a. Maybe a
Prelude.Nothing,
$sel:scaleInCooldown:TargetTrackingScalingPolicyConfiguration' :: Maybe Int
scaleInCooldown = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:customizedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: Maybe CustomizedMetricSpecification
customizedMetricSpecification =
Maybe CustomizedMetricSpecification
forall a. Maybe a
Prelude.Nothing,
$sel:disableScaleIn:TargetTrackingScalingPolicyConfiguration' :: Maybe Bool
disableScaleIn = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:scaleOutCooldown:TargetTrackingScalingPolicyConfiguration' :: Maybe Int
scaleOutCooldown =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:targetValue:TargetTrackingScalingPolicyConfiguration' :: Double
targetValue = Double
pTargetValue_
}
targetTrackingScalingPolicyConfiguration_predefinedMetricSpecification :: Lens.Lens' TargetTrackingScalingPolicyConfiguration (Prelude.Maybe PredefinedMetricSpecification)
targetTrackingScalingPolicyConfiguration_predefinedMetricSpecification :: (Maybe PredefinedMetricSpecification
-> f (Maybe PredefinedMetricSpecification))
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_predefinedMetricSpecification = (TargetTrackingScalingPolicyConfiguration
-> Maybe PredefinedMetricSpecification)
-> (TargetTrackingScalingPolicyConfiguration
-> Maybe PredefinedMetricSpecification
-> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
(Maybe PredefinedMetricSpecification)
(Maybe PredefinedMetricSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Maybe PredefinedMetricSpecification
predefinedMetricSpecification :: Maybe PredefinedMetricSpecification
$sel:predefinedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration
-> Maybe PredefinedMetricSpecification
predefinedMetricSpecification} -> Maybe PredefinedMetricSpecification
predefinedMetricSpecification) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Maybe PredefinedMetricSpecification
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:predefinedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: Maybe PredefinedMetricSpecification
predefinedMetricSpecification = Maybe PredefinedMetricSpecification
a} :: TargetTrackingScalingPolicyConfiguration)
targetTrackingScalingPolicyConfiguration_scaleInCooldown :: Lens.Lens' TargetTrackingScalingPolicyConfiguration (Prelude.Maybe Prelude.Int)
targetTrackingScalingPolicyConfiguration_scaleInCooldown :: (Maybe Int -> f (Maybe Int))
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_scaleInCooldown = (TargetTrackingScalingPolicyConfiguration -> Maybe Int)
-> (TargetTrackingScalingPolicyConfiguration
-> Maybe Int -> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Maybe Int
scaleInCooldown :: Maybe Int
$sel:scaleInCooldown:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Int
scaleInCooldown} -> Maybe Int
scaleInCooldown) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Maybe Int
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:scaleInCooldown:TargetTrackingScalingPolicyConfiguration' :: Maybe Int
scaleInCooldown = Maybe Int
a} :: TargetTrackingScalingPolicyConfiguration)
targetTrackingScalingPolicyConfiguration_customizedMetricSpecification :: Lens.Lens' TargetTrackingScalingPolicyConfiguration (Prelude.Maybe CustomizedMetricSpecification)
targetTrackingScalingPolicyConfiguration_customizedMetricSpecification :: (Maybe CustomizedMetricSpecification
-> f (Maybe CustomizedMetricSpecification))
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_customizedMetricSpecification = (TargetTrackingScalingPolicyConfiguration
-> Maybe CustomizedMetricSpecification)
-> (TargetTrackingScalingPolicyConfiguration
-> Maybe CustomizedMetricSpecification
-> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
(Maybe CustomizedMetricSpecification)
(Maybe CustomizedMetricSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Maybe CustomizedMetricSpecification
customizedMetricSpecification :: Maybe CustomizedMetricSpecification
$sel:customizedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration
-> Maybe CustomizedMetricSpecification
customizedMetricSpecification} -> Maybe CustomizedMetricSpecification
customizedMetricSpecification) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Maybe CustomizedMetricSpecification
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:customizedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: Maybe CustomizedMetricSpecification
customizedMetricSpecification = Maybe CustomizedMetricSpecification
a} :: TargetTrackingScalingPolicyConfiguration)
targetTrackingScalingPolicyConfiguration_disableScaleIn :: Lens.Lens' TargetTrackingScalingPolicyConfiguration (Prelude.Maybe Prelude.Bool)
targetTrackingScalingPolicyConfiguration_disableScaleIn :: (Maybe Bool -> f (Maybe Bool))
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_disableScaleIn = (TargetTrackingScalingPolicyConfiguration -> Maybe Bool)
-> (TargetTrackingScalingPolicyConfiguration
-> Maybe Bool -> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Maybe Bool
disableScaleIn :: Maybe Bool
$sel:disableScaleIn:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Bool
disableScaleIn} -> Maybe Bool
disableScaleIn) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Maybe Bool
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:disableScaleIn:TargetTrackingScalingPolicyConfiguration' :: Maybe Bool
disableScaleIn = Maybe Bool
a} :: TargetTrackingScalingPolicyConfiguration)
targetTrackingScalingPolicyConfiguration_scaleOutCooldown :: Lens.Lens' TargetTrackingScalingPolicyConfiguration (Prelude.Maybe Prelude.Int)
targetTrackingScalingPolicyConfiguration_scaleOutCooldown :: (Maybe Int -> f (Maybe Int))
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_scaleOutCooldown = (TargetTrackingScalingPolicyConfiguration -> Maybe Int)
-> (TargetTrackingScalingPolicyConfiguration
-> Maybe Int -> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Maybe Int
scaleOutCooldown :: Maybe Int
$sel:scaleOutCooldown:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Int
scaleOutCooldown} -> Maybe Int
scaleOutCooldown) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Maybe Int
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:scaleOutCooldown:TargetTrackingScalingPolicyConfiguration' :: Maybe Int
scaleOutCooldown = Maybe Int
a} :: TargetTrackingScalingPolicyConfiguration)
targetTrackingScalingPolicyConfiguration_targetValue :: Lens.Lens' TargetTrackingScalingPolicyConfiguration Prelude.Double
targetTrackingScalingPolicyConfiguration_targetValue :: (Double -> f Double)
-> TargetTrackingScalingPolicyConfiguration
-> f TargetTrackingScalingPolicyConfiguration
targetTrackingScalingPolicyConfiguration_targetValue = (TargetTrackingScalingPolicyConfiguration -> Double)
-> (TargetTrackingScalingPolicyConfiguration
-> Double -> TargetTrackingScalingPolicyConfiguration)
-> Lens
TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration
Double
Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetTrackingScalingPolicyConfiguration' {Double
targetValue :: Double
$sel:targetValue:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Double
targetValue} -> Double
targetValue) (\s :: TargetTrackingScalingPolicyConfiguration
s@TargetTrackingScalingPolicyConfiguration' {} Double
a -> TargetTrackingScalingPolicyConfiguration
s {$sel:targetValue:TargetTrackingScalingPolicyConfiguration' :: Double
targetValue = Double
a} :: TargetTrackingScalingPolicyConfiguration)
instance
Core.FromJSON
TargetTrackingScalingPolicyConfiguration
where
parseJSON :: Value -> Parser TargetTrackingScalingPolicyConfiguration
parseJSON =
String
-> (Object -> Parser TargetTrackingScalingPolicyConfiguration)
-> Value
-> Parser TargetTrackingScalingPolicyConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TargetTrackingScalingPolicyConfiguration"
( \Object
x ->
Maybe PredefinedMetricSpecification
-> Maybe Int
-> Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration
TargetTrackingScalingPolicyConfiguration'
(Maybe PredefinedMetricSpecification
-> Maybe Int
-> Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration)
-> Parser (Maybe PredefinedMetricSpecification)
-> Parser
(Maybe Int
-> Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PredefinedMetricSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PredefinedMetricSpecification")
Parser
(Maybe Int
-> Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration)
-> Parser (Maybe Int)
-> Parser
(Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration)
forall (f :: * -> *) a b. Applicative f => 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
"ScaleInCooldown")
Parser
(Maybe CustomizedMetricSpecification
-> Maybe Bool
-> Maybe Int
-> Double
-> TargetTrackingScalingPolicyConfiguration)
-> Parser (Maybe CustomizedMetricSpecification)
-> Parser
(Maybe Bool
-> Maybe Int -> Double -> TargetTrackingScalingPolicyConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomizedMetricSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomizedMetricSpecification")
Parser
(Maybe Bool
-> Maybe Int -> Double -> TargetTrackingScalingPolicyConfiguration)
-> Parser (Maybe Bool)
-> Parser
(Maybe Int -> Double -> TargetTrackingScalingPolicyConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisableScaleIn")
Parser
(Maybe Int -> Double -> TargetTrackingScalingPolicyConfiguration)
-> Parser (Maybe Int)
-> Parser (Double -> TargetTrackingScalingPolicyConfiguration)
forall (f :: * -> *) a b. Applicative f => 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
"ScaleOutCooldown")
Parser (Double -> TargetTrackingScalingPolicyConfiguration)
-> Parser Double -> Parser TargetTrackingScalingPolicyConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TargetValue")
)
instance
Prelude.Hashable
TargetTrackingScalingPolicyConfiguration
instance
Prelude.NFData
TargetTrackingScalingPolicyConfiguration
instance
Core.ToJSON
TargetTrackingScalingPolicyConfiguration
where
toJSON :: TargetTrackingScalingPolicyConfiguration -> Value
toJSON TargetTrackingScalingPolicyConfiguration' {Double
Maybe Bool
Maybe Int
Maybe CustomizedMetricSpecification
Maybe PredefinedMetricSpecification
targetValue :: Double
scaleOutCooldown :: Maybe Int
disableScaleIn :: Maybe Bool
customizedMetricSpecification :: Maybe CustomizedMetricSpecification
scaleInCooldown :: Maybe Int
predefinedMetricSpecification :: Maybe PredefinedMetricSpecification
$sel:targetValue:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Double
$sel:scaleOutCooldown:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Int
$sel:disableScaleIn:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Bool
$sel:customizedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration
-> Maybe CustomizedMetricSpecification
$sel:scaleInCooldown:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration -> Maybe Int
$sel:predefinedMetricSpecification:TargetTrackingScalingPolicyConfiguration' :: TargetTrackingScalingPolicyConfiguration
-> Maybe PredefinedMetricSpecification
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PredefinedMetricSpecification" Text -> PredefinedMetricSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PredefinedMetricSpecification -> Pair)
-> Maybe PredefinedMetricSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PredefinedMetricSpecification
predefinedMetricSpecification,
(Text
"ScaleInCooldown" 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
scaleInCooldown,
(Text
"CustomizedMetricSpecification" Text -> CustomizedMetricSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CustomizedMetricSpecification -> Pair)
-> Maybe CustomizedMetricSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomizedMetricSpecification
customizedMetricSpecification,
(Text
"DisableScaleIn" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableScaleIn,
(Text
"ScaleOutCooldown" 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
scaleOutCooldown,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetValue" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
targetValue)
]
)