{-# 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.CapacityDescription where
import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.AutoScalingDescription
import Amazonka.KafkaConnect.Types.ProvisionedCapacityDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CapacityDescription = CapacityDescription'
{
CapacityDescription -> Maybe AutoScalingDescription
autoScaling :: Prelude.Maybe AutoScalingDescription,
CapacityDescription -> Maybe ProvisionedCapacityDescription
provisionedCapacity :: Prelude.Maybe ProvisionedCapacityDescription
}
deriving (CapacityDescription -> CapacityDescription -> Bool
(CapacityDescription -> CapacityDescription -> Bool)
-> (CapacityDescription -> CapacityDescription -> Bool)
-> Eq CapacityDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CapacityDescription -> CapacityDescription -> Bool
$c/= :: CapacityDescription -> CapacityDescription -> Bool
== :: CapacityDescription -> CapacityDescription -> Bool
$c== :: CapacityDescription -> CapacityDescription -> Bool
Prelude.Eq, ReadPrec [CapacityDescription]
ReadPrec CapacityDescription
Int -> ReadS CapacityDescription
ReadS [CapacityDescription]
(Int -> ReadS CapacityDescription)
-> ReadS [CapacityDescription]
-> ReadPrec CapacityDescription
-> ReadPrec [CapacityDescription]
-> Read CapacityDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CapacityDescription]
$creadListPrec :: ReadPrec [CapacityDescription]
readPrec :: ReadPrec CapacityDescription
$creadPrec :: ReadPrec CapacityDescription
readList :: ReadS [CapacityDescription]
$creadList :: ReadS [CapacityDescription]
readsPrec :: Int -> ReadS CapacityDescription
$creadsPrec :: Int -> ReadS CapacityDescription
Prelude.Read, Int -> CapacityDescription -> ShowS
[CapacityDescription] -> ShowS
CapacityDescription -> String
(Int -> CapacityDescription -> ShowS)
-> (CapacityDescription -> String)
-> ([CapacityDescription] -> ShowS)
-> Show CapacityDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CapacityDescription] -> ShowS
$cshowList :: [CapacityDescription] -> ShowS
show :: CapacityDescription -> String
$cshow :: CapacityDescription -> String
showsPrec :: Int -> CapacityDescription -> ShowS
$cshowsPrec :: Int -> CapacityDescription -> ShowS
Prelude.Show, (forall x. CapacityDescription -> Rep CapacityDescription x)
-> (forall x. Rep CapacityDescription x -> CapacityDescription)
-> Generic CapacityDescription
forall x. Rep CapacityDescription x -> CapacityDescription
forall x. CapacityDescription -> Rep CapacityDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CapacityDescription x -> CapacityDescription
$cfrom :: forall x. CapacityDescription -> Rep CapacityDescription x
Prelude.Generic)
newCapacityDescription ::
CapacityDescription
newCapacityDescription :: CapacityDescription
newCapacityDescription =
CapacityDescription' :: Maybe AutoScalingDescription
-> Maybe ProvisionedCapacityDescription -> CapacityDescription
CapacityDescription'
{ $sel:autoScaling:CapacityDescription' :: Maybe AutoScalingDescription
autoScaling = Maybe AutoScalingDescription
forall a. Maybe a
Prelude.Nothing,
$sel:provisionedCapacity:CapacityDescription' :: Maybe ProvisionedCapacityDescription
provisionedCapacity = Maybe ProvisionedCapacityDescription
forall a. Maybe a
Prelude.Nothing
}
capacityDescription_autoScaling :: Lens.Lens' CapacityDescription (Prelude.Maybe AutoScalingDescription)
capacityDescription_autoScaling :: (Maybe AutoScalingDescription -> f (Maybe AutoScalingDescription))
-> CapacityDescription -> f CapacityDescription
capacityDescription_autoScaling = (CapacityDescription -> Maybe AutoScalingDescription)
-> (CapacityDescription
-> Maybe AutoScalingDescription -> CapacityDescription)
-> Lens
CapacityDescription
CapacityDescription
(Maybe AutoScalingDescription)
(Maybe AutoScalingDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityDescription' {Maybe AutoScalingDescription
autoScaling :: Maybe AutoScalingDescription
$sel:autoScaling:CapacityDescription' :: CapacityDescription -> Maybe AutoScalingDescription
autoScaling} -> Maybe AutoScalingDescription
autoScaling) (\s :: CapacityDescription
s@CapacityDescription' {} Maybe AutoScalingDescription
a -> CapacityDescription
s {$sel:autoScaling:CapacityDescription' :: Maybe AutoScalingDescription
autoScaling = Maybe AutoScalingDescription
a} :: CapacityDescription)
capacityDescription_provisionedCapacity :: Lens.Lens' CapacityDescription (Prelude.Maybe ProvisionedCapacityDescription)
capacityDescription_provisionedCapacity :: (Maybe ProvisionedCapacityDescription
-> f (Maybe ProvisionedCapacityDescription))
-> CapacityDescription -> f CapacityDescription
capacityDescription_provisionedCapacity = (CapacityDescription -> Maybe ProvisionedCapacityDescription)
-> (CapacityDescription
-> Maybe ProvisionedCapacityDescription -> CapacityDescription)
-> Lens
CapacityDescription
CapacityDescription
(Maybe ProvisionedCapacityDescription)
(Maybe ProvisionedCapacityDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityDescription' {Maybe ProvisionedCapacityDescription
provisionedCapacity :: Maybe ProvisionedCapacityDescription
$sel:provisionedCapacity:CapacityDescription' :: CapacityDescription -> Maybe ProvisionedCapacityDescription
provisionedCapacity} -> Maybe ProvisionedCapacityDescription
provisionedCapacity) (\s :: CapacityDescription
s@CapacityDescription' {} Maybe ProvisionedCapacityDescription
a -> CapacityDescription
s {$sel:provisionedCapacity:CapacityDescription' :: Maybe ProvisionedCapacityDescription
provisionedCapacity = Maybe ProvisionedCapacityDescription
a} :: CapacityDescription)
instance Core.FromJSON CapacityDescription where
parseJSON :: Value -> Parser CapacityDescription
parseJSON =
String
-> (Object -> Parser CapacityDescription)
-> Value
-> Parser CapacityDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CapacityDescription"
( \Object
x ->
Maybe AutoScalingDescription
-> Maybe ProvisionedCapacityDescription -> CapacityDescription
CapacityDescription'
(Maybe AutoScalingDescription
-> Maybe ProvisionedCapacityDescription -> CapacityDescription)
-> Parser (Maybe AutoScalingDescription)
-> Parser
(Maybe ProvisionedCapacityDescription -> CapacityDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AutoScalingDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"autoScaling")
Parser
(Maybe ProvisionedCapacityDescription -> CapacityDescription)
-> Parser (Maybe ProvisionedCapacityDescription)
-> Parser CapacityDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProvisionedCapacityDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"provisionedCapacity")
)
instance Prelude.Hashable CapacityDescription
instance Prelude.NFData CapacityDescription