{-# 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.AutoScalingPlans.Types.ScalingInstruction where
import Amazonka.AutoScalingPlans.Types.CustomizedLoadMetricSpecification
import Amazonka.AutoScalingPlans.Types.PredefinedLoadMetricSpecification
import Amazonka.AutoScalingPlans.Types.PredictiveScalingMaxCapacityBehavior
import Amazonka.AutoScalingPlans.Types.PredictiveScalingMode
import Amazonka.AutoScalingPlans.Types.ScalableDimension
import Amazonka.AutoScalingPlans.Types.ScalingPolicyUpdateBehavior
import Amazonka.AutoScalingPlans.Types.ServiceNamespace
import Amazonka.AutoScalingPlans.Types.TargetTrackingConfiguration
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 ScalingInstruction = ScalingInstruction'
{
ScalingInstruction -> Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification :: Prelude.Maybe CustomizedLoadMetricSpecification,
ScalingInstruction -> Maybe Bool
disableDynamicScaling :: Prelude.Maybe Prelude.Bool,
ScalingInstruction -> Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification :: Prelude.Maybe PredefinedLoadMetricSpecification,
ScalingInstruction -> Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior :: Prelude.Maybe PredictiveScalingMaxCapacityBehavior,
ScalingInstruction -> Maybe Int
predictiveScalingMaxCapacityBuffer :: Prelude.Maybe Prelude.Int,
ScalingInstruction -> Maybe PredictiveScalingMode
predictiveScalingMode :: Prelude.Maybe PredictiveScalingMode,
ScalingInstruction -> Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior :: Prelude.Maybe ScalingPolicyUpdateBehavior,
ScalingInstruction -> Maybe Natural
scheduledActionBufferTime :: Prelude.Maybe Prelude.Natural,
ScalingInstruction -> ServiceNamespace
serviceNamespace :: ServiceNamespace,
ScalingInstruction -> Text
resourceId :: Prelude.Text,
ScalingInstruction -> ScalableDimension
scalableDimension :: ScalableDimension,
ScalingInstruction -> Int
minCapacity :: Prelude.Int,
ScalingInstruction -> Int
maxCapacity :: Prelude.Int,
ScalingInstruction -> [TargetTrackingConfiguration]
targetTrackingConfigurations :: [TargetTrackingConfiguration]
}
deriving (ScalingInstruction -> ScalingInstruction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingInstruction -> ScalingInstruction -> Bool
$c/= :: ScalingInstruction -> ScalingInstruction -> Bool
== :: ScalingInstruction -> ScalingInstruction -> Bool
$c== :: ScalingInstruction -> ScalingInstruction -> Bool
Prelude.Eq, ReadPrec [ScalingInstruction]
ReadPrec ScalingInstruction
Int -> ReadS ScalingInstruction
ReadS [ScalingInstruction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingInstruction]
$creadListPrec :: ReadPrec [ScalingInstruction]
readPrec :: ReadPrec ScalingInstruction
$creadPrec :: ReadPrec ScalingInstruction
readList :: ReadS [ScalingInstruction]
$creadList :: ReadS [ScalingInstruction]
readsPrec :: Int -> ReadS ScalingInstruction
$creadsPrec :: Int -> ReadS ScalingInstruction
Prelude.Read, Int -> ScalingInstruction -> ShowS
[ScalingInstruction] -> ShowS
ScalingInstruction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingInstruction] -> ShowS
$cshowList :: [ScalingInstruction] -> ShowS
show :: ScalingInstruction -> String
$cshow :: ScalingInstruction -> String
showsPrec :: Int -> ScalingInstruction -> ShowS
$cshowsPrec :: Int -> ScalingInstruction -> ShowS
Prelude.Show, forall x. Rep ScalingInstruction x -> ScalingInstruction
forall x. ScalingInstruction -> Rep ScalingInstruction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingInstruction x -> ScalingInstruction
$cfrom :: forall x. ScalingInstruction -> Rep ScalingInstruction x
Prelude.Generic)
newScalingInstruction ::
ServiceNamespace ->
Prelude.Text ->
ScalableDimension ->
Prelude.Int ->
Prelude.Int ->
ScalingInstruction
newScalingInstruction :: ServiceNamespace
-> Text -> ScalableDimension -> Int -> Int -> ScalingInstruction
newScalingInstruction
ServiceNamespace
pServiceNamespace_
Text
pResourceId_
ScalableDimension
pScalableDimension_
Int
pMinCapacity_
Int
pMaxCapacity_ =
ScalingInstruction'
{ $sel:customizedLoadMetricSpecification:ScalingInstruction' :: Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification =
forall a. Maybe a
Prelude.Nothing,
$sel:disableDynamicScaling:ScalingInstruction' :: Maybe Bool
disableDynamicScaling = forall a. Maybe a
Prelude.Nothing,
$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification = forall a. Maybe a
Prelude.Nothing,
$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior =
forall a. Maybe a
Prelude.Nothing,
$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: Maybe Int
predictiveScalingMaxCapacityBuffer = forall a. Maybe a
Prelude.Nothing,
$sel:predictiveScalingMode:ScalingInstruction' :: Maybe PredictiveScalingMode
predictiveScalingMode = forall a. Maybe a
Prelude.Nothing,
$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior = forall a. Maybe a
Prelude.Nothing,
$sel:scheduledActionBufferTime:ScalingInstruction' :: Maybe Natural
scheduledActionBufferTime = forall a. Maybe a
Prelude.Nothing,
$sel:serviceNamespace:ScalingInstruction' :: ServiceNamespace
serviceNamespace = ServiceNamespace
pServiceNamespace_,
$sel:resourceId:ScalingInstruction' :: Text
resourceId = Text
pResourceId_,
$sel:scalableDimension:ScalingInstruction' :: ScalableDimension
scalableDimension = ScalableDimension
pScalableDimension_,
$sel:minCapacity:ScalingInstruction' :: Int
minCapacity = Int
pMinCapacity_,
$sel:maxCapacity:ScalingInstruction' :: Int
maxCapacity = Int
pMaxCapacity_,
$sel:targetTrackingConfigurations:ScalingInstruction' :: [TargetTrackingConfiguration]
targetTrackingConfigurations = forall a. Monoid a => a
Prelude.mempty
}
scalingInstruction_customizedLoadMetricSpecification :: Lens.Lens' ScalingInstruction (Prelude.Maybe CustomizedLoadMetricSpecification)
scalingInstruction_customizedLoadMetricSpecification :: Lens' ScalingInstruction (Maybe CustomizedLoadMetricSpecification)
scalingInstruction_customizedLoadMetricSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification :: Maybe CustomizedLoadMetricSpecification
$sel:customizedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification} -> Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe CustomizedLoadMetricSpecification
a -> ScalingInstruction
s {$sel:customizedLoadMetricSpecification:ScalingInstruction' :: Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification = Maybe CustomizedLoadMetricSpecification
a} :: ScalingInstruction)
scalingInstruction_disableDynamicScaling :: Lens.Lens' ScalingInstruction (Prelude.Maybe Prelude.Bool)
scalingInstruction_disableDynamicScaling :: Lens' ScalingInstruction (Maybe Bool)
scalingInstruction_disableDynamicScaling = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe Bool
disableDynamicScaling :: Maybe Bool
$sel:disableDynamicScaling:ScalingInstruction' :: ScalingInstruction -> Maybe Bool
disableDynamicScaling} -> Maybe Bool
disableDynamicScaling) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe Bool
a -> ScalingInstruction
s {$sel:disableDynamicScaling:ScalingInstruction' :: Maybe Bool
disableDynamicScaling = Maybe Bool
a} :: ScalingInstruction)
scalingInstruction_predefinedLoadMetricSpecification :: Lens.Lens' ScalingInstruction (Prelude.Maybe PredefinedLoadMetricSpecification)
scalingInstruction_predefinedLoadMetricSpecification :: Lens' ScalingInstruction (Maybe PredefinedLoadMetricSpecification)
scalingInstruction_predefinedLoadMetricSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification :: Maybe PredefinedLoadMetricSpecification
$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification} -> Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe PredefinedLoadMetricSpecification
a -> ScalingInstruction
s {$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification = Maybe PredefinedLoadMetricSpecification
a} :: ScalingInstruction)
scalingInstruction_predictiveScalingMaxCapacityBehavior :: Lens.Lens' ScalingInstruction (Prelude.Maybe PredictiveScalingMaxCapacityBehavior)
scalingInstruction_predictiveScalingMaxCapacityBehavior :: Lens'
ScalingInstruction (Maybe PredictiveScalingMaxCapacityBehavior)
scalingInstruction_predictiveScalingMaxCapacityBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior :: Maybe PredictiveScalingMaxCapacityBehavior
$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior} -> Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe PredictiveScalingMaxCapacityBehavior
a -> ScalingInstruction
s {$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior = Maybe PredictiveScalingMaxCapacityBehavior
a} :: ScalingInstruction)
scalingInstruction_predictiveScalingMaxCapacityBuffer :: Lens.Lens' ScalingInstruction (Prelude.Maybe Prelude.Int)
scalingInstruction_predictiveScalingMaxCapacityBuffer :: Lens' ScalingInstruction (Maybe Int)
scalingInstruction_predictiveScalingMaxCapacityBuffer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe Int
predictiveScalingMaxCapacityBuffer :: Maybe Int
$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: ScalingInstruction -> Maybe Int
predictiveScalingMaxCapacityBuffer} -> Maybe Int
predictiveScalingMaxCapacityBuffer) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe Int
a -> ScalingInstruction
s {$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: Maybe Int
predictiveScalingMaxCapacityBuffer = Maybe Int
a} :: ScalingInstruction)
scalingInstruction_predictiveScalingMode :: Lens.Lens' ScalingInstruction (Prelude.Maybe PredictiveScalingMode)
scalingInstruction_predictiveScalingMode :: Lens' ScalingInstruction (Maybe PredictiveScalingMode)
scalingInstruction_predictiveScalingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe PredictiveScalingMode
predictiveScalingMode :: Maybe PredictiveScalingMode
$sel:predictiveScalingMode:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMode
predictiveScalingMode} -> Maybe PredictiveScalingMode
predictiveScalingMode) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe PredictiveScalingMode
a -> ScalingInstruction
s {$sel:predictiveScalingMode:ScalingInstruction' :: Maybe PredictiveScalingMode
predictiveScalingMode = Maybe PredictiveScalingMode
a} :: ScalingInstruction)
scalingInstruction_scalingPolicyUpdateBehavior :: Lens.Lens' ScalingInstruction (Prelude.Maybe ScalingPolicyUpdateBehavior)
scalingInstruction_scalingPolicyUpdateBehavior :: Lens' ScalingInstruction (Maybe ScalingPolicyUpdateBehavior)
scalingInstruction_scalingPolicyUpdateBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior :: Maybe ScalingPolicyUpdateBehavior
$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior} -> Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe ScalingPolicyUpdateBehavior
a -> ScalingInstruction
s {$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior = Maybe ScalingPolicyUpdateBehavior
a} :: ScalingInstruction)
scalingInstruction_scheduledActionBufferTime :: Lens.Lens' ScalingInstruction (Prelude.Maybe Prelude.Natural)
scalingInstruction_scheduledActionBufferTime :: Lens' ScalingInstruction (Maybe Natural)
scalingInstruction_scheduledActionBufferTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Maybe Natural
scheduledActionBufferTime :: Maybe Natural
$sel:scheduledActionBufferTime:ScalingInstruction' :: ScalingInstruction -> Maybe Natural
scheduledActionBufferTime} -> Maybe Natural
scheduledActionBufferTime) (\s :: ScalingInstruction
s@ScalingInstruction' {} Maybe Natural
a -> ScalingInstruction
s {$sel:scheduledActionBufferTime:ScalingInstruction' :: Maybe Natural
scheduledActionBufferTime = Maybe Natural
a} :: ScalingInstruction)
scalingInstruction_serviceNamespace :: Lens.Lens' ScalingInstruction ServiceNamespace
scalingInstruction_serviceNamespace :: Lens' ScalingInstruction ServiceNamespace
scalingInstruction_serviceNamespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {ServiceNamespace
serviceNamespace :: ServiceNamespace
$sel:serviceNamespace:ScalingInstruction' :: ScalingInstruction -> ServiceNamespace
serviceNamespace} -> ServiceNamespace
serviceNamespace) (\s :: ScalingInstruction
s@ScalingInstruction' {} ServiceNamespace
a -> ScalingInstruction
s {$sel:serviceNamespace:ScalingInstruction' :: ServiceNamespace
serviceNamespace = ServiceNamespace
a} :: ScalingInstruction)
scalingInstruction_resourceId :: Lens.Lens' ScalingInstruction Prelude.Text
scalingInstruction_resourceId :: Lens' ScalingInstruction Text
scalingInstruction_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Text
resourceId :: Text
$sel:resourceId:ScalingInstruction' :: ScalingInstruction -> Text
resourceId} -> Text
resourceId) (\s :: ScalingInstruction
s@ScalingInstruction' {} Text
a -> ScalingInstruction
s {$sel:resourceId:ScalingInstruction' :: Text
resourceId = Text
a} :: ScalingInstruction)
scalingInstruction_scalableDimension :: Lens.Lens' ScalingInstruction ScalableDimension
scalingInstruction_scalableDimension :: Lens' ScalingInstruction ScalableDimension
scalingInstruction_scalableDimension = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {ScalableDimension
scalableDimension :: ScalableDimension
$sel:scalableDimension:ScalingInstruction' :: ScalingInstruction -> ScalableDimension
scalableDimension} -> ScalableDimension
scalableDimension) (\s :: ScalingInstruction
s@ScalingInstruction' {} ScalableDimension
a -> ScalingInstruction
s {$sel:scalableDimension:ScalingInstruction' :: ScalableDimension
scalableDimension = ScalableDimension
a} :: ScalingInstruction)
scalingInstruction_minCapacity :: Lens.Lens' ScalingInstruction Prelude.Int
scalingInstruction_minCapacity :: Lens' ScalingInstruction Int
scalingInstruction_minCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Int
minCapacity :: Int
$sel:minCapacity:ScalingInstruction' :: ScalingInstruction -> Int
minCapacity} -> Int
minCapacity) (\s :: ScalingInstruction
s@ScalingInstruction' {} Int
a -> ScalingInstruction
s {$sel:minCapacity:ScalingInstruction' :: Int
minCapacity = Int
a} :: ScalingInstruction)
scalingInstruction_maxCapacity :: Lens.Lens' ScalingInstruction Prelude.Int
scalingInstruction_maxCapacity :: Lens' ScalingInstruction Int
scalingInstruction_maxCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {Int
maxCapacity :: Int
$sel:maxCapacity:ScalingInstruction' :: ScalingInstruction -> Int
maxCapacity} -> Int
maxCapacity) (\s :: ScalingInstruction
s@ScalingInstruction' {} Int
a -> ScalingInstruction
s {$sel:maxCapacity:ScalingInstruction' :: Int
maxCapacity = Int
a} :: ScalingInstruction)
scalingInstruction_targetTrackingConfigurations :: Lens.Lens' ScalingInstruction [TargetTrackingConfiguration]
scalingInstruction_targetTrackingConfigurations :: Lens' ScalingInstruction [TargetTrackingConfiguration]
scalingInstruction_targetTrackingConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingInstruction' {[TargetTrackingConfiguration]
targetTrackingConfigurations :: [TargetTrackingConfiguration]
$sel:targetTrackingConfigurations:ScalingInstruction' :: ScalingInstruction -> [TargetTrackingConfiguration]
targetTrackingConfigurations} -> [TargetTrackingConfiguration]
targetTrackingConfigurations) (\s :: ScalingInstruction
s@ScalingInstruction' {} [TargetTrackingConfiguration]
a -> ScalingInstruction
s {$sel:targetTrackingConfigurations:ScalingInstruction' :: [TargetTrackingConfiguration]
targetTrackingConfigurations = [TargetTrackingConfiguration]
a} :: ScalingInstruction) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ScalingInstruction where
parseJSON :: Value -> Parser ScalingInstruction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ScalingInstruction"
( \Object
x ->
Maybe CustomizedLoadMetricSpecification
-> Maybe Bool
-> Maybe PredefinedLoadMetricSpecification
-> Maybe PredictiveScalingMaxCapacityBehavior
-> Maybe Int
-> Maybe PredictiveScalingMode
-> Maybe ScalingPolicyUpdateBehavior
-> Maybe Natural
-> ServiceNamespace
-> Text
-> ScalableDimension
-> Int
-> Int
-> [TargetTrackingConfiguration]
-> ScalingInstruction
ScalingInstruction'
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
"CustomizedLoadMetricSpecification")
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
"DisableDynamicScaling")
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
"PredefinedLoadMetricSpecification")
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
"PredictiveScalingMaxCapacityBehavior")
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
"PredictiveScalingMaxCapacityBuffer")
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
"PredictiveScalingMode")
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
"ScalingPolicyUpdateBehavior")
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
"ScheduledActionBufferTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ServiceNamespace")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalableDimension")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MinCapacity")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaxCapacity")
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
"TargetTrackingConfigurations"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ScalingInstruction where
hashWithSalt :: Int -> ScalingInstruction -> Int
hashWithSalt Int
_salt ScalingInstruction' {Int
[TargetTrackingConfiguration]
Maybe Bool
Maybe Int
Maybe Natural
Maybe CustomizedLoadMetricSpecification
Maybe PredefinedLoadMetricSpecification
Maybe PredictiveScalingMaxCapacityBehavior
Maybe PredictiveScalingMode
Maybe ScalingPolicyUpdateBehavior
Text
ScalableDimension
ServiceNamespace
targetTrackingConfigurations :: [TargetTrackingConfiguration]
maxCapacity :: Int
minCapacity :: Int
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scheduledActionBufferTime :: Maybe Natural
scalingPolicyUpdateBehavior :: Maybe ScalingPolicyUpdateBehavior
predictiveScalingMode :: Maybe PredictiveScalingMode
predictiveScalingMaxCapacityBuffer :: Maybe Int
predictiveScalingMaxCapacityBehavior :: Maybe PredictiveScalingMaxCapacityBehavior
predefinedLoadMetricSpecification :: Maybe PredefinedLoadMetricSpecification
disableDynamicScaling :: Maybe Bool
customizedLoadMetricSpecification :: Maybe CustomizedLoadMetricSpecification
$sel:targetTrackingConfigurations:ScalingInstruction' :: ScalingInstruction -> [TargetTrackingConfiguration]
$sel:maxCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:minCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:scalableDimension:ScalingInstruction' :: ScalingInstruction -> ScalableDimension
$sel:resourceId:ScalingInstruction' :: ScalingInstruction -> Text
$sel:serviceNamespace:ScalingInstruction' :: ScalingInstruction -> ServiceNamespace
$sel:scheduledActionBufferTime:ScalingInstruction' :: ScalingInstruction -> Maybe Natural
$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe ScalingPolicyUpdateBehavior
$sel:predictiveScalingMode:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMode
$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: ScalingInstruction -> Maybe Int
$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMaxCapacityBehavior
$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe PredefinedLoadMetricSpecification
$sel:disableDynamicScaling:ScalingInstruction' :: ScalingInstruction -> Maybe Bool
$sel:customizedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe CustomizedLoadMetricSpecification
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableDynamicScaling
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
predictiveScalingMaxCapacityBuffer
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PredictiveScalingMode
predictiveScalingMode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
scheduledActionBufferTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ServiceNamespace
serviceNamespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalableDimension
scalableDimension
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
minCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maxCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [TargetTrackingConfiguration]
targetTrackingConfigurations
instance Prelude.NFData ScalingInstruction where
rnf :: ScalingInstruction -> ()
rnf ScalingInstruction' {Int
[TargetTrackingConfiguration]
Maybe Bool
Maybe Int
Maybe Natural
Maybe CustomizedLoadMetricSpecification
Maybe PredefinedLoadMetricSpecification
Maybe PredictiveScalingMaxCapacityBehavior
Maybe PredictiveScalingMode
Maybe ScalingPolicyUpdateBehavior
Text
ScalableDimension
ServiceNamespace
targetTrackingConfigurations :: [TargetTrackingConfiguration]
maxCapacity :: Int
minCapacity :: Int
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scheduledActionBufferTime :: Maybe Natural
scalingPolicyUpdateBehavior :: Maybe ScalingPolicyUpdateBehavior
predictiveScalingMode :: Maybe PredictiveScalingMode
predictiveScalingMaxCapacityBuffer :: Maybe Int
predictiveScalingMaxCapacityBehavior :: Maybe PredictiveScalingMaxCapacityBehavior
predefinedLoadMetricSpecification :: Maybe PredefinedLoadMetricSpecification
disableDynamicScaling :: Maybe Bool
customizedLoadMetricSpecification :: Maybe CustomizedLoadMetricSpecification
$sel:targetTrackingConfigurations:ScalingInstruction' :: ScalingInstruction -> [TargetTrackingConfiguration]
$sel:maxCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:minCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:scalableDimension:ScalingInstruction' :: ScalingInstruction -> ScalableDimension
$sel:resourceId:ScalingInstruction' :: ScalingInstruction -> Text
$sel:serviceNamespace:ScalingInstruction' :: ScalingInstruction -> ServiceNamespace
$sel:scheduledActionBufferTime:ScalingInstruction' :: ScalingInstruction -> Maybe Natural
$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe ScalingPolicyUpdateBehavior
$sel:predictiveScalingMode:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMode
$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: ScalingInstruction -> Maybe Int
$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMaxCapacityBehavior
$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe PredefinedLoadMetricSpecification
$sel:disableDynamicScaling:ScalingInstruction' :: ScalingInstruction -> Maybe Bool
$sel:customizedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe CustomizedLoadMetricSpecification
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomizedLoadMetricSpecification
customizedLoadMetricSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableDynamicScaling
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
predictiveScalingMaxCapacityBuffer
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PredictiveScalingMode
predictiveScalingMode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
scheduledActionBufferTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ServiceNamespace
serviceNamespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalableDimension
scalableDimension
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
minCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maxCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [TargetTrackingConfiguration]
targetTrackingConfigurations
instance Data.ToJSON ScalingInstruction where
toJSON :: ScalingInstruction -> Value
toJSON ScalingInstruction' {Int
[TargetTrackingConfiguration]
Maybe Bool
Maybe Int
Maybe Natural
Maybe CustomizedLoadMetricSpecification
Maybe PredefinedLoadMetricSpecification
Maybe PredictiveScalingMaxCapacityBehavior
Maybe PredictiveScalingMode
Maybe ScalingPolicyUpdateBehavior
Text
ScalableDimension
ServiceNamespace
targetTrackingConfigurations :: [TargetTrackingConfiguration]
maxCapacity :: Int
minCapacity :: Int
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scheduledActionBufferTime :: Maybe Natural
scalingPolicyUpdateBehavior :: Maybe ScalingPolicyUpdateBehavior
predictiveScalingMode :: Maybe PredictiveScalingMode
predictiveScalingMaxCapacityBuffer :: Maybe Int
predictiveScalingMaxCapacityBehavior :: Maybe PredictiveScalingMaxCapacityBehavior
predefinedLoadMetricSpecification :: Maybe PredefinedLoadMetricSpecification
disableDynamicScaling :: Maybe Bool
customizedLoadMetricSpecification :: Maybe CustomizedLoadMetricSpecification
$sel:targetTrackingConfigurations:ScalingInstruction' :: ScalingInstruction -> [TargetTrackingConfiguration]
$sel:maxCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:minCapacity:ScalingInstruction' :: ScalingInstruction -> Int
$sel:scalableDimension:ScalingInstruction' :: ScalingInstruction -> ScalableDimension
$sel:resourceId:ScalingInstruction' :: ScalingInstruction -> Text
$sel:serviceNamespace:ScalingInstruction' :: ScalingInstruction -> ServiceNamespace
$sel:scheduledActionBufferTime:ScalingInstruction' :: ScalingInstruction -> Maybe Natural
$sel:scalingPolicyUpdateBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe ScalingPolicyUpdateBehavior
$sel:predictiveScalingMode:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMode
$sel:predictiveScalingMaxCapacityBuffer:ScalingInstruction' :: ScalingInstruction -> Maybe Int
$sel:predictiveScalingMaxCapacityBehavior:ScalingInstruction' :: ScalingInstruction -> Maybe PredictiveScalingMaxCapacityBehavior
$sel:predefinedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe PredefinedLoadMetricSpecification
$sel:disableDynamicScaling:ScalingInstruction' :: ScalingInstruction -> Maybe Bool
$sel:customizedLoadMetricSpecification:ScalingInstruction' :: ScalingInstruction -> Maybe CustomizedLoadMetricSpecification
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CustomizedLoadMetricSpecification" 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 CustomizedLoadMetricSpecification
customizedLoadMetricSpecification,
(Key
"DisableDynamicScaling" 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 Bool
disableDynamicScaling,
(Key
"PredefinedLoadMetricSpecification" 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 PredefinedLoadMetricSpecification
predefinedLoadMetricSpecification,
(Key
"PredictiveScalingMaxCapacityBehavior" 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 PredictiveScalingMaxCapacityBehavior
predictiveScalingMaxCapacityBehavior,
(Key
"PredictiveScalingMaxCapacityBuffer" 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
predictiveScalingMaxCapacityBuffer,
(Key
"PredictiveScalingMode" 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 PredictiveScalingMode
predictiveScalingMode,
(Key
"ScalingPolicyUpdateBehavior" 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 ScalingPolicyUpdateBehavior
scalingPolicyUpdateBehavior,
(Key
"ScheduledActionBufferTime" 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
scheduledActionBufferTime,
forall a. a -> Maybe a
Prelude.Just
(Key
"ServiceNamespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ServiceNamespace
serviceNamespace),
forall a. a -> Maybe a
Prelude.Just (Key
"ResourceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceId),
forall a. a -> Maybe a
Prelude.Just
(Key
"ScalableDimension" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ScalableDimension
scalableDimension),
forall a. a -> Maybe a
Prelude.Just (Key
"MinCapacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
minCapacity),
forall a. a -> Maybe a
Prelude.Just (Key
"MaxCapacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
maxCapacity),
forall a. a -> Maybe a
Prelude.Just
( Key
"TargetTrackingConfigurations"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [TargetTrackingConfiguration]
targetTrackingConfigurations
)
]
)