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