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