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