{-# 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.KafkaConnect.Types.AutoScalingUpdate where
import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.ScaleInPolicyUpdate
import Amazonka.KafkaConnect.Types.ScaleOutPolicyUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoScalingUpdate = AutoScalingUpdate'
{
AutoScalingUpdate -> Natural
maxWorkerCount :: Prelude.Natural,
AutoScalingUpdate -> Natural
mcuCount :: Prelude.Natural,
AutoScalingUpdate -> Natural
minWorkerCount :: Prelude.Natural,
AutoScalingUpdate -> ScaleInPolicyUpdate
scaleInPolicy :: ScaleInPolicyUpdate,
AutoScalingUpdate -> ScaleOutPolicyUpdate
scaleOutPolicy :: ScaleOutPolicyUpdate
}
deriving (AutoScalingUpdate -> AutoScalingUpdate -> Bool
(AutoScalingUpdate -> AutoScalingUpdate -> Bool)
-> (AutoScalingUpdate -> AutoScalingUpdate -> Bool)
-> Eq AutoScalingUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingUpdate -> AutoScalingUpdate -> Bool
$c/= :: AutoScalingUpdate -> AutoScalingUpdate -> Bool
== :: AutoScalingUpdate -> AutoScalingUpdate -> Bool
$c== :: AutoScalingUpdate -> AutoScalingUpdate -> Bool
Prelude.Eq, ReadPrec [AutoScalingUpdate]
ReadPrec AutoScalingUpdate
Int -> ReadS AutoScalingUpdate
ReadS [AutoScalingUpdate]
(Int -> ReadS AutoScalingUpdate)
-> ReadS [AutoScalingUpdate]
-> ReadPrec AutoScalingUpdate
-> ReadPrec [AutoScalingUpdate]
-> Read AutoScalingUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingUpdate]
$creadListPrec :: ReadPrec [AutoScalingUpdate]
readPrec :: ReadPrec AutoScalingUpdate
$creadPrec :: ReadPrec AutoScalingUpdate
readList :: ReadS [AutoScalingUpdate]
$creadList :: ReadS [AutoScalingUpdate]
readsPrec :: Int -> ReadS AutoScalingUpdate
$creadsPrec :: Int -> ReadS AutoScalingUpdate
Prelude.Read, Int -> AutoScalingUpdate -> ShowS
[AutoScalingUpdate] -> ShowS
AutoScalingUpdate -> String
(Int -> AutoScalingUpdate -> ShowS)
-> (AutoScalingUpdate -> String)
-> ([AutoScalingUpdate] -> ShowS)
-> Show AutoScalingUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingUpdate] -> ShowS
$cshowList :: [AutoScalingUpdate] -> ShowS
show :: AutoScalingUpdate -> String
$cshow :: AutoScalingUpdate -> String
showsPrec :: Int -> AutoScalingUpdate -> ShowS
$cshowsPrec :: Int -> AutoScalingUpdate -> ShowS
Prelude.Show, (forall x. AutoScalingUpdate -> Rep AutoScalingUpdate x)
-> (forall x. Rep AutoScalingUpdate x -> AutoScalingUpdate)
-> Generic AutoScalingUpdate
forall x. Rep AutoScalingUpdate x -> AutoScalingUpdate
forall x. AutoScalingUpdate -> Rep AutoScalingUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoScalingUpdate x -> AutoScalingUpdate
$cfrom :: forall x. AutoScalingUpdate -> Rep AutoScalingUpdate x
Prelude.Generic)
newAutoScalingUpdate ::
Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
ScaleInPolicyUpdate ->
ScaleOutPolicyUpdate ->
AutoScalingUpdate
newAutoScalingUpdate :: Natural
-> Natural
-> Natural
-> ScaleInPolicyUpdate
-> ScaleOutPolicyUpdate
-> AutoScalingUpdate
newAutoScalingUpdate
Natural
pMaxWorkerCount_
Natural
pMcuCount_
Natural
pMinWorkerCount_
ScaleInPolicyUpdate
pScaleInPolicy_
ScaleOutPolicyUpdate
pScaleOutPolicy_ =
AutoScalingUpdate' :: Natural
-> Natural
-> Natural
-> ScaleInPolicyUpdate
-> ScaleOutPolicyUpdate
-> AutoScalingUpdate
AutoScalingUpdate'
{ $sel:maxWorkerCount:AutoScalingUpdate' :: Natural
maxWorkerCount =
Natural
pMaxWorkerCount_,
$sel:mcuCount:AutoScalingUpdate' :: Natural
mcuCount = Natural
pMcuCount_,
$sel:minWorkerCount:AutoScalingUpdate' :: Natural
minWorkerCount = Natural
pMinWorkerCount_,
$sel:scaleInPolicy:AutoScalingUpdate' :: ScaleInPolicyUpdate
scaleInPolicy = ScaleInPolicyUpdate
pScaleInPolicy_,
$sel:scaleOutPolicy:AutoScalingUpdate' :: ScaleOutPolicyUpdate
scaleOutPolicy = ScaleOutPolicyUpdate
pScaleOutPolicy_
}
autoScalingUpdate_maxWorkerCount :: Lens.Lens' AutoScalingUpdate Prelude.Natural
autoScalingUpdate_maxWorkerCount :: (Natural -> f Natural) -> AutoScalingUpdate -> f AutoScalingUpdate
autoScalingUpdate_maxWorkerCount = (AutoScalingUpdate -> Natural)
-> (AutoScalingUpdate -> Natural -> AutoScalingUpdate)
-> Lens AutoScalingUpdate AutoScalingUpdate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingUpdate' {Natural
maxWorkerCount :: Natural
$sel:maxWorkerCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
maxWorkerCount} -> Natural
maxWorkerCount) (\s :: AutoScalingUpdate
s@AutoScalingUpdate' {} Natural
a -> AutoScalingUpdate
s {$sel:maxWorkerCount:AutoScalingUpdate' :: Natural
maxWorkerCount = Natural
a} :: AutoScalingUpdate)
autoScalingUpdate_mcuCount :: Lens.Lens' AutoScalingUpdate Prelude.Natural
autoScalingUpdate_mcuCount :: (Natural -> f Natural) -> AutoScalingUpdate -> f AutoScalingUpdate
autoScalingUpdate_mcuCount = (AutoScalingUpdate -> Natural)
-> (AutoScalingUpdate -> Natural -> AutoScalingUpdate)
-> Lens AutoScalingUpdate AutoScalingUpdate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingUpdate' {Natural
mcuCount :: Natural
$sel:mcuCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
mcuCount} -> Natural
mcuCount) (\s :: AutoScalingUpdate
s@AutoScalingUpdate' {} Natural
a -> AutoScalingUpdate
s {$sel:mcuCount:AutoScalingUpdate' :: Natural
mcuCount = Natural
a} :: AutoScalingUpdate)
autoScalingUpdate_minWorkerCount :: Lens.Lens' AutoScalingUpdate Prelude.Natural
autoScalingUpdate_minWorkerCount :: (Natural -> f Natural) -> AutoScalingUpdate -> f AutoScalingUpdate
autoScalingUpdate_minWorkerCount = (AutoScalingUpdate -> Natural)
-> (AutoScalingUpdate -> Natural -> AutoScalingUpdate)
-> Lens AutoScalingUpdate AutoScalingUpdate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingUpdate' {Natural
minWorkerCount :: Natural
$sel:minWorkerCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
minWorkerCount} -> Natural
minWorkerCount) (\s :: AutoScalingUpdate
s@AutoScalingUpdate' {} Natural
a -> AutoScalingUpdate
s {$sel:minWorkerCount:AutoScalingUpdate' :: Natural
minWorkerCount = Natural
a} :: AutoScalingUpdate)
autoScalingUpdate_scaleInPolicy :: Lens.Lens' AutoScalingUpdate ScaleInPolicyUpdate
autoScalingUpdate_scaleInPolicy :: (ScaleInPolicyUpdate -> f ScaleInPolicyUpdate)
-> AutoScalingUpdate -> f AutoScalingUpdate
autoScalingUpdate_scaleInPolicy = (AutoScalingUpdate -> ScaleInPolicyUpdate)
-> (AutoScalingUpdate -> ScaleInPolicyUpdate -> AutoScalingUpdate)
-> Lens
AutoScalingUpdate
AutoScalingUpdate
ScaleInPolicyUpdate
ScaleInPolicyUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingUpdate' {ScaleInPolicyUpdate
scaleInPolicy :: ScaleInPolicyUpdate
$sel:scaleInPolicy:AutoScalingUpdate' :: AutoScalingUpdate -> ScaleInPolicyUpdate
scaleInPolicy} -> ScaleInPolicyUpdate
scaleInPolicy) (\s :: AutoScalingUpdate
s@AutoScalingUpdate' {} ScaleInPolicyUpdate
a -> AutoScalingUpdate
s {$sel:scaleInPolicy:AutoScalingUpdate' :: ScaleInPolicyUpdate
scaleInPolicy = ScaleInPolicyUpdate
a} :: AutoScalingUpdate)
autoScalingUpdate_scaleOutPolicy :: Lens.Lens' AutoScalingUpdate ScaleOutPolicyUpdate
autoScalingUpdate_scaleOutPolicy :: (ScaleOutPolicyUpdate -> f ScaleOutPolicyUpdate)
-> AutoScalingUpdate -> f AutoScalingUpdate
autoScalingUpdate_scaleOutPolicy = (AutoScalingUpdate -> ScaleOutPolicyUpdate)
-> (AutoScalingUpdate -> ScaleOutPolicyUpdate -> AutoScalingUpdate)
-> Lens
AutoScalingUpdate
AutoScalingUpdate
ScaleOutPolicyUpdate
ScaleOutPolicyUpdate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingUpdate' {ScaleOutPolicyUpdate
scaleOutPolicy :: ScaleOutPolicyUpdate
$sel:scaleOutPolicy:AutoScalingUpdate' :: AutoScalingUpdate -> ScaleOutPolicyUpdate
scaleOutPolicy} -> ScaleOutPolicyUpdate
scaleOutPolicy) (\s :: AutoScalingUpdate
s@AutoScalingUpdate' {} ScaleOutPolicyUpdate
a -> AutoScalingUpdate
s {$sel:scaleOutPolicy:AutoScalingUpdate' :: ScaleOutPolicyUpdate
scaleOutPolicy = ScaleOutPolicyUpdate
a} :: AutoScalingUpdate)
instance Prelude.Hashable AutoScalingUpdate
instance Prelude.NFData AutoScalingUpdate
instance Core.ToJSON AutoScalingUpdate where
toJSON :: AutoScalingUpdate -> Value
toJSON AutoScalingUpdate' {Natural
ScaleInPolicyUpdate
ScaleOutPolicyUpdate
scaleOutPolicy :: ScaleOutPolicyUpdate
scaleInPolicy :: ScaleInPolicyUpdate
minWorkerCount :: Natural
mcuCount :: Natural
maxWorkerCount :: Natural
$sel:scaleOutPolicy:AutoScalingUpdate' :: AutoScalingUpdate -> ScaleOutPolicyUpdate
$sel:scaleInPolicy:AutoScalingUpdate' :: AutoScalingUpdate -> ScaleInPolicyUpdate
$sel:minWorkerCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
$sel:mcuCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
$sel:maxWorkerCount:AutoScalingUpdate' :: AutoScalingUpdate -> Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"maxWorkerCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maxWorkerCount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"mcuCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
mcuCount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"minWorkerCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
minWorkerCount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"scaleInPolicy" Text -> ScaleInPolicyUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ScaleInPolicyUpdate
scaleInPolicy),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"scaleOutPolicy" Text -> ScaleOutPolicyUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ScaleOutPolicyUpdate
scaleOutPolicy)
]
)