{-# 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.ProvisionedCapacityUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProvisionedCapacityUpdate = ProvisionedCapacityUpdate'
{
ProvisionedCapacityUpdate -> Natural
mcuCount :: Prelude.Natural,
ProvisionedCapacityUpdate -> Natural
workerCount :: Prelude.Natural
}
deriving (ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool
(ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool)
-> (ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool)
-> Eq ProvisionedCapacityUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool
$c/= :: ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool
== :: ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool
$c== :: ProvisionedCapacityUpdate -> ProvisionedCapacityUpdate -> Bool
Prelude.Eq, ReadPrec [ProvisionedCapacityUpdate]
ReadPrec ProvisionedCapacityUpdate
Int -> ReadS ProvisionedCapacityUpdate
ReadS [ProvisionedCapacityUpdate]
(Int -> ReadS ProvisionedCapacityUpdate)
-> ReadS [ProvisionedCapacityUpdate]
-> ReadPrec ProvisionedCapacityUpdate
-> ReadPrec [ProvisionedCapacityUpdate]
-> Read ProvisionedCapacityUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisionedCapacityUpdate]
$creadListPrec :: ReadPrec [ProvisionedCapacityUpdate]
readPrec :: ReadPrec ProvisionedCapacityUpdate
$creadPrec :: ReadPrec ProvisionedCapacityUpdate
readList :: ReadS [ProvisionedCapacityUpdate]
$creadList :: ReadS [ProvisionedCapacityUpdate]
readsPrec :: Int -> ReadS ProvisionedCapacityUpdate
$creadsPrec :: Int -> ReadS ProvisionedCapacityUpdate
Prelude.Read, Int -> ProvisionedCapacityUpdate -> ShowS
[ProvisionedCapacityUpdate] -> ShowS
ProvisionedCapacityUpdate -> String
(Int -> ProvisionedCapacityUpdate -> ShowS)
-> (ProvisionedCapacityUpdate -> String)
-> ([ProvisionedCapacityUpdate] -> ShowS)
-> Show ProvisionedCapacityUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisionedCapacityUpdate] -> ShowS
$cshowList :: [ProvisionedCapacityUpdate] -> ShowS
show :: ProvisionedCapacityUpdate -> String
$cshow :: ProvisionedCapacityUpdate -> String
showsPrec :: Int -> ProvisionedCapacityUpdate -> ShowS
$cshowsPrec :: Int -> ProvisionedCapacityUpdate -> ShowS
Prelude.Show, (forall x.
ProvisionedCapacityUpdate -> Rep ProvisionedCapacityUpdate x)
-> (forall x.
Rep ProvisionedCapacityUpdate x -> ProvisionedCapacityUpdate)
-> Generic ProvisionedCapacityUpdate
forall x.
Rep ProvisionedCapacityUpdate x -> ProvisionedCapacityUpdate
forall x.
ProvisionedCapacityUpdate -> Rep ProvisionedCapacityUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisionedCapacityUpdate x -> ProvisionedCapacityUpdate
$cfrom :: forall x.
ProvisionedCapacityUpdate -> Rep ProvisionedCapacityUpdate x
Prelude.Generic)
newProvisionedCapacityUpdate ::
Prelude.Natural ->
Prelude.Natural ->
ProvisionedCapacityUpdate
newProvisionedCapacityUpdate :: Natural -> Natural -> ProvisionedCapacityUpdate
newProvisionedCapacityUpdate Natural
pMcuCount_ Natural
pWorkerCount_ =
ProvisionedCapacityUpdate' :: Natural -> Natural -> ProvisionedCapacityUpdate
ProvisionedCapacityUpdate'
{ $sel:mcuCount:ProvisionedCapacityUpdate' :: Natural
mcuCount = Natural
pMcuCount_,
$sel:workerCount:ProvisionedCapacityUpdate' :: Natural
workerCount = Natural
pWorkerCount_
}
provisionedCapacityUpdate_mcuCount :: Lens.Lens' ProvisionedCapacityUpdate Prelude.Natural
provisionedCapacityUpdate_mcuCount :: (Natural -> f Natural)
-> ProvisionedCapacityUpdate -> f ProvisionedCapacityUpdate
provisionedCapacityUpdate_mcuCount = (ProvisionedCapacityUpdate -> Natural)
-> (ProvisionedCapacityUpdate
-> Natural -> ProvisionedCapacityUpdate)
-> Lens
ProvisionedCapacityUpdate ProvisionedCapacityUpdate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedCapacityUpdate' {Natural
mcuCount :: Natural
$sel:mcuCount:ProvisionedCapacityUpdate' :: ProvisionedCapacityUpdate -> Natural
mcuCount} -> Natural
mcuCount) (\s :: ProvisionedCapacityUpdate
s@ProvisionedCapacityUpdate' {} Natural
a -> ProvisionedCapacityUpdate
s {$sel:mcuCount:ProvisionedCapacityUpdate' :: Natural
mcuCount = Natural
a} :: ProvisionedCapacityUpdate)
provisionedCapacityUpdate_workerCount :: Lens.Lens' ProvisionedCapacityUpdate Prelude.Natural
provisionedCapacityUpdate_workerCount :: (Natural -> f Natural)
-> ProvisionedCapacityUpdate -> f ProvisionedCapacityUpdate
provisionedCapacityUpdate_workerCount = (ProvisionedCapacityUpdate -> Natural)
-> (ProvisionedCapacityUpdate
-> Natural -> ProvisionedCapacityUpdate)
-> Lens
ProvisionedCapacityUpdate ProvisionedCapacityUpdate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedCapacityUpdate' {Natural
workerCount :: Natural
$sel:workerCount:ProvisionedCapacityUpdate' :: ProvisionedCapacityUpdate -> Natural
workerCount} -> Natural
workerCount) (\s :: ProvisionedCapacityUpdate
s@ProvisionedCapacityUpdate' {} Natural
a -> ProvisionedCapacityUpdate
s {$sel:workerCount:ProvisionedCapacityUpdate' :: Natural
workerCount = Natural
a} :: ProvisionedCapacityUpdate)
instance Prelude.Hashable ProvisionedCapacityUpdate
instance Prelude.NFData ProvisionedCapacityUpdate
instance Core.ToJSON ProvisionedCapacityUpdate where
toJSON :: ProvisionedCapacityUpdate -> Value
toJSON ProvisionedCapacityUpdate' {Natural
workerCount :: Natural
mcuCount :: Natural
$sel:workerCount:ProvisionedCapacityUpdate' :: ProvisionedCapacityUpdate -> Natural
$sel:mcuCount:ProvisionedCapacityUpdate' :: ProvisionedCapacityUpdate -> 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
"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
"workerCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
workerCount)
]
)