{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AutoScaling.PutScalingPolicy
(
PutScalingPolicy (..),
newPutScalingPolicy,
putScalingPolicy_minAdjustmentStep,
putScalingPolicy_estimatedInstanceWarmup,
putScalingPolicy_enabled,
putScalingPolicy_policyType,
putScalingPolicy_stepAdjustments,
putScalingPolicy_targetTrackingConfiguration,
putScalingPolicy_adjustmentType,
putScalingPolicy_predictiveScalingConfiguration,
putScalingPolicy_scalingAdjustment,
putScalingPolicy_cooldown,
putScalingPolicy_metricAggregationType,
putScalingPolicy_minAdjustmentMagnitude,
putScalingPolicy_autoScalingGroupName,
putScalingPolicy_policyName,
PutScalingPolicyResponse (..),
newPutScalingPolicyResponse,
putScalingPolicyResponse_policyARN,
putScalingPolicyResponse_alarms,
putScalingPolicyResponse_httpStatus,
)
where
import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutScalingPolicy = PutScalingPolicy'
{
PutScalingPolicy -> Maybe Int
minAdjustmentStep :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe Int
estimatedInstanceWarmup :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
PutScalingPolicy -> Maybe Text
policyType :: Prelude.Maybe Prelude.Text,
PutScalingPolicy -> Maybe [StepAdjustment]
stepAdjustments :: Prelude.Maybe [StepAdjustment],
PutScalingPolicy -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration :: Prelude.Maybe TargetTrackingConfiguration,
PutScalingPolicy -> Maybe Text
adjustmentType :: Prelude.Maybe Prelude.Text,
PutScalingPolicy -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration :: Prelude.Maybe PredictiveScalingConfiguration,
PutScalingPolicy -> Maybe Int
scalingAdjustment :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe Int
cooldown :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe Text
metricAggregationType :: Prelude.Maybe Prelude.Text,
PutScalingPolicy -> Maybe Int
minAdjustmentMagnitude :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Text
autoScalingGroupName :: Prelude.Text,
PutScalingPolicy -> Text
policyName :: Prelude.Text
}
deriving (PutScalingPolicy -> PutScalingPolicy -> Bool
(PutScalingPolicy -> PutScalingPolicy -> Bool)
-> (PutScalingPolicy -> PutScalingPolicy -> Bool)
-> Eq PutScalingPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScalingPolicy -> PutScalingPolicy -> Bool
$c/= :: PutScalingPolicy -> PutScalingPolicy -> Bool
== :: PutScalingPolicy -> PutScalingPolicy -> Bool
$c== :: PutScalingPolicy -> PutScalingPolicy -> Bool
Prelude.Eq, ReadPrec [PutScalingPolicy]
ReadPrec PutScalingPolicy
Int -> ReadS PutScalingPolicy
ReadS [PutScalingPolicy]
(Int -> ReadS PutScalingPolicy)
-> ReadS [PutScalingPolicy]
-> ReadPrec PutScalingPolicy
-> ReadPrec [PutScalingPolicy]
-> Read PutScalingPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScalingPolicy]
$creadListPrec :: ReadPrec [PutScalingPolicy]
readPrec :: ReadPrec PutScalingPolicy
$creadPrec :: ReadPrec PutScalingPolicy
readList :: ReadS [PutScalingPolicy]
$creadList :: ReadS [PutScalingPolicy]
readsPrec :: Int -> ReadS PutScalingPolicy
$creadsPrec :: Int -> ReadS PutScalingPolicy
Prelude.Read, Int -> PutScalingPolicy -> ShowS
[PutScalingPolicy] -> ShowS
PutScalingPolicy -> String
(Int -> PutScalingPolicy -> ShowS)
-> (PutScalingPolicy -> String)
-> ([PutScalingPolicy] -> ShowS)
-> Show PutScalingPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScalingPolicy] -> ShowS
$cshowList :: [PutScalingPolicy] -> ShowS
show :: PutScalingPolicy -> String
$cshow :: PutScalingPolicy -> String
showsPrec :: Int -> PutScalingPolicy -> ShowS
$cshowsPrec :: Int -> PutScalingPolicy -> ShowS
Prelude.Show, (forall x. PutScalingPolicy -> Rep PutScalingPolicy x)
-> (forall x. Rep PutScalingPolicy x -> PutScalingPolicy)
-> Generic PutScalingPolicy
forall x. Rep PutScalingPolicy x -> PutScalingPolicy
forall x. PutScalingPolicy -> Rep PutScalingPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutScalingPolicy x -> PutScalingPolicy
$cfrom :: forall x. PutScalingPolicy -> Rep PutScalingPolicy x
Prelude.Generic)
newPutScalingPolicy ::
Prelude.Text ->
Prelude.Text ->
PutScalingPolicy
newPutScalingPolicy :: Text -> Text -> PutScalingPolicy
newPutScalingPolicy
Text
pAutoScalingGroupName_
Text
pPolicyName_ =
PutScalingPolicy' :: Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe [StepAdjustment]
-> Maybe TargetTrackingConfiguration
-> Maybe Text
-> Maybe PredictiveScalingConfiguration
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> PutScalingPolicy
PutScalingPolicy'
{ $sel:minAdjustmentStep:PutScalingPolicy' :: Maybe Int
minAdjustmentStep =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:estimatedInstanceWarmup:PutScalingPolicy' :: Maybe Int
estimatedInstanceWarmup = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:PutScalingPolicy' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:policyType:PutScalingPolicy' :: Maybe Text
policyType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stepAdjustments:PutScalingPolicy' :: Maybe [StepAdjustment]
stepAdjustments = Maybe [StepAdjustment]
forall a. Maybe a
Prelude.Nothing,
$sel:targetTrackingConfiguration:PutScalingPolicy' :: Maybe TargetTrackingConfiguration
targetTrackingConfiguration = Maybe TargetTrackingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:adjustmentType:PutScalingPolicy' :: Maybe Text
adjustmentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:predictiveScalingConfiguration:PutScalingPolicy' :: Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration = Maybe PredictiveScalingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:scalingAdjustment:PutScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cooldown:PutScalingPolicy' :: Maybe Int
cooldown = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:metricAggregationType:PutScalingPolicy' :: Maybe Text
metricAggregationType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:minAdjustmentMagnitude:PutScalingPolicy' :: Maybe Int
minAdjustmentMagnitude = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:PutScalingPolicy' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_,
$sel:policyName:PutScalingPolicy' :: Text
policyName = Text
pPolicyName_
}
putScalingPolicy_minAdjustmentStep :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_minAdjustmentStep :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_minAdjustmentStep = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
minAdjustmentStep :: Maybe Int
$sel:minAdjustmentStep:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
minAdjustmentStep} -> Maybe Int
minAdjustmentStep) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:minAdjustmentStep:PutScalingPolicy' :: Maybe Int
minAdjustmentStep = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_estimatedInstanceWarmup :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_estimatedInstanceWarmup :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_estimatedInstanceWarmup = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
estimatedInstanceWarmup :: Maybe Int
$sel:estimatedInstanceWarmup:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
estimatedInstanceWarmup} -> Maybe Int
estimatedInstanceWarmup) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:estimatedInstanceWarmup:PutScalingPolicy' :: Maybe Int
estimatedInstanceWarmup = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_enabled :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Bool)
putScalingPolicy_enabled :: (Maybe Bool -> f (Maybe Bool))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_enabled = (PutScalingPolicy -> Maybe Bool)
-> (PutScalingPolicy -> Maybe Bool -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:PutScalingPolicy' :: PutScalingPolicy -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Bool
a -> PutScalingPolicy
s {$sel:enabled:PutScalingPolicy' :: Maybe Bool
enabled = Maybe Bool
a} :: PutScalingPolicy)
putScalingPolicy_policyType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Text)
putScalingPolicy_policyType :: (Maybe Text -> f (Maybe Text))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_policyType = (PutScalingPolicy -> Maybe Text)
-> (PutScalingPolicy -> Maybe Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Text
policyType :: Maybe Text
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
policyType} -> Maybe Text
policyType) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Text
a -> PutScalingPolicy
s {$sel:policyType:PutScalingPolicy' :: Maybe Text
policyType = Maybe Text
a} :: PutScalingPolicy)
putScalingPolicy_stepAdjustments :: Lens.Lens' PutScalingPolicy (Prelude.Maybe [StepAdjustment])
putScalingPolicy_stepAdjustments :: (Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_stepAdjustments = (PutScalingPolicy -> Maybe [StepAdjustment])
-> (PutScalingPolicy -> Maybe [StepAdjustment] -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe [StepAdjustment])
(Maybe [StepAdjustment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe [StepAdjustment]
stepAdjustments :: Maybe [StepAdjustment]
$sel:stepAdjustments:PutScalingPolicy' :: PutScalingPolicy -> Maybe [StepAdjustment]
stepAdjustments} -> Maybe [StepAdjustment]
stepAdjustments) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe [StepAdjustment]
a -> PutScalingPolicy
s {$sel:stepAdjustments:PutScalingPolicy' :: Maybe [StepAdjustment]
stepAdjustments = Maybe [StepAdjustment]
a} :: PutScalingPolicy) ((Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> PutScalingPolicy -> f PutScalingPolicy)
-> ((Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> (Maybe [StepAdjustment] -> f (Maybe [StepAdjustment]))
-> PutScalingPolicy
-> f PutScalingPolicy
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
putScalingPolicy_targetTrackingConfiguration :: Lens.Lens' PutScalingPolicy (Prelude.Maybe TargetTrackingConfiguration)
putScalingPolicy_targetTrackingConfiguration :: (Maybe TargetTrackingConfiguration
-> f (Maybe TargetTrackingConfiguration))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_targetTrackingConfiguration = (PutScalingPolicy -> Maybe TargetTrackingConfiguration)
-> (PutScalingPolicy
-> Maybe TargetTrackingConfiguration -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe TargetTrackingConfiguration)
(Maybe TargetTrackingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe TargetTrackingConfiguration
targetTrackingConfiguration :: Maybe TargetTrackingConfiguration
$sel:targetTrackingConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration} -> Maybe TargetTrackingConfiguration
targetTrackingConfiguration) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe TargetTrackingConfiguration
a -> PutScalingPolicy
s {$sel:targetTrackingConfiguration:PutScalingPolicy' :: Maybe TargetTrackingConfiguration
targetTrackingConfiguration = Maybe TargetTrackingConfiguration
a} :: PutScalingPolicy)
putScalingPolicy_adjustmentType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Text)
putScalingPolicy_adjustmentType :: (Maybe Text -> f (Maybe Text))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_adjustmentType = (PutScalingPolicy -> Maybe Text)
-> (PutScalingPolicy -> Maybe Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Text
adjustmentType :: Maybe Text
$sel:adjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
adjustmentType} -> Maybe Text
adjustmentType) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Text
a -> PutScalingPolicy
s {$sel:adjustmentType:PutScalingPolicy' :: Maybe Text
adjustmentType = Maybe Text
a} :: PutScalingPolicy)
putScalingPolicy_predictiveScalingConfiguration :: Lens.Lens' PutScalingPolicy (Prelude.Maybe PredictiveScalingConfiguration)
putScalingPolicy_predictiveScalingConfiguration :: (Maybe PredictiveScalingConfiguration
-> f (Maybe PredictiveScalingConfiguration))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_predictiveScalingConfiguration = (PutScalingPolicy -> Maybe PredictiveScalingConfiguration)
-> (PutScalingPolicy
-> Maybe PredictiveScalingConfiguration -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe PredictiveScalingConfiguration)
(Maybe PredictiveScalingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration :: Maybe PredictiveScalingConfiguration
$sel:predictiveScalingConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration} -> Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe PredictiveScalingConfiguration
a -> PutScalingPolicy
s {$sel:predictiveScalingConfiguration:PutScalingPolicy' :: Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration = Maybe PredictiveScalingConfiguration
a} :: PutScalingPolicy)
putScalingPolicy_scalingAdjustment :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_scalingAdjustment :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_scalingAdjustment = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
scalingAdjustment :: Maybe Int
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
scalingAdjustment} -> Maybe Int
scalingAdjustment) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:scalingAdjustment:PutScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_cooldown :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_cooldown :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_cooldown = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
cooldown :: Maybe Int
$sel:cooldown:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
cooldown} -> Maybe Int
cooldown) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:cooldown:PutScalingPolicy' :: Maybe Int
cooldown = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_metricAggregationType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Text)
putScalingPolicy_metricAggregationType :: (Maybe Text -> f (Maybe Text))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_metricAggregationType = (PutScalingPolicy -> Maybe Text)
-> (PutScalingPolicy -> Maybe Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Text
metricAggregationType :: Maybe Text
$sel:metricAggregationType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
metricAggregationType} -> Maybe Text
metricAggregationType) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Text
a -> PutScalingPolicy
s {$sel:metricAggregationType:PutScalingPolicy' :: Maybe Text
metricAggregationType = Maybe Text
a} :: PutScalingPolicy)
putScalingPolicy_minAdjustmentMagnitude :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_minAdjustmentMagnitude :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_minAdjustmentMagnitude = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
minAdjustmentMagnitude :: Maybe Int
$sel:minAdjustmentMagnitude:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
minAdjustmentMagnitude} -> Maybe Int
minAdjustmentMagnitude) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:minAdjustmentMagnitude:PutScalingPolicy' :: Maybe Int
minAdjustmentMagnitude = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_autoScalingGroupName :: Lens.Lens' PutScalingPolicy Prelude.Text
putScalingPolicy_autoScalingGroupName :: (Text -> f Text) -> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_autoScalingGroupName = (PutScalingPolicy -> Text)
-> (PutScalingPolicy -> Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:PutScalingPolicy' :: PutScalingPolicy -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Text
a -> PutScalingPolicy
s {$sel:autoScalingGroupName:PutScalingPolicy' :: Text
autoScalingGroupName = Text
a} :: PutScalingPolicy)
putScalingPolicy_policyName :: Lens.Lens' PutScalingPolicy Prelude.Text
putScalingPolicy_policyName :: (Text -> f Text) -> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_policyName = (PutScalingPolicy -> Text)
-> (PutScalingPolicy -> Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Text
policyName :: Text
$sel:policyName:PutScalingPolicy' :: PutScalingPolicy -> Text
policyName} -> Text
policyName) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Text
a -> PutScalingPolicy
s {$sel:policyName:PutScalingPolicy' :: Text
policyName = Text
a} :: PutScalingPolicy)
instance Core.AWSRequest PutScalingPolicy where
type
AWSResponse PutScalingPolicy =
PutScalingPolicyResponse
request :: PutScalingPolicy -> Request PutScalingPolicy
request = Service -> PutScalingPolicy -> Request PutScalingPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutScalingPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutScalingPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse PutScalingPolicy))
-> Logger
-> Service
-> Proxy PutScalingPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutScalingPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"PutScalingPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Maybe [Alarm] -> Int -> PutScalingPolicyResponse
PutScalingPolicyResponse'
(Maybe Text -> Maybe [Alarm] -> Int -> PutScalingPolicyResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Alarm] -> Int -> PutScalingPolicyResponse)
forall (f :: * -> *) a b. Functor 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] -> Int -> PutScalingPolicyResponse)
-> Either String (Maybe [Alarm])
-> Either String (Int -> PutScalingPolicyResponse)
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 (Int -> PutScalingPolicyResponse)
-> Either String Int -> Either String PutScalingPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutScalingPolicy
instance Prelude.NFData PutScalingPolicy
instance Core.ToHeaders PutScalingPolicy where
toHeaders :: PutScalingPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> PutScalingPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutScalingPolicy where
toPath :: PutScalingPolicy -> ByteString
toPath = ByteString -> PutScalingPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutScalingPolicy where
toQuery :: PutScalingPolicy -> QueryString
toQuery PutScalingPolicy' {Maybe Bool
Maybe Int
Maybe [StepAdjustment]
Maybe Text
Maybe PredictiveScalingConfiguration
Maybe TargetTrackingConfiguration
Text
policyName :: Text
autoScalingGroupName :: Text
minAdjustmentMagnitude :: Maybe Int
metricAggregationType :: Maybe Text
cooldown :: Maybe Int
scalingAdjustment :: Maybe Int
predictiveScalingConfiguration :: Maybe PredictiveScalingConfiguration
adjustmentType :: Maybe Text
targetTrackingConfiguration :: Maybe TargetTrackingConfiguration
stepAdjustments :: Maybe [StepAdjustment]
policyType :: Maybe Text
enabled :: Maybe Bool
estimatedInstanceWarmup :: Maybe Int
minAdjustmentStep :: Maybe Int
$sel:policyName:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:autoScalingGroupName:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:minAdjustmentMagnitude:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:metricAggregationType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
$sel:cooldown:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:predictiveScalingConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe PredictiveScalingConfiguration
$sel:adjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
$sel:targetTrackingConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetTrackingConfiguration
$sel:stepAdjustments:PutScalingPolicy' :: PutScalingPolicy -> Maybe [StepAdjustment]
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe Text
$sel:enabled:PutScalingPolicy' :: PutScalingPolicy -> Maybe Bool
$sel:estimatedInstanceWarmup:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:minAdjustmentStep:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PutScalingPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"MinAdjustmentStep" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
minAdjustmentStep,
ByteString
"EstimatedInstanceWarmup"
ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
estimatedInstanceWarmup,
ByteString
"Enabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enabled,
ByteString
"PolicyType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
policyType,
ByteString
"StepAdjustments"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [StepAdjustment] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([StepAdjustment] -> QueryString)
-> Maybe [StepAdjustment] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [StepAdjustment]
stepAdjustments
),
ByteString
"TargetTrackingConfiguration"
ByteString -> Maybe TargetTrackingConfiguration -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TargetTrackingConfiguration
targetTrackingConfiguration,
ByteString
"AdjustmentType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
adjustmentType,
ByteString
"PredictiveScalingConfiguration"
ByteString -> Maybe PredictiveScalingConfiguration -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingConfiguration
predictiveScalingConfiguration,
ByteString
"ScalingAdjustment" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
scalingAdjustment,
ByteString
"Cooldown" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
cooldown,
ByteString
"MetricAggregationType"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
metricAggregationType,
ByteString
"MinAdjustmentMagnitude"
ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
minAdjustmentMagnitude,
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data PutScalingPolicyResponse = PutScalingPolicyResponse'
{
PutScalingPolicyResponse -> Maybe Text
policyARN :: Prelude.Maybe Prelude.Text,
PutScalingPolicyResponse -> Maybe [Alarm]
alarms :: Prelude.Maybe [Alarm],
PutScalingPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
(PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool)
-> (PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool)
-> Eq PutScalingPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
$c/= :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
== :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
$c== :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutScalingPolicyResponse]
ReadPrec PutScalingPolicyResponse
Int -> ReadS PutScalingPolicyResponse
ReadS [PutScalingPolicyResponse]
(Int -> ReadS PutScalingPolicyResponse)
-> ReadS [PutScalingPolicyResponse]
-> ReadPrec PutScalingPolicyResponse
-> ReadPrec [PutScalingPolicyResponse]
-> Read PutScalingPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScalingPolicyResponse]
$creadListPrec :: ReadPrec [PutScalingPolicyResponse]
readPrec :: ReadPrec PutScalingPolicyResponse
$creadPrec :: ReadPrec PutScalingPolicyResponse
readList :: ReadS [PutScalingPolicyResponse]
$creadList :: ReadS [PutScalingPolicyResponse]
readsPrec :: Int -> ReadS PutScalingPolicyResponse
$creadsPrec :: Int -> ReadS PutScalingPolicyResponse
Prelude.Read, Int -> PutScalingPolicyResponse -> ShowS
[PutScalingPolicyResponse] -> ShowS
PutScalingPolicyResponse -> String
(Int -> PutScalingPolicyResponse -> ShowS)
-> (PutScalingPolicyResponse -> String)
-> ([PutScalingPolicyResponse] -> ShowS)
-> Show PutScalingPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScalingPolicyResponse] -> ShowS
$cshowList :: [PutScalingPolicyResponse] -> ShowS
show :: PutScalingPolicyResponse -> String
$cshow :: PutScalingPolicyResponse -> String
showsPrec :: Int -> PutScalingPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutScalingPolicyResponse -> ShowS
Prelude.Show, (forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x)
-> (forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse)
-> Generic PutScalingPolicyResponse
forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse
forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse
$cfrom :: forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x
Prelude.Generic)
newPutScalingPolicyResponse ::
Prelude.Int ->
PutScalingPolicyResponse
newPutScalingPolicyResponse :: Int -> PutScalingPolicyResponse
newPutScalingPolicyResponse Int
pHttpStatus_ =
PutScalingPolicyResponse' :: Maybe Text -> Maybe [Alarm] -> Int -> PutScalingPolicyResponse
PutScalingPolicyResponse'
{ $sel:policyARN:PutScalingPolicyResponse' :: Maybe Text
policyARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alarms:PutScalingPolicyResponse' :: Maybe [Alarm]
alarms = Maybe [Alarm]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutScalingPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putScalingPolicyResponse_policyARN :: Lens.Lens' PutScalingPolicyResponse (Prelude.Maybe Prelude.Text)
putScalingPolicyResponse_policyARN :: (Maybe Text -> f (Maybe Text))
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse
putScalingPolicyResponse_policyARN = (PutScalingPolicyResponse -> Maybe Text)
-> (PutScalingPolicyResponse
-> Maybe Text -> PutScalingPolicyResponse)
-> Lens
PutScalingPolicyResponse
PutScalingPolicyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicyResponse' {Maybe Text
policyARN :: Maybe Text
$sel:policyARN:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Maybe Text
policyARN} -> Maybe Text
policyARN) (\s :: PutScalingPolicyResponse
s@PutScalingPolicyResponse' {} Maybe Text
a -> PutScalingPolicyResponse
s {$sel:policyARN:PutScalingPolicyResponse' :: Maybe Text
policyARN = Maybe Text
a} :: PutScalingPolicyResponse)
putScalingPolicyResponse_alarms :: Lens.Lens' PutScalingPolicyResponse (Prelude.Maybe [Alarm])
putScalingPolicyResponse_alarms :: (Maybe [Alarm] -> f (Maybe [Alarm]))
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse
putScalingPolicyResponse_alarms = (PutScalingPolicyResponse -> Maybe [Alarm])
-> (PutScalingPolicyResponse
-> Maybe [Alarm] -> PutScalingPolicyResponse)
-> Lens
PutScalingPolicyResponse
PutScalingPolicyResponse
(Maybe [Alarm])
(Maybe [Alarm])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicyResponse' {Maybe [Alarm]
alarms :: Maybe [Alarm]
$sel:alarms:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Maybe [Alarm]
alarms} -> Maybe [Alarm]
alarms) (\s :: PutScalingPolicyResponse
s@PutScalingPolicyResponse' {} Maybe [Alarm]
a -> PutScalingPolicyResponse
s {$sel:alarms:PutScalingPolicyResponse' :: Maybe [Alarm]
alarms = Maybe [Alarm]
a} :: PutScalingPolicyResponse) ((Maybe [Alarm] -> f (Maybe [Alarm]))
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse)
-> ((Maybe [Alarm] -> f (Maybe [Alarm]))
-> Maybe [Alarm] -> f (Maybe [Alarm]))
-> (Maybe [Alarm] -> f (Maybe [Alarm]))
-> PutScalingPolicyResponse
-> f PutScalingPolicyResponse
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
putScalingPolicyResponse_httpStatus :: Lens.Lens' PutScalingPolicyResponse Prelude.Int
putScalingPolicyResponse_httpStatus :: (Int -> f Int)
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse
putScalingPolicyResponse_httpStatus = (PutScalingPolicyResponse -> Int)
-> (PutScalingPolicyResponse -> Int -> PutScalingPolicyResponse)
-> Lens PutScalingPolicyResponse PutScalingPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutScalingPolicyResponse
s@PutScalingPolicyResponse' {} Int
a -> PutScalingPolicyResponse
s {$sel:httpStatus:PutScalingPolicyResponse' :: Int
httpStatus = Int
a} :: PutScalingPolicyResponse)
instance Prelude.NFData PutScalingPolicyResponse