{-# 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.OpsWorks.Types.LoadBasedAutoScalingConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types.AutoScalingThresholds
import qualified Amazonka.Prelude as Prelude
data LoadBasedAutoScalingConfiguration = LoadBasedAutoScalingConfiguration'
{
LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds
upScaling :: Prelude.Maybe AutoScalingThresholds,
LoadBasedAutoScalingConfiguration -> Maybe Bool
enable :: Prelude.Maybe Prelude.Bool,
LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds
downScaling :: Prelude.Maybe AutoScalingThresholds,
LoadBasedAutoScalingConfiguration -> Maybe Text
layerId :: Prelude.Maybe Prelude.Text
}
deriving (LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool
(LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool)
-> (LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool)
-> Eq LoadBasedAutoScalingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool
$c/= :: LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool
== :: LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool
$c== :: LoadBasedAutoScalingConfiguration
-> LoadBasedAutoScalingConfiguration -> Bool
Prelude.Eq, ReadPrec [LoadBasedAutoScalingConfiguration]
ReadPrec LoadBasedAutoScalingConfiguration
Int -> ReadS LoadBasedAutoScalingConfiguration
ReadS [LoadBasedAutoScalingConfiguration]
(Int -> ReadS LoadBasedAutoScalingConfiguration)
-> ReadS [LoadBasedAutoScalingConfiguration]
-> ReadPrec LoadBasedAutoScalingConfiguration
-> ReadPrec [LoadBasedAutoScalingConfiguration]
-> Read LoadBasedAutoScalingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoadBasedAutoScalingConfiguration]
$creadListPrec :: ReadPrec [LoadBasedAutoScalingConfiguration]
readPrec :: ReadPrec LoadBasedAutoScalingConfiguration
$creadPrec :: ReadPrec LoadBasedAutoScalingConfiguration
readList :: ReadS [LoadBasedAutoScalingConfiguration]
$creadList :: ReadS [LoadBasedAutoScalingConfiguration]
readsPrec :: Int -> ReadS LoadBasedAutoScalingConfiguration
$creadsPrec :: Int -> ReadS LoadBasedAutoScalingConfiguration
Prelude.Read, Int -> LoadBasedAutoScalingConfiguration -> ShowS
[LoadBasedAutoScalingConfiguration] -> ShowS
LoadBasedAutoScalingConfiguration -> String
(Int -> LoadBasedAutoScalingConfiguration -> ShowS)
-> (LoadBasedAutoScalingConfiguration -> String)
-> ([LoadBasedAutoScalingConfiguration] -> ShowS)
-> Show LoadBasedAutoScalingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoadBasedAutoScalingConfiguration] -> ShowS
$cshowList :: [LoadBasedAutoScalingConfiguration] -> ShowS
show :: LoadBasedAutoScalingConfiguration -> String
$cshow :: LoadBasedAutoScalingConfiguration -> String
showsPrec :: Int -> LoadBasedAutoScalingConfiguration -> ShowS
$cshowsPrec :: Int -> LoadBasedAutoScalingConfiguration -> ShowS
Prelude.Show, (forall x.
LoadBasedAutoScalingConfiguration
-> Rep LoadBasedAutoScalingConfiguration x)
-> (forall x.
Rep LoadBasedAutoScalingConfiguration x
-> LoadBasedAutoScalingConfiguration)
-> Generic LoadBasedAutoScalingConfiguration
forall x.
Rep LoadBasedAutoScalingConfiguration x
-> LoadBasedAutoScalingConfiguration
forall x.
LoadBasedAutoScalingConfiguration
-> Rep LoadBasedAutoScalingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LoadBasedAutoScalingConfiguration x
-> LoadBasedAutoScalingConfiguration
$cfrom :: forall x.
LoadBasedAutoScalingConfiguration
-> Rep LoadBasedAutoScalingConfiguration x
Prelude.Generic)
newLoadBasedAutoScalingConfiguration ::
LoadBasedAutoScalingConfiguration
newLoadBasedAutoScalingConfiguration :: LoadBasedAutoScalingConfiguration
newLoadBasedAutoScalingConfiguration =
LoadBasedAutoScalingConfiguration' :: Maybe AutoScalingThresholds
-> Maybe Bool
-> Maybe AutoScalingThresholds
-> Maybe Text
-> LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration'
{ $sel:upScaling:LoadBasedAutoScalingConfiguration' :: Maybe AutoScalingThresholds
upScaling =
Maybe AutoScalingThresholds
forall a. Maybe a
Prelude.Nothing,
$sel:enable:LoadBasedAutoScalingConfiguration' :: Maybe Bool
enable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:downScaling:LoadBasedAutoScalingConfiguration' :: Maybe AutoScalingThresholds
downScaling = Maybe AutoScalingThresholds
forall a. Maybe a
Prelude.Nothing,
$sel:layerId:LoadBasedAutoScalingConfiguration' :: Maybe Text
layerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
loadBasedAutoScalingConfiguration_upScaling :: Lens.Lens' LoadBasedAutoScalingConfiguration (Prelude.Maybe AutoScalingThresholds)
loadBasedAutoScalingConfiguration_upScaling :: (Maybe AutoScalingThresholds -> f (Maybe AutoScalingThresholds))
-> LoadBasedAutoScalingConfiguration
-> f LoadBasedAutoScalingConfiguration
loadBasedAutoScalingConfiguration_upScaling = (LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds)
-> (LoadBasedAutoScalingConfiguration
-> Maybe AutoScalingThresholds
-> LoadBasedAutoScalingConfiguration)
-> Lens
LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration
(Maybe AutoScalingThresholds)
(Maybe AutoScalingThresholds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBasedAutoScalingConfiguration' {Maybe AutoScalingThresholds
upScaling :: Maybe AutoScalingThresholds
$sel:upScaling:LoadBasedAutoScalingConfiguration' :: LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds
upScaling} -> Maybe AutoScalingThresholds
upScaling) (\s :: LoadBasedAutoScalingConfiguration
s@LoadBasedAutoScalingConfiguration' {} Maybe AutoScalingThresholds
a -> LoadBasedAutoScalingConfiguration
s {$sel:upScaling:LoadBasedAutoScalingConfiguration' :: Maybe AutoScalingThresholds
upScaling = Maybe AutoScalingThresholds
a} :: LoadBasedAutoScalingConfiguration)
loadBasedAutoScalingConfiguration_enable :: Lens.Lens' LoadBasedAutoScalingConfiguration (Prelude.Maybe Prelude.Bool)
loadBasedAutoScalingConfiguration_enable :: (Maybe Bool -> f (Maybe Bool))
-> LoadBasedAutoScalingConfiguration
-> f LoadBasedAutoScalingConfiguration
loadBasedAutoScalingConfiguration_enable = (LoadBasedAutoScalingConfiguration -> Maybe Bool)
-> (LoadBasedAutoScalingConfiguration
-> Maybe Bool -> LoadBasedAutoScalingConfiguration)
-> Lens
LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBasedAutoScalingConfiguration' {Maybe Bool
enable :: Maybe Bool
$sel:enable:LoadBasedAutoScalingConfiguration' :: LoadBasedAutoScalingConfiguration -> Maybe Bool
enable} -> Maybe Bool
enable) (\s :: LoadBasedAutoScalingConfiguration
s@LoadBasedAutoScalingConfiguration' {} Maybe Bool
a -> LoadBasedAutoScalingConfiguration
s {$sel:enable:LoadBasedAutoScalingConfiguration' :: Maybe Bool
enable = Maybe Bool
a} :: LoadBasedAutoScalingConfiguration)
loadBasedAutoScalingConfiguration_downScaling :: Lens.Lens' LoadBasedAutoScalingConfiguration (Prelude.Maybe AutoScalingThresholds)
loadBasedAutoScalingConfiguration_downScaling :: (Maybe AutoScalingThresholds -> f (Maybe AutoScalingThresholds))
-> LoadBasedAutoScalingConfiguration
-> f LoadBasedAutoScalingConfiguration
loadBasedAutoScalingConfiguration_downScaling = (LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds)
-> (LoadBasedAutoScalingConfiguration
-> Maybe AutoScalingThresholds
-> LoadBasedAutoScalingConfiguration)
-> Lens
LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration
(Maybe AutoScalingThresholds)
(Maybe AutoScalingThresholds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBasedAutoScalingConfiguration' {Maybe AutoScalingThresholds
downScaling :: Maybe AutoScalingThresholds
$sel:downScaling:LoadBasedAutoScalingConfiguration' :: LoadBasedAutoScalingConfiguration -> Maybe AutoScalingThresholds
downScaling} -> Maybe AutoScalingThresholds
downScaling) (\s :: LoadBasedAutoScalingConfiguration
s@LoadBasedAutoScalingConfiguration' {} Maybe AutoScalingThresholds
a -> LoadBasedAutoScalingConfiguration
s {$sel:downScaling:LoadBasedAutoScalingConfiguration' :: Maybe AutoScalingThresholds
downScaling = Maybe AutoScalingThresholds
a} :: LoadBasedAutoScalingConfiguration)
loadBasedAutoScalingConfiguration_layerId :: Lens.Lens' LoadBasedAutoScalingConfiguration (Prelude.Maybe Prelude.Text)
loadBasedAutoScalingConfiguration_layerId :: (Maybe Text -> f (Maybe Text))
-> LoadBasedAutoScalingConfiguration
-> f LoadBasedAutoScalingConfiguration
loadBasedAutoScalingConfiguration_layerId = (LoadBasedAutoScalingConfiguration -> Maybe Text)
-> (LoadBasedAutoScalingConfiguration
-> Maybe Text -> LoadBasedAutoScalingConfiguration)
-> Lens
LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoadBasedAutoScalingConfiguration' {Maybe Text
layerId :: Maybe Text
$sel:layerId:LoadBasedAutoScalingConfiguration' :: LoadBasedAutoScalingConfiguration -> Maybe Text
layerId} -> Maybe Text
layerId) (\s :: LoadBasedAutoScalingConfiguration
s@LoadBasedAutoScalingConfiguration' {} Maybe Text
a -> LoadBasedAutoScalingConfiguration
s {$sel:layerId:LoadBasedAutoScalingConfiguration' :: Maybe Text
layerId = Maybe Text
a} :: LoadBasedAutoScalingConfiguration)
instance
Core.FromJSON
LoadBasedAutoScalingConfiguration
where
parseJSON :: Value -> Parser LoadBasedAutoScalingConfiguration
parseJSON =
String
-> (Object -> Parser LoadBasedAutoScalingConfiguration)
-> Value
-> Parser LoadBasedAutoScalingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LoadBasedAutoScalingConfiguration"
( \Object
x ->
Maybe AutoScalingThresholds
-> Maybe Bool
-> Maybe AutoScalingThresholds
-> Maybe Text
-> LoadBasedAutoScalingConfiguration
LoadBasedAutoScalingConfiguration'
(Maybe AutoScalingThresholds
-> Maybe Bool
-> Maybe AutoScalingThresholds
-> Maybe Text
-> LoadBasedAutoScalingConfiguration)
-> Parser (Maybe AutoScalingThresholds)
-> Parser
(Maybe Bool
-> Maybe AutoScalingThresholds
-> Maybe Text
-> LoadBasedAutoScalingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AutoScalingThresholds)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpScaling")
Parser
(Maybe Bool
-> Maybe AutoScalingThresholds
-> Maybe Text
-> LoadBasedAutoScalingConfiguration)
-> Parser (Maybe Bool)
-> Parser
(Maybe AutoScalingThresholds
-> Maybe Text -> LoadBasedAutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enable")
Parser
(Maybe AutoScalingThresholds
-> Maybe Text -> LoadBasedAutoScalingConfiguration)
-> Parser (Maybe AutoScalingThresholds)
-> Parser (Maybe Text -> LoadBasedAutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoScalingThresholds)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DownScaling")
Parser (Maybe Text -> LoadBasedAutoScalingConfiguration)
-> Parser (Maybe Text) -> Parser LoadBasedAutoScalingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LayerId")
)
instance
Prelude.Hashable
LoadBasedAutoScalingConfiguration
instance
Prelude.NFData
LoadBasedAutoScalingConfiguration