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