{-# 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.KinesisAnalyticsV2.Types.ParallelismConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.ConfigurationType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ParallelismConfiguration = ParallelismConfiguration'
{
ParallelismConfiguration -> Maybe Bool
autoScalingEnabled :: Prelude.Maybe Prelude.Bool,
ParallelismConfiguration -> Maybe Natural
parallelismPerKPU :: Prelude.Maybe Prelude.Natural,
ParallelismConfiguration -> Maybe Natural
parallelism :: Prelude.Maybe Prelude.Natural,
ParallelismConfiguration -> ConfigurationType
configurationType :: ConfigurationType
}
deriving (ParallelismConfiguration -> ParallelismConfiguration -> Bool
(ParallelismConfiguration -> ParallelismConfiguration -> Bool)
-> (ParallelismConfiguration -> ParallelismConfiguration -> Bool)
-> Eq ParallelismConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParallelismConfiguration -> ParallelismConfiguration -> Bool
$c/= :: ParallelismConfiguration -> ParallelismConfiguration -> Bool
== :: ParallelismConfiguration -> ParallelismConfiguration -> Bool
$c== :: ParallelismConfiguration -> ParallelismConfiguration -> Bool
Prelude.Eq, ReadPrec [ParallelismConfiguration]
ReadPrec ParallelismConfiguration
Int -> ReadS ParallelismConfiguration
ReadS [ParallelismConfiguration]
(Int -> ReadS ParallelismConfiguration)
-> ReadS [ParallelismConfiguration]
-> ReadPrec ParallelismConfiguration
-> ReadPrec [ParallelismConfiguration]
-> Read ParallelismConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParallelismConfiguration]
$creadListPrec :: ReadPrec [ParallelismConfiguration]
readPrec :: ReadPrec ParallelismConfiguration
$creadPrec :: ReadPrec ParallelismConfiguration
readList :: ReadS [ParallelismConfiguration]
$creadList :: ReadS [ParallelismConfiguration]
readsPrec :: Int -> ReadS ParallelismConfiguration
$creadsPrec :: Int -> ReadS ParallelismConfiguration
Prelude.Read, Int -> ParallelismConfiguration -> ShowS
[ParallelismConfiguration] -> ShowS
ParallelismConfiguration -> String
(Int -> ParallelismConfiguration -> ShowS)
-> (ParallelismConfiguration -> String)
-> ([ParallelismConfiguration] -> ShowS)
-> Show ParallelismConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParallelismConfiguration] -> ShowS
$cshowList :: [ParallelismConfiguration] -> ShowS
show :: ParallelismConfiguration -> String
$cshow :: ParallelismConfiguration -> String
showsPrec :: Int -> ParallelismConfiguration -> ShowS
$cshowsPrec :: Int -> ParallelismConfiguration -> ShowS
Prelude.Show, (forall x.
ParallelismConfiguration -> Rep ParallelismConfiguration x)
-> (forall x.
Rep ParallelismConfiguration x -> ParallelismConfiguration)
-> Generic ParallelismConfiguration
forall x.
Rep ParallelismConfiguration x -> ParallelismConfiguration
forall x.
ParallelismConfiguration -> Rep ParallelismConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ParallelismConfiguration x -> ParallelismConfiguration
$cfrom :: forall x.
ParallelismConfiguration -> Rep ParallelismConfiguration x
Prelude.Generic)
newParallelismConfiguration ::
ConfigurationType ->
ParallelismConfiguration
newParallelismConfiguration :: ConfigurationType -> ParallelismConfiguration
newParallelismConfiguration ConfigurationType
pConfigurationType_ =
ParallelismConfiguration' :: Maybe Bool
-> Maybe Natural
-> Maybe Natural
-> ConfigurationType
-> ParallelismConfiguration
ParallelismConfiguration'
{ $sel:autoScalingEnabled:ParallelismConfiguration' :: Maybe Bool
autoScalingEnabled =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:parallelismPerKPU:ParallelismConfiguration' :: Maybe Natural
parallelismPerKPU = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:parallelism:ParallelismConfiguration' :: Maybe Natural
parallelism = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:configurationType:ParallelismConfiguration' :: ConfigurationType
configurationType = ConfigurationType
pConfigurationType_
}
parallelismConfiguration_autoScalingEnabled :: Lens.Lens' ParallelismConfiguration (Prelude.Maybe Prelude.Bool)
parallelismConfiguration_autoScalingEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ParallelismConfiguration -> f ParallelismConfiguration
parallelismConfiguration_autoScalingEnabled = (ParallelismConfiguration -> Maybe Bool)
-> (ParallelismConfiguration
-> Maybe Bool -> ParallelismConfiguration)
-> Lens
ParallelismConfiguration
ParallelismConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelismConfiguration' {Maybe Bool
autoScalingEnabled :: Maybe Bool
$sel:autoScalingEnabled:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Bool
autoScalingEnabled} -> Maybe Bool
autoScalingEnabled) (\s :: ParallelismConfiguration
s@ParallelismConfiguration' {} Maybe Bool
a -> ParallelismConfiguration
s {$sel:autoScalingEnabled:ParallelismConfiguration' :: Maybe Bool
autoScalingEnabled = Maybe Bool
a} :: ParallelismConfiguration)
parallelismConfiguration_parallelismPerKPU :: Lens.Lens' ParallelismConfiguration (Prelude.Maybe Prelude.Natural)
parallelismConfiguration_parallelismPerKPU :: (Maybe Natural -> f (Maybe Natural))
-> ParallelismConfiguration -> f ParallelismConfiguration
parallelismConfiguration_parallelismPerKPU = (ParallelismConfiguration -> Maybe Natural)
-> (ParallelismConfiguration
-> Maybe Natural -> ParallelismConfiguration)
-> Lens
ParallelismConfiguration
ParallelismConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelismConfiguration' {Maybe Natural
parallelismPerKPU :: Maybe Natural
$sel:parallelismPerKPU:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Natural
parallelismPerKPU} -> Maybe Natural
parallelismPerKPU) (\s :: ParallelismConfiguration
s@ParallelismConfiguration' {} Maybe Natural
a -> ParallelismConfiguration
s {$sel:parallelismPerKPU:ParallelismConfiguration' :: Maybe Natural
parallelismPerKPU = Maybe Natural
a} :: ParallelismConfiguration)
parallelismConfiguration_parallelism :: Lens.Lens' ParallelismConfiguration (Prelude.Maybe Prelude.Natural)
parallelismConfiguration_parallelism :: (Maybe Natural -> f (Maybe Natural))
-> ParallelismConfiguration -> f ParallelismConfiguration
parallelismConfiguration_parallelism = (ParallelismConfiguration -> Maybe Natural)
-> (ParallelismConfiguration
-> Maybe Natural -> ParallelismConfiguration)
-> Lens
ParallelismConfiguration
ParallelismConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelismConfiguration' {Maybe Natural
parallelism :: Maybe Natural
$sel:parallelism:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Natural
parallelism} -> Maybe Natural
parallelism) (\s :: ParallelismConfiguration
s@ParallelismConfiguration' {} Maybe Natural
a -> ParallelismConfiguration
s {$sel:parallelism:ParallelismConfiguration' :: Maybe Natural
parallelism = Maybe Natural
a} :: ParallelismConfiguration)
parallelismConfiguration_configurationType :: Lens.Lens' ParallelismConfiguration ConfigurationType
parallelismConfiguration_configurationType :: (ConfigurationType -> f ConfigurationType)
-> ParallelismConfiguration -> f ParallelismConfiguration
parallelismConfiguration_configurationType = (ParallelismConfiguration -> ConfigurationType)
-> (ParallelismConfiguration
-> ConfigurationType -> ParallelismConfiguration)
-> Lens
ParallelismConfiguration
ParallelismConfiguration
ConfigurationType
ConfigurationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelismConfiguration' {ConfigurationType
configurationType :: ConfigurationType
$sel:configurationType:ParallelismConfiguration' :: ParallelismConfiguration -> ConfigurationType
configurationType} -> ConfigurationType
configurationType) (\s :: ParallelismConfiguration
s@ParallelismConfiguration' {} ConfigurationType
a -> ParallelismConfiguration
s {$sel:configurationType:ParallelismConfiguration' :: ConfigurationType
configurationType = ConfigurationType
a} :: ParallelismConfiguration)
instance Prelude.Hashable ParallelismConfiguration
instance Prelude.NFData ParallelismConfiguration
instance Core.ToJSON ParallelismConfiguration where
toJSON :: ParallelismConfiguration -> Value
toJSON ParallelismConfiguration' {Maybe Bool
Maybe Natural
ConfigurationType
configurationType :: ConfigurationType
parallelism :: Maybe Natural
parallelismPerKPU :: Maybe Natural
autoScalingEnabled :: Maybe Bool
$sel:configurationType:ParallelismConfiguration' :: ParallelismConfiguration -> ConfigurationType
$sel:parallelism:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Natural
$sel:parallelismPerKPU:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Natural
$sel:autoScalingEnabled:ParallelismConfiguration' :: ParallelismConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AutoScalingEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoScalingEnabled,
(Text
"ParallelismPerKPU" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
parallelismPerKPU,
(Text
"Parallelism" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
parallelism,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ConfigurationType" Text -> ConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConfigurationType
configurationType)
]
)