{-# 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.ECS.Types.ManagedScaling where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.ManagedScalingStatus
import qualified Amazonka.Prelude as Prelude
data ManagedScaling = ManagedScaling'
{
ManagedScaling -> Maybe Natural
instanceWarmupPeriod :: Prelude.Maybe Prelude.Natural,
ManagedScaling -> Maybe Natural
maximumScalingStepSize :: Prelude.Maybe Prelude.Natural,
ManagedScaling -> Maybe Natural
minimumScalingStepSize :: Prelude.Maybe Prelude.Natural,
ManagedScaling -> Maybe ManagedScalingStatus
status :: Prelude.Maybe ManagedScalingStatus,
ManagedScaling -> Maybe Natural
targetCapacity :: Prelude.Maybe Prelude.Natural
}
deriving (ManagedScaling -> ManagedScaling -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedScaling -> ManagedScaling -> Bool
$c/= :: ManagedScaling -> ManagedScaling -> Bool
== :: ManagedScaling -> ManagedScaling -> Bool
$c== :: ManagedScaling -> ManagedScaling -> Bool
Prelude.Eq, ReadPrec [ManagedScaling]
ReadPrec ManagedScaling
Int -> ReadS ManagedScaling
ReadS [ManagedScaling]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedScaling]
$creadListPrec :: ReadPrec [ManagedScaling]
readPrec :: ReadPrec ManagedScaling
$creadPrec :: ReadPrec ManagedScaling
readList :: ReadS [ManagedScaling]
$creadList :: ReadS [ManagedScaling]
readsPrec :: Int -> ReadS ManagedScaling
$creadsPrec :: Int -> ReadS ManagedScaling
Prelude.Read, Int -> ManagedScaling -> ShowS
[ManagedScaling] -> ShowS
ManagedScaling -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedScaling] -> ShowS
$cshowList :: [ManagedScaling] -> ShowS
show :: ManagedScaling -> String
$cshow :: ManagedScaling -> String
showsPrec :: Int -> ManagedScaling -> ShowS
$cshowsPrec :: Int -> ManagedScaling -> ShowS
Prelude.Show, forall x. Rep ManagedScaling x -> ManagedScaling
forall x. ManagedScaling -> Rep ManagedScaling x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedScaling x -> ManagedScaling
$cfrom :: forall x. ManagedScaling -> Rep ManagedScaling x
Prelude.Generic)
newManagedScaling ::
ManagedScaling
newManagedScaling :: ManagedScaling
newManagedScaling =
ManagedScaling'
{ $sel:instanceWarmupPeriod:ManagedScaling' :: Maybe Natural
instanceWarmupPeriod =
forall a. Maybe a
Prelude.Nothing,
$sel:maximumScalingStepSize:ManagedScaling' :: Maybe Natural
maximumScalingStepSize = forall a. Maybe a
Prelude.Nothing,
$sel:minimumScalingStepSize:ManagedScaling' :: Maybe Natural
minimumScalingStepSize = forall a. Maybe a
Prelude.Nothing,
$sel:status:ManagedScaling' :: Maybe ManagedScalingStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:targetCapacity:ManagedScaling' :: Maybe Natural
targetCapacity = forall a. Maybe a
Prelude.Nothing
}
managedScaling_instanceWarmupPeriod :: Lens.Lens' ManagedScaling (Prelude.Maybe Prelude.Natural)
managedScaling_instanceWarmupPeriod :: Lens' ManagedScaling (Maybe Natural)
managedScaling_instanceWarmupPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScaling' {Maybe Natural
instanceWarmupPeriod :: Maybe Natural
$sel:instanceWarmupPeriod:ManagedScaling' :: ManagedScaling -> Maybe Natural
instanceWarmupPeriod} -> Maybe Natural
instanceWarmupPeriod) (\s :: ManagedScaling
s@ManagedScaling' {} Maybe Natural
a -> ManagedScaling
s {$sel:instanceWarmupPeriod:ManagedScaling' :: Maybe Natural
instanceWarmupPeriod = Maybe Natural
a} :: ManagedScaling)
managedScaling_maximumScalingStepSize :: Lens.Lens' ManagedScaling (Prelude.Maybe Prelude.Natural)
managedScaling_maximumScalingStepSize :: Lens' ManagedScaling (Maybe Natural)
managedScaling_maximumScalingStepSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScaling' {Maybe Natural
maximumScalingStepSize :: Maybe Natural
$sel:maximumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
maximumScalingStepSize} -> Maybe Natural
maximumScalingStepSize) (\s :: ManagedScaling
s@ManagedScaling' {} Maybe Natural
a -> ManagedScaling
s {$sel:maximumScalingStepSize:ManagedScaling' :: Maybe Natural
maximumScalingStepSize = Maybe Natural
a} :: ManagedScaling)
managedScaling_minimumScalingStepSize :: Lens.Lens' ManagedScaling (Prelude.Maybe Prelude.Natural)
managedScaling_minimumScalingStepSize :: Lens' ManagedScaling (Maybe Natural)
managedScaling_minimumScalingStepSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScaling' {Maybe Natural
minimumScalingStepSize :: Maybe Natural
$sel:minimumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
minimumScalingStepSize} -> Maybe Natural
minimumScalingStepSize) (\s :: ManagedScaling
s@ManagedScaling' {} Maybe Natural
a -> ManagedScaling
s {$sel:minimumScalingStepSize:ManagedScaling' :: Maybe Natural
minimumScalingStepSize = Maybe Natural
a} :: ManagedScaling)
managedScaling_status :: Lens.Lens' ManagedScaling (Prelude.Maybe ManagedScalingStatus)
managedScaling_status :: Lens' ManagedScaling (Maybe ManagedScalingStatus)
managedScaling_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScaling' {Maybe ManagedScalingStatus
status :: Maybe ManagedScalingStatus
$sel:status:ManagedScaling' :: ManagedScaling -> Maybe ManagedScalingStatus
status} -> Maybe ManagedScalingStatus
status) (\s :: ManagedScaling
s@ManagedScaling' {} Maybe ManagedScalingStatus
a -> ManagedScaling
s {$sel:status:ManagedScaling' :: Maybe ManagedScalingStatus
status = Maybe ManagedScalingStatus
a} :: ManagedScaling)
managedScaling_targetCapacity :: Lens.Lens' ManagedScaling (Prelude.Maybe Prelude.Natural)
managedScaling_targetCapacity :: Lens' ManagedScaling (Maybe Natural)
managedScaling_targetCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScaling' {Maybe Natural
targetCapacity :: Maybe Natural
$sel:targetCapacity:ManagedScaling' :: ManagedScaling -> Maybe Natural
targetCapacity} -> Maybe Natural
targetCapacity) (\s :: ManagedScaling
s@ManagedScaling' {} Maybe Natural
a -> ManagedScaling
s {$sel:targetCapacity:ManagedScaling' :: Maybe Natural
targetCapacity = Maybe Natural
a} :: ManagedScaling)
instance Data.FromJSON ManagedScaling where
parseJSON :: Value -> Parser ManagedScaling
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ManagedScaling"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe ManagedScalingStatus
-> Maybe Natural
-> ManagedScaling
ManagedScaling'
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
"instanceWarmupPeriod")
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
"maximumScalingStepSize")
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
"minimumScalingStepSize")
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
"status")
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
"targetCapacity")
)
instance Prelude.Hashable ManagedScaling where
hashWithSalt :: Int -> ManagedScaling -> Int
hashWithSalt Int
_salt ManagedScaling' {Maybe Natural
Maybe ManagedScalingStatus
targetCapacity :: Maybe Natural
status :: Maybe ManagedScalingStatus
minimumScalingStepSize :: Maybe Natural
maximumScalingStepSize :: Maybe Natural
instanceWarmupPeriod :: Maybe Natural
$sel:targetCapacity:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:status:ManagedScaling' :: ManagedScaling -> Maybe ManagedScalingStatus
$sel:minimumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:maximumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:instanceWarmupPeriod:ManagedScaling' :: ManagedScaling -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
instanceWarmupPeriod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumScalingStepSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minimumScalingStepSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ManagedScalingStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
targetCapacity
instance Prelude.NFData ManagedScaling where
rnf :: ManagedScaling -> ()
rnf ManagedScaling' {Maybe Natural
Maybe ManagedScalingStatus
targetCapacity :: Maybe Natural
status :: Maybe ManagedScalingStatus
minimumScalingStepSize :: Maybe Natural
maximumScalingStepSize :: Maybe Natural
instanceWarmupPeriod :: Maybe Natural
$sel:targetCapacity:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:status:ManagedScaling' :: ManagedScaling -> Maybe ManagedScalingStatus
$sel:minimumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:maximumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:instanceWarmupPeriod:ManagedScaling' :: ManagedScaling -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
instanceWarmupPeriod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximumScalingStepSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minimumScalingStepSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ManagedScalingStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
targetCapacity
instance Data.ToJSON ManagedScaling where
toJSON :: ManagedScaling -> Value
toJSON ManagedScaling' {Maybe Natural
Maybe ManagedScalingStatus
targetCapacity :: Maybe Natural
status :: Maybe ManagedScalingStatus
minimumScalingStepSize :: Maybe Natural
maximumScalingStepSize :: Maybe Natural
instanceWarmupPeriod :: Maybe Natural
$sel:targetCapacity:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:status:ManagedScaling' :: ManagedScaling -> Maybe ManagedScalingStatus
$sel:minimumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:maximumScalingStepSize:ManagedScaling' :: ManagedScaling -> Maybe Natural
$sel:instanceWarmupPeriod:ManagedScaling' :: ManagedScaling -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"instanceWarmupPeriod" 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
instanceWarmupPeriod,
(Key
"maximumScalingStepSize" 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
maximumScalingStepSize,
(Key
"minimumScalingStepSize" 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
minimumScalingStepSize,
(Key
"status" 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 ManagedScalingStatus
status,
(Key
"targetCapacity" 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
targetCapacity
]
)