{-# 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.InputParallelism where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputParallelism = InputParallelism'
{
InputParallelism -> Maybe Natural
count :: Prelude.Maybe Prelude.Natural
}
deriving (InputParallelism -> InputParallelism -> Bool
(InputParallelism -> InputParallelism -> Bool)
-> (InputParallelism -> InputParallelism -> Bool)
-> Eq InputParallelism
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputParallelism -> InputParallelism -> Bool
$c/= :: InputParallelism -> InputParallelism -> Bool
== :: InputParallelism -> InputParallelism -> Bool
$c== :: InputParallelism -> InputParallelism -> Bool
Prelude.Eq, ReadPrec [InputParallelism]
ReadPrec InputParallelism
Int -> ReadS InputParallelism
ReadS [InputParallelism]
(Int -> ReadS InputParallelism)
-> ReadS [InputParallelism]
-> ReadPrec InputParallelism
-> ReadPrec [InputParallelism]
-> Read InputParallelism
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputParallelism]
$creadListPrec :: ReadPrec [InputParallelism]
readPrec :: ReadPrec InputParallelism
$creadPrec :: ReadPrec InputParallelism
readList :: ReadS [InputParallelism]
$creadList :: ReadS [InputParallelism]
readsPrec :: Int -> ReadS InputParallelism
$creadsPrec :: Int -> ReadS InputParallelism
Prelude.Read, Int -> InputParallelism -> ShowS
[InputParallelism] -> ShowS
InputParallelism -> String
(Int -> InputParallelism -> ShowS)
-> (InputParallelism -> String)
-> ([InputParallelism] -> ShowS)
-> Show InputParallelism
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputParallelism] -> ShowS
$cshowList :: [InputParallelism] -> ShowS
show :: InputParallelism -> String
$cshow :: InputParallelism -> String
showsPrec :: Int -> InputParallelism -> ShowS
$cshowsPrec :: Int -> InputParallelism -> ShowS
Prelude.Show, (forall x. InputParallelism -> Rep InputParallelism x)
-> (forall x. Rep InputParallelism x -> InputParallelism)
-> Generic InputParallelism
forall x. Rep InputParallelism x -> InputParallelism
forall x. InputParallelism -> Rep InputParallelism x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputParallelism x -> InputParallelism
$cfrom :: forall x. InputParallelism -> Rep InputParallelism x
Prelude.Generic)
newInputParallelism ::
InputParallelism
newInputParallelism :: InputParallelism
newInputParallelism =
InputParallelism' :: Maybe Natural -> InputParallelism
InputParallelism' {$sel:count:InputParallelism' :: Maybe Natural
count = Maybe Natural
forall a. Maybe a
Prelude.Nothing}
inputParallelism_count :: Lens.Lens' InputParallelism (Prelude.Maybe Prelude.Natural)
inputParallelism_count :: (Maybe Natural -> f (Maybe Natural))
-> InputParallelism -> f InputParallelism
inputParallelism_count = (InputParallelism -> Maybe Natural)
-> (InputParallelism -> Maybe Natural -> InputParallelism)
-> Lens
InputParallelism InputParallelism (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputParallelism' {Maybe Natural
count :: Maybe Natural
$sel:count:InputParallelism' :: InputParallelism -> Maybe Natural
count} -> Maybe Natural
count) (\s :: InputParallelism
s@InputParallelism' {} Maybe Natural
a -> InputParallelism
s {$sel:count:InputParallelism' :: Maybe Natural
count = Maybe Natural
a} :: InputParallelism)
instance Core.FromJSON InputParallelism where
parseJSON :: Value -> Parser InputParallelism
parseJSON =
String
-> (Object -> Parser InputParallelism)
-> Value
-> Parser InputParallelism
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputParallelism"
( \Object
x ->
Maybe Natural -> InputParallelism
InputParallelism' (Maybe Natural -> InputParallelism)
-> Parser (Maybe Natural) -> Parser InputParallelism
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Count")
)
instance Prelude.Hashable InputParallelism
instance Prelude.NFData InputParallelism
instance Core.ToJSON InputParallelism where
toJSON :: InputParallelism -> Value
toJSON InputParallelism' {Maybe Natural
count :: Maybe Natural
$sel:count:InputParallelism' :: InputParallelism -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Count" 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
count]
)