{-# 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.AutoScaling.Types.WarmPoolConfiguration where
import Amazonka.AutoScaling.Types.InstanceReusePolicy
import Amazonka.AutoScaling.Types.WarmPoolState
import Amazonka.AutoScaling.Types.WarmPoolStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data WarmPoolConfiguration = WarmPoolConfiguration'
{
WarmPoolConfiguration -> Maybe InstanceReusePolicy
instanceReusePolicy :: Prelude.Maybe InstanceReusePolicy,
WarmPoolConfiguration -> Maybe Int
maxGroupPreparedCapacity :: Prelude.Maybe Prelude.Int,
WarmPoolConfiguration -> Maybe Natural
minSize :: Prelude.Maybe Prelude.Natural,
WarmPoolConfiguration -> Maybe WarmPoolState
poolState :: Prelude.Maybe WarmPoolState,
WarmPoolConfiguration -> Maybe WarmPoolStatus
status :: Prelude.Maybe WarmPoolStatus
}
deriving (WarmPoolConfiguration -> WarmPoolConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WarmPoolConfiguration -> WarmPoolConfiguration -> Bool
$c/= :: WarmPoolConfiguration -> WarmPoolConfiguration -> Bool
== :: WarmPoolConfiguration -> WarmPoolConfiguration -> Bool
$c== :: WarmPoolConfiguration -> WarmPoolConfiguration -> Bool
Prelude.Eq, ReadPrec [WarmPoolConfiguration]
ReadPrec WarmPoolConfiguration
Int -> ReadS WarmPoolConfiguration
ReadS [WarmPoolConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WarmPoolConfiguration]
$creadListPrec :: ReadPrec [WarmPoolConfiguration]
readPrec :: ReadPrec WarmPoolConfiguration
$creadPrec :: ReadPrec WarmPoolConfiguration
readList :: ReadS [WarmPoolConfiguration]
$creadList :: ReadS [WarmPoolConfiguration]
readsPrec :: Int -> ReadS WarmPoolConfiguration
$creadsPrec :: Int -> ReadS WarmPoolConfiguration
Prelude.Read, Int -> WarmPoolConfiguration -> ShowS
[WarmPoolConfiguration] -> ShowS
WarmPoolConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WarmPoolConfiguration] -> ShowS
$cshowList :: [WarmPoolConfiguration] -> ShowS
show :: WarmPoolConfiguration -> String
$cshow :: WarmPoolConfiguration -> String
showsPrec :: Int -> WarmPoolConfiguration -> ShowS
$cshowsPrec :: Int -> WarmPoolConfiguration -> ShowS
Prelude.Show, forall x. Rep WarmPoolConfiguration x -> WarmPoolConfiguration
forall x. WarmPoolConfiguration -> Rep WarmPoolConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WarmPoolConfiguration x -> WarmPoolConfiguration
$cfrom :: forall x. WarmPoolConfiguration -> Rep WarmPoolConfiguration x
Prelude.Generic)
newWarmPoolConfiguration ::
WarmPoolConfiguration
newWarmPoolConfiguration :: WarmPoolConfiguration
newWarmPoolConfiguration =
WarmPoolConfiguration'
{ $sel:instanceReusePolicy:WarmPoolConfiguration' :: Maybe InstanceReusePolicy
instanceReusePolicy =
forall a. Maybe a
Prelude.Nothing,
$sel:maxGroupPreparedCapacity:WarmPoolConfiguration' :: Maybe Int
maxGroupPreparedCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:minSize:WarmPoolConfiguration' :: Maybe Natural
minSize = forall a. Maybe a
Prelude.Nothing,
$sel:poolState:WarmPoolConfiguration' :: Maybe WarmPoolState
poolState = forall a. Maybe a
Prelude.Nothing,
$sel:status:WarmPoolConfiguration' :: Maybe WarmPoolStatus
status = forall a. Maybe a
Prelude.Nothing
}
warmPoolConfiguration_instanceReusePolicy :: Lens.Lens' WarmPoolConfiguration (Prelude.Maybe InstanceReusePolicy)
warmPoolConfiguration_instanceReusePolicy :: Lens' WarmPoolConfiguration (Maybe InstanceReusePolicy)
warmPoolConfiguration_instanceReusePolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WarmPoolConfiguration' {Maybe InstanceReusePolicy
instanceReusePolicy :: Maybe InstanceReusePolicy
$sel:instanceReusePolicy:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe InstanceReusePolicy
instanceReusePolicy} -> Maybe InstanceReusePolicy
instanceReusePolicy) (\s :: WarmPoolConfiguration
s@WarmPoolConfiguration' {} Maybe InstanceReusePolicy
a -> WarmPoolConfiguration
s {$sel:instanceReusePolicy:WarmPoolConfiguration' :: Maybe InstanceReusePolicy
instanceReusePolicy = Maybe InstanceReusePolicy
a} :: WarmPoolConfiguration)
warmPoolConfiguration_maxGroupPreparedCapacity :: Lens.Lens' WarmPoolConfiguration (Prelude.Maybe Prelude.Int)
warmPoolConfiguration_maxGroupPreparedCapacity :: Lens' WarmPoolConfiguration (Maybe Int)
warmPoolConfiguration_maxGroupPreparedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WarmPoolConfiguration' {Maybe Int
maxGroupPreparedCapacity :: Maybe Int
$sel:maxGroupPreparedCapacity:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Int
maxGroupPreparedCapacity} -> Maybe Int
maxGroupPreparedCapacity) (\s :: WarmPoolConfiguration
s@WarmPoolConfiguration' {} Maybe Int
a -> WarmPoolConfiguration
s {$sel:maxGroupPreparedCapacity:WarmPoolConfiguration' :: Maybe Int
maxGroupPreparedCapacity = Maybe Int
a} :: WarmPoolConfiguration)
warmPoolConfiguration_minSize :: Lens.Lens' WarmPoolConfiguration (Prelude.Maybe Prelude.Natural)
warmPoolConfiguration_minSize :: Lens' WarmPoolConfiguration (Maybe Natural)
warmPoolConfiguration_minSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WarmPoolConfiguration' {Maybe Natural
minSize :: Maybe Natural
$sel:minSize:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Natural
minSize} -> Maybe Natural
minSize) (\s :: WarmPoolConfiguration
s@WarmPoolConfiguration' {} Maybe Natural
a -> WarmPoolConfiguration
s {$sel:minSize:WarmPoolConfiguration' :: Maybe Natural
minSize = Maybe Natural
a} :: WarmPoolConfiguration)
warmPoolConfiguration_poolState :: Lens.Lens' WarmPoolConfiguration (Prelude.Maybe WarmPoolState)
warmPoolConfiguration_poolState :: Lens' WarmPoolConfiguration (Maybe WarmPoolState)
warmPoolConfiguration_poolState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WarmPoolConfiguration' {Maybe WarmPoolState
poolState :: Maybe WarmPoolState
$sel:poolState:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolState
poolState} -> Maybe WarmPoolState
poolState) (\s :: WarmPoolConfiguration
s@WarmPoolConfiguration' {} Maybe WarmPoolState
a -> WarmPoolConfiguration
s {$sel:poolState:WarmPoolConfiguration' :: Maybe WarmPoolState
poolState = Maybe WarmPoolState
a} :: WarmPoolConfiguration)
warmPoolConfiguration_status :: Lens.Lens' WarmPoolConfiguration (Prelude.Maybe WarmPoolStatus)
warmPoolConfiguration_status :: Lens' WarmPoolConfiguration (Maybe WarmPoolStatus)
warmPoolConfiguration_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WarmPoolConfiguration' {Maybe WarmPoolStatus
status :: Maybe WarmPoolStatus
$sel:status:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolStatus
status} -> Maybe WarmPoolStatus
status) (\s :: WarmPoolConfiguration
s@WarmPoolConfiguration' {} Maybe WarmPoolStatus
a -> WarmPoolConfiguration
s {$sel:status:WarmPoolConfiguration' :: Maybe WarmPoolStatus
status = Maybe WarmPoolStatus
a} :: WarmPoolConfiguration)
instance Data.FromXML WarmPoolConfiguration where
parseXML :: [Node] -> Either String WarmPoolConfiguration
parseXML [Node]
x =
Maybe InstanceReusePolicy
-> Maybe Int
-> Maybe Natural
-> Maybe WarmPoolState
-> Maybe WarmPoolStatus
-> WarmPoolConfiguration
WarmPoolConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"InstanceReusePolicy")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MaxGroupPreparedCapacity")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MinSize")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PoolState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Status")
instance Prelude.Hashable WarmPoolConfiguration where
hashWithSalt :: Int -> WarmPoolConfiguration -> Int
hashWithSalt Int
_salt WarmPoolConfiguration' {Maybe Int
Maybe Natural
Maybe InstanceReusePolicy
Maybe WarmPoolState
Maybe WarmPoolStatus
status :: Maybe WarmPoolStatus
poolState :: Maybe WarmPoolState
minSize :: Maybe Natural
maxGroupPreparedCapacity :: Maybe Int
instanceReusePolicy :: Maybe InstanceReusePolicy
$sel:status:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolStatus
$sel:poolState:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolState
$sel:minSize:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Natural
$sel:maxGroupPreparedCapacity:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Int
$sel:instanceReusePolicy:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe InstanceReusePolicy
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceReusePolicy
instanceReusePolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxGroupPreparedCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WarmPoolState
poolState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WarmPoolStatus
status
instance Prelude.NFData WarmPoolConfiguration where
rnf :: WarmPoolConfiguration -> ()
rnf WarmPoolConfiguration' {Maybe Int
Maybe Natural
Maybe InstanceReusePolicy
Maybe WarmPoolState
Maybe WarmPoolStatus
status :: Maybe WarmPoolStatus
poolState :: Maybe WarmPoolState
minSize :: Maybe Natural
maxGroupPreparedCapacity :: Maybe Int
instanceReusePolicy :: Maybe InstanceReusePolicy
$sel:status:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolStatus
$sel:poolState:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe WarmPoolState
$sel:minSize:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Natural
$sel:maxGroupPreparedCapacity:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe Int
$sel:instanceReusePolicy:WarmPoolConfiguration' :: WarmPoolConfiguration -> Maybe InstanceReusePolicy
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceReusePolicy
instanceReusePolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxGroupPreparedCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WarmPoolState
poolState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WarmPoolStatus
status