{-# 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.AutoScaling.Types.ScalingPolicy where
import Amazonka.AutoScaling.Types.Alarm
import Amazonka.AutoScaling.Types.PredictiveScalingConfiguration
import Amazonka.AutoScaling.Types.StepAdjustment
import Amazonka.AutoScaling.Types.TargetTrackingConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ScalingPolicy = ScalingPolicy'
{
ScalingPolicy -> Maybe Int
minAdjustmentStep :: Prelude.Maybe Prelude.Int,
ScalingPolicy -> Maybe Int
estimatedInstanceWarmup :: Prelude.Maybe Prelude.Int,
ScalingPolicy -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
ScalingPolicy -> Maybe Text
policyType :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe [StepAdjustment]
stepAdjustments :: Prelude.Maybe [StepAdjustment],
ScalingPolicy -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration :: Prelude.Maybe TargetTrackingConfiguration,
ScalingPolicy -> Maybe Text
adjustmentType :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration :: Prelude.Maybe PredictiveScalingConfiguration,
ScalingPolicy -> Maybe Int
scalingAdjustment :: Prelude.Maybe Prelude.Int,
ScalingPolicy -> Maybe Int
cooldown :: Prelude.Maybe Prelude.Int,
ScalingPolicy -> Maybe Text
policyARN :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe [Alarm]
alarms :: Prelude.Maybe [Alarm],
ScalingPolicy -> Maybe Text
metricAggregationType :: Prelude.Maybe Prelude.Text,
ScalingPolicy -> Maybe Int
minAdjustmentMagnitude :: Prelude.Maybe Prelude.Int
}
deriving (ScalingPolicy -> ScalingPolicy -> Bool
(ScalingPolicy -> ScalingPolicy -> Bool)
-> (ScalingPolicy -> ScalingPolicy -> Bool) -> Eq ScalingPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingPolicy -> ScalingPolicy -> Bool
$c/= :: ScalingPolicy -> ScalingPolicy -> Bool
== :: ScalingPolicy -> ScalingPolicy -> Bool
$c== :: ScalingPolicy -> ScalingPolicy -> Bool
Prelude.Eq, ReadPrec [ScalingPolicy]
ReadPrec ScalingPolicy
Int -> ReadS ScalingPolicy
ReadS [ScalingPolicy]
(Int -> ReadS ScalingPolicy)
-> ReadS [ScalingPolicy]
-> ReadPrec ScalingPolicy
-> ReadPrec [ScalingPolicy]
-> Read ScalingPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingPolicy]
$creadListPrec :: ReadPrec [ScalingPolicy]
readPrec :: ReadPrec ScalingPolicy
$creadPrec :: ReadPrec ScalingPolicy
readList :: ReadS [ScalingPolicy]
$creadList :: ReadS [ScalingPolicy]
readsPrec :: Int -> ReadS ScalingPolicy
$creadsPrec :: Int -> ReadS ScalingPolicy
Prelude.Read, Int -> ScalingPolicy -> ShowS
[ScalingPolicy] -> ShowS
ScalingPolicy -> String
(Int -> ScalingPolicy -> ShowS)
-> (ScalingPolicy -> String)
-> ([ScalingPolicy] -> ShowS)
-> Show ScalingPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingPolicy] -> ShowS
$cshowList :: [ScalingPolicy] -> ShowS
show :: ScalingPolicy -> String
$cshow :: ScalingPolicy -> String
showsPrec :: Int -> ScalingPolicy -> ShowS
$cshowsPrec :: Int -> ScalingPolicy -> ShowS
Prelude.Show, (forall x. ScalingPolicy -> Rep ScalingPolicy x)
-> (forall x. Rep ScalingPolicy x -> ScalingPolicy)
-> Generic ScalingPolicy
forall x. Rep ScalingPolicy x -> ScalingPolicy
forall x. ScalingPolicy -> Rep ScalingPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingPolicy x -> ScalingPolicy
$cfrom :: forall x. ScalingPolicy -> Rep ScalingPolicy x
Prelude.Generic)
newScalingPolicy ::
ScalingPolicy
newScalingPolicy :: ScalingPolicy
newScalingPolicy =
ScalingPolicy' :: Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy
ScalingPolicy'
{ $sel:minAdjustmentStep:ScalingPolicy' :: Maybe Int
minAdjustmentStep = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:estimatedInstanceWarmup:ScalingPolicy' :: Maybe Int
estimatedInstanceWarmup = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:policyName:ScalingPolicy' :: Maybe Text
policyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:ScalingPolicy' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:policyType:ScalingPolicy' :: Maybe Text
policyType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stepAdjustments:ScalingPolicy' :: Maybe [StepAdjustment]
stepAdjustments = Maybe [StepAdjustment]
forall a. Maybe a
Prelude.Nothing,
$sel:targetTrackingConfiguration:ScalingPolicy' :: Maybe TargetTrackingConfiguration
targetTrackingConfiguration = Maybe TargetTrackingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:adjustmentType:ScalingPolicy' :: Maybe Text
adjustmentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:ScalingPolicy' :: Maybe Text
autoScalingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:predictiveScalingConfiguration:ScalingPolicy' :: Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration = Maybe PredictiveScalingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:scalingAdjustment:ScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cooldown:ScalingPolicy' :: Maybe Int
cooldown = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:policyARN:ScalingPolicy' :: Maybe Text
policyARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alarms:ScalingPolicy' :: Maybe [Alarm]
alarms = Maybe [Alarm]
forall a. Maybe a
Prelude.Nothing,
$sel:metricAggregationType:ScalingPolicy' :: Maybe Text
metricAggregationType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:minAdjustmentMagnitude:ScalingPolicy' :: Maybe Int
minAdjustmentMagnitude = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
scalingPolicy_minAdjustmentStep :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Int)
scalingPolicy_minAdjustmentStep :: (Maybe Int -> f (Maybe Int)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_minAdjustmentStep = (ScalingPolicy -> Maybe Int)
-> (ScalingPolicy -> Maybe Int -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Int
minAdjustmentStep :: Maybe Int
$sel:minAdjustmentStep:ScalingPolicy' :: ScalingPolicy -> Maybe Int
minAdjustmentStep} -> Maybe Int
minAdjustmentStep) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Int
a -> ScalingPolicy
s {$sel:minAdjustmentStep:ScalingPolicy' :: Maybe Int
minAdjustmentStep = Maybe Int
a} :: ScalingPolicy)
scalingPolicy_estimatedInstanceWarmup :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Int)
scalingPolicy_estimatedInstanceWarmup :: (Maybe Int -> f (Maybe Int)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_estimatedInstanceWarmup = (ScalingPolicy -> Maybe Int)
-> (ScalingPolicy -> Maybe Int -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Int
estimatedInstanceWarmup :: Maybe Int
$sel:estimatedInstanceWarmup:ScalingPolicy' :: ScalingPolicy -> Maybe Int
estimatedInstanceWarmup} -> Maybe Int
estimatedInstanceWarmup) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Int
a -> ScalingPolicy
s {$sel:estimatedInstanceWarmup:ScalingPolicy' :: Maybe Int
estimatedInstanceWarmup = Maybe Int
a} :: ScalingPolicy)
scalingPolicy_policyName :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_policyName :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_policyName = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
policyName :: Maybe Text
$sel:policyName:ScalingPolicy' :: ScalingPolicy -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:policyName:ScalingPolicy' :: Maybe Text
policyName = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_enabled :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Bool)
scalingPolicy_enabled :: (Maybe Bool -> f (Maybe Bool)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_enabled = (ScalingPolicy -> Maybe Bool)
-> (ScalingPolicy -> Maybe Bool -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ScalingPolicy' :: ScalingPolicy -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Bool
a -> ScalingPolicy
s {$sel:enabled:ScalingPolicy' :: Maybe Bool
enabled = Maybe Bool
a} :: ScalingPolicy)
scalingPolicy_policyType :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_policyType :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_policyType = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
policyType :: Maybe Text
$sel:policyType:ScalingPolicy' :: ScalingPolicy -> Maybe Text
policyType} -> Maybe Text
policyType) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:policyType:ScalingPolicy' :: Maybe Text
policyType = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_stepAdjustments :: Lens.Lens' ScalingPolicy (Prelude.Maybe [StepAdjustment])
scalingPolicy_stepAdjustments :: (Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> ScalingPolicy -> f ScalingPolicy
scalingPolicy_stepAdjustments = (ScalingPolicy -> Maybe [StepAdjustment])
-> (ScalingPolicy -> Maybe [StepAdjustment] -> ScalingPolicy)
-> Lens
ScalingPolicy
ScalingPolicy
(Maybe [StepAdjustment])
(Maybe [StepAdjustment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe [StepAdjustment]
stepAdjustments :: Maybe [StepAdjustment]
$sel:stepAdjustments:ScalingPolicy' :: ScalingPolicy -> Maybe [StepAdjustment]
stepAdjustments} -> Maybe [StepAdjustment]
stepAdjustments) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe [StepAdjustment]
a -> ScalingPolicy
s {$sel:stepAdjustments:ScalingPolicy' :: Maybe [StepAdjustment]
stepAdjustments = Maybe [StepAdjustment]
a} :: ScalingPolicy) ((Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> ScalingPolicy -> f ScalingPolicy)
-> ((Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> (Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> ScalingPolicy
-> f ScalingPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[StepAdjustment] [StepAdjustment] [StepAdjustment] [StepAdjustment]
-> Iso
(Maybe [StepAdjustment])
(Maybe [StepAdjustment])
(Maybe [StepAdjustment])
(Maybe [StepAdjustment])
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
[StepAdjustment] [StepAdjustment] [StepAdjustment] [StepAdjustment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
scalingPolicy_targetTrackingConfiguration :: Lens.Lens' ScalingPolicy (Prelude.Maybe TargetTrackingConfiguration)
scalingPolicy_targetTrackingConfiguration :: (Maybe TargetTrackingConfiguration
-> f (Maybe TargetTrackingConfiguration))
-> ScalingPolicy -> f ScalingPolicy
scalingPolicy_targetTrackingConfiguration = (ScalingPolicy -> Maybe TargetTrackingConfiguration)
-> (ScalingPolicy
-> Maybe TargetTrackingConfiguration -> ScalingPolicy)
-> Lens
ScalingPolicy
ScalingPolicy
(Maybe TargetTrackingConfiguration)
(Maybe TargetTrackingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe TargetTrackingConfiguration
targetTrackingConfiguration :: Maybe TargetTrackingConfiguration
$sel:targetTrackingConfiguration:ScalingPolicy' :: ScalingPolicy -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration} -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe TargetTrackingConfiguration
a -> ScalingPolicy
s {$sel:targetTrackingConfiguration:ScalingPolicy' :: Maybe TargetTrackingConfiguration
targetTrackingConfiguration = Maybe TargetTrackingConfiguration
a} :: ScalingPolicy)
scalingPolicy_adjustmentType :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_adjustmentType :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_adjustmentType = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
adjustmentType :: Maybe Text
$sel:adjustmentType:ScalingPolicy' :: ScalingPolicy -> Maybe Text
adjustmentType} -> Maybe Text
adjustmentType) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:adjustmentType:ScalingPolicy' :: Maybe Text
adjustmentType = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_autoScalingGroupName :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_autoScalingGroupName :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_autoScalingGroupName = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
autoScalingGroupName :: Maybe Text
$sel:autoScalingGroupName:ScalingPolicy' :: ScalingPolicy -> Maybe Text
autoScalingGroupName} -> Maybe Text
autoScalingGroupName) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:autoScalingGroupName:ScalingPolicy' :: Maybe Text
autoScalingGroupName = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_predictiveScalingConfiguration :: Lens.Lens' ScalingPolicy (Prelude.Maybe PredictiveScalingConfiguration)
scalingPolicy_predictiveScalingConfiguration :: (Maybe PredictiveScalingConfiguration
-> f (Maybe PredictiveScalingConfiguration))
-> ScalingPolicy -> f ScalingPolicy
scalingPolicy_predictiveScalingConfiguration = (ScalingPolicy -> Maybe PredictiveScalingConfiguration)
-> (ScalingPolicy
-> Maybe PredictiveScalingConfiguration -> ScalingPolicy)
-> Lens
ScalingPolicy
ScalingPolicy
(Maybe PredictiveScalingConfiguration)
(Maybe PredictiveScalingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration :: Maybe PredictiveScalingConfiguration
$sel:predictiveScalingConfiguration:ScalingPolicy' :: ScalingPolicy -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration} -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe PredictiveScalingConfiguration
a -> ScalingPolicy
s {$sel:predictiveScalingConfiguration:ScalingPolicy' :: Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration = Maybe PredictiveScalingConfiguration
a} :: ScalingPolicy)
scalingPolicy_scalingAdjustment :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Int)
scalingPolicy_scalingAdjustment :: (Maybe Int -> f (Maybe Int)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_scalingAdjustment = (ScalingPolicy -> Maybe Int)
-> (ScalingPolicy -> Maybe Int -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Int
scalingAdjustment :: Maybe Int
$sel:scalingAdjustment:ScalingPolicy' :: ScalingPolicy -> Maybe Int
scalingAdjustment} -> Maybe Int
scalingAdjustment) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Int
a -> ScalingPolicy
s {$sel:scalingAdjustment:ScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
a} :: ScalingPolicy)
scalingPolicy_cooldown :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Int)
scalingPolicy_cooldown :: (Maybe Int -> f (Maybe Int)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_cooldown = (ScalingPolicy -> Maybe Int)
-> (ScalingPolicy -> Maybe Int -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Int
cooldown :: Maybe Int
$sel:cooldown:ScalingPolicy' :: ScalingPolicy -> Maybe Int
cooldown} -> Maybe Int
cooldown) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Int
a -> ScalingPolicy
s {$sel:cooldown:ScalingPolicy' :: Maybe Int
cooldown = Maybe Int
a} :: ScalingPolicy)
scalingPolicy_policyARN :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_policyARN :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_policyARN = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
policyARN :: Maybe Text
$sel:policyARN:ScalingPolicy' :: ScalingPolicy -> Maybe Text
policyARN} -> Maybe Text
policyARN) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:policyARN:ScalingPolicy' :: Maybe Text
policyARN = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_alarms :: Lens.Lens' ScalingPolicy (Prelude.Maybe [Alarm])
scalingPolicy_alarms :: (Maybe [Alarm] -> f (Maybe [Alarm]))
-> ScalingPolicy -> f ScalingPolicy
scalingPolicy_alarms = (ScalingPolicy -> Maybe [Alarm])
-> (ScalingPolicy -> Maybe [Alarm] -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe [Alarm]) (Maybe [Alarm])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe [Alarm]
alarms :: Maybe [Alarm]
$sel:alarms:ScalingPolicy' :: ScalingPolicy -> Maybe [Alarm]
alarms} -> Maybe [Alarm]
alarms) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe [Alarm]
a -> ScalingPolicy
s {$sel:alarms:ScalingPolicy' :: Maybe [Alarm]
alarms = Maybe [Alarm]
a} :: ScalingPolicy) ((Maybe [Alarm] -> f (Maybe [Alarm]))
-> ScalingPolicy -> f ScalingPolicy)
-> ((Maybe [Alarm] -> f (Maybe [Alarm]))
-> Maybe [Alarm] -> f (Maybe [Alarm]))
-> (Maybe [Alarm] -> f (Maybe [Alarm]))
-> ScalingPolicy
-> f ScalingPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Alarm] [Alarm] [Alarm] [Alarm]
-> Iso
(Maybe [Alarm]) (Maybe [Alarm]) (Maybe [Alarm]) (Maybe [Alarm])
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 [Alarm] [Alarm] [Alarm] [Alarm]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
scalingPolicy_metricAggregationType :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Text)
scalingPolicy_metricAggregationType :: (Maybe Text -> f (Maybe Text)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_metricAggregationType = (ScalingPolicy -> Maybe Text)
-> (ScalingPolicy -> Maybe Text -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Text
metricAggregationType :: Maybe Text
$sel:metricAggregationType:ScalingPolicy' :: ScalingPolicy -> Maybe Text
metricAggregationType} -> Maybe Text
metricAggregationType) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Text
a -> ScalingPolicy
s {$sel:metricAggregationType:ScalingPolicy' :: Maybe Text
metricAggregationType = Maybe Text
a} :: ScalingPolicy)
scalingPolicy_minAdjustmentMagnitude :: Lens.Lens' ScalingPolicy (Prelude.Maybe Prelude.Int)
scalingPolicy_minAdjustmentMagnitude :: (Maybe Int -> f (Maybe Int)) -> ScalingPolicy -> f ScalingPolicy
scalingPolicy_minAdjustmentMagnitude = (ScalingPolicy -> Maybe Int)
-> (ScalingPolicy -> Maybe Int -> ScalingPolicy)
-> Lens ScalingPolicy ScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPolicy' {Maybe Int
minAdjustmentMagnitude :: Maybe Int
$sel:minAdjustmentMagnitude:ScalingPolicy' :: ScalingPolicy -> Maybe Int
minAdjustmentMagnitude} -> Maybe Int
minAdjustmentMagnitude) (\s :: ScalingPolicy
s@ScalingPolicy' {} Maybe Int
a -> ScalingPolicy
s {$sel:minAdjustmentMagnitude:ScalingPolicy' :: Maybe Int
minAdjustmentMagnitude = Maybe Int
a} :: ScalingPolicy)
instance Core.FromXML ScalingPolicy where
parseXML :: [Node] -> Either String ScalingPolicy
parseXML [Node]
x =
Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy
ScalingPolicy'
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Int)
-> Either
String
(Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MinAdjustmentStep")
Either
String
(Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Int)
-> Either
String
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EstimatedInstanceWarmup")
Either
String
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Text)
-> Either
String
(Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyName")
Either
String
(Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Enabled")
Either
String
(Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Text)
-> Either
String
(Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyType")
Either
String
(Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe [StepAdjustment])
-> Either
String
(Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
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
"StepAdjustments" 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 [StepAdjustment]))
-> Either String (Maybe [StepAdjustment])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [StepAdjustment])
-> [Node] -> Either String (Maybe [StepAdjustment])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [StepAdjustment]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe TargetTrackingConfiguration)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TargetTrackingConfiguration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetTrackingConfiguration")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AdjustmentType")
Either
String
(Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Text)
-> Either
String
(Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AutoScalingGroupName")
Either
String
(Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe PredictiveScalingConfiguration)
-> Either
String
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe PredictiveScalingConfiguration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PredictiveScalingConfiguration")
Either
String
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Int)
-> Either
String
(Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ScalingAdjustment")
Either
String
(Maybe Int
-> Maybe Text
-> Maybe [Alarm]
-> Maybe Text
-> Maybe Int
-> ScalingPolicy)
-> Either String (Maybe Int)
-> Either
String
(Maybe Text
-> Maybe [Alarm] -> Maybe Text -> Maybe Int -> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Cooldown")
Either
String
(Maybe Text
-> Maybe [Alarm] -> Maybe Text -> Maybe Int -> ScalingPolicy)
-> Either String (Maybe Text)
-> Either
String (Maybe [Alarm] -> Maybe Text -> Maybe Int -> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyARN")
Either
String (Maybe [Alarm] -> Maybe Text -> Maybe Int -> ScalingPolicy)
-> Either String (Maybe [Alarm])
-> Either String (Maybe Text -> Maybe Int -> ScalingPolicy)
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
"Alarms" 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 [Alarm]))
-> Either String (Maybe [Alarm])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Alarm])
-> [Node] -> Either String (Maybe [Alarm])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Alarm]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Maybe Text -> Maybe Int -> ScalingPolicy)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> ScalingPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MetricAggregationType")
Either String (Maybe Int -> ScalingPolicy)
-> Either String (Maybe Int) -> Either String ScalingPolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MinAdjustmentMagnitude")
instance Prelude.Hashable ScalingPolicy
instance Prelude.NFData ScalingPolicy