{-# 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.DynamoDB.Types.AutoScalingPolicyUpdate where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoScalingPolicyUpdate = AutoScalingPolicyUpdate'
{
AutoScalingPolicyUpdate -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text,
AutoScalingPolicyUpdate
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
}
deriving (AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool
(AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool)
-> (AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool)
-> Eq AutoScalingPolicyUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool
$c/= :: AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool
== :: AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool
$c== :: AutoScalingPolicyUpdate -> AutoScalingPolicyUpdate -> Bool
Prelude.Eq, ReadPrec [AutoScalingPolicyUpdate]
ReadPrec AutoScalingPolicyUpdate
Int -> ReadS AutoScalingPolicyUpdate
ReadS [AutoScalingPolicyUpdate]
(Int -> ReadS AutoScalingPolicyUpdate)
-> ReadS [AutoScalingPolicyUpdate]
-> ReadPrec AutoScalingPolicyUpdate
-> ReadPrec [AutoScalingPolicyUpdate]
-> Read AutoScalingPolicyUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingPolicyUpdate]
$creadListPrec :: ReadPrec [AutoScalingPolicyUpdate]
readPrec :: ReadPrec AutoScalingPolicyUpdate
$creadPrec :: ReadPrec AutoScalingPolicyUpdate
readList :: ReadS [AutoScalingPolicyUpdate]
$creadList :: ReadS [AutoScalingPolicyUpdate]
readsPrec :: Int -> ReadS AutoScalingPolicyUpdate
$creadsPrec :: Int -> ReadS AutoScalingPolicyUpdate
Prelude.Read, Int -> AutoScalingPolicyUpdate -> ShowS
[AutoScalingPolicyUpdate] -> ShowS
AutoScalingPolicyUpdate -> String
(Int -> AutoScalingPolicyUpdate -> ShowS)
-> (AutoScalingPolicyUpdate -> String)
-> ([AutoScalingPolicyUpdate] -> ShowS)
-> Show AutoScalingPolicyUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingPolicyUpdate] -> ShowS
$cshowList :: [AutoScalingPolicyUpdate] -> ShowS
show :: AutoScalingPolicyUpdate -> String
$cshow :: AutoScalingPolicyUpdate -> String
showsPrec :: Int -> AutoScalingPolicyUpdate -> ShowS
$cshowsPrec :: Int -> AutoScalingPolicyUpdate -> ShowS
Prelude.Show, (forall x.
AutoScalingPolicyUpdate -> Rep AutoScalingPolicyUpdate x)
-> (forall x.
Rep AutoScalingPolicyUpdate x -> AutoScalingPolicyUpdate)
-> Generic AutoScalingPolicyUpdate
forall x. Rep AutoScalingPolicyUpdate x -> AutoScalingPolicyUpdate
forall x. AutoScalingPolicyUpdate -> Rep AutoScalingPolicyUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoScalingPolicyUpdate x -> AutoScalingPolicyUpdate
$cfrom :: forall x. AutoScalingPolicyUpdate -> Rep AutoScalingPolicyUpdate x
Prelude.Generic)
newAutoScalingPolicyUpdate ::
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate ->
AutoScalingPolicyUpdate
newAutoScalingPolicyUpdate :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
-> AutoScalingPolicyUpdate
newAutoScalingPolicyUpdate
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
pTargetTrackingScalingPolicyConfiguration_ =
AutoScalingPolicyUpdate' :: Maybe Text
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
-> AutoScalingPolicyUpdate
AutoScalingPolicyUpdate'
{ $sel:policyName:AutoScalingPolicyUpdate' :: Maybe Text
policyName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetTrackingScalingPolicyConfiguration:AutoScalingPolicyUpdate' :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration =
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
pTargetTrackingScalingPolicyConfiguration_
}
autoScalingPolicyUpdate_policyName :: Lens.Lens' AutoScalingPolicyUpdate (Prelude.Maybe Prelude.Text)
autoScalingPolicyUpdate_policyName :: (Maybe Text -> f (Maybe Text))
-> AutoScalingPolicyUpdate -> f AutoScalingPolicyUpdate
autoScalingPolicyUpdate_policyName = (AutoScalingPolicyUpdate -> Maybe Text)
-> (AutoScalingPolicyUpdate
-> Maybe Text -> AutoScalingPolicyUpdate)
-> Lens
AutoScalingPolicyUpdate
AutoScalingPolicyUpdate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingPolicyUpdate' {Maybe Text
policyName :: Maybe Text
$sel:policyName:AutoScalingPolicyUpdate' :: AutoScalingPolicyUpdate -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: AutoScalingPolicyUpdate
s@AutoScalingPolicyUpdate' {} Maybe Text
a -> AutoScalingPolicyUpdate
s {$sel:policyName:AutoScalingPolicyUpdate' :: Maybe Text
policyName = Maybe Text
a} :: AutoScalingPolicyUpdate)
autoScalingPolicyUpdate_targetTrackingScalingPolicyConfiguration :: Lens.Lens' AutoScalingPolicyUpdate AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
autoScalingPolicyUpdate_targetTrackingScalingPolicyConfiguration :: (AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
-> f AutoScalingTargetTrackingScalingPolicyConfigurationUpdate)
-> AutoScalingPolicyUpdate -> f AutoScalingPolicyUpdate
autoScalingPolicyUpdate_targetTrackingScalingPolicyConfiguration = (AutoScalingPolicyUpdate
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate)
-> (AutoScalingPolicyUpdate
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
-> AutoScalingPolicyUpdate)
-> Lens
AutoScalingPolicyUpdate
AutoScalingPolicyUpdate
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingPolicyUpdate' {AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
$sel:targetTrackingScalingPolicyConfiguration:AutoScalingPolicyUpdate' :: AutoScalingPolicyUpdate
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration} -> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration) (\s :: AutoScalingPolicyUpdate
s@AutoScalingPolicyUpdate' {} AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
a -> AutoScalingPolicyUpdate
s {$sel:targetTrackingScalingPolicyConfiguration:AutoScalingPolicyUpdate' :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
a} :: AutoScalingPolicyUpdate)
instance Prelude.Hashable AutoScalingPolicyUpdate
instance Prelude.NFData AutoScalingPolicyUpdate
instance Core.ToJSON AutoScalingPolicyUpdate where
toJSON :: AutoScalingPolicyUpdate -> Value
toJSON AutoScalingPolicyUpdate' {Maybe Text
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration :: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
policyName :: Maybe Text
$sel:targetTrackingScalingPolicyConfiguration:AutoScalingPolicyUpdate' :: AutoScalingPolicyUpdate
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
$sel:policyName:AutoScalingPolicyUpdate' :: AutoScalingPolicyUpdate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PolicyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"TargetTrackingScalingPolicyConfiguration"
Text
-> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AutoScalingTargetTrackingScalingPolicyConfigurationUpdate
targetTrackingScalingPolicyConfiguration
)
]
)