{-# 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.IoTAnalytics.Types.LambdaActivity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data LambdaActivity = LambdaActivity'
{
LambdaActivity -> Maybe Text
next :: Prelude.Maybe Prelude.Text,
LambdaActivity -> Text
name :: Prelude.Text,
LambdaActivity -> Text
lambdaName :: Prelude.Text,
LambdaActivity -> Natural
batchSize :: Prelude.Natural
}
deriving (LambdaActivity -> LambdaActivity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaActivity -> LambdaActivity -> Bool
$c/= :: LambdaActivity -> LambdaActivity -> Bool
== :: LambdaActivity -> LambdaActivity -> Bool
$c== :: LambdaActivity -> LambdaActivity -> Bool
Prelude.Eq, ReadPrec [LambdaActivity]
ReadPrec LambdaActivity
Int -> ReadS LambdaActivity
ReadS [LambdaActivity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaActivity]
$creadListPrec :: ReadPrec [LambdaActivity]
readPrec :: ReadPrec LambdaActivity
$creadPrec :: ReadPrec LambdaActivity
readList :: ReadS [LambdaActivity]
$creadList :: ReadS [LambdaActivity]
readsPrec :: Int -> ReadS LambdaActivity
$creadsPrec :: Int -> ReadS LambdaActivity
Prelude.Read, Int -> LambdaActivity -> ShowS
[LambdaActivity] -> ShowS
LambdaActivity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaActivity] -> ShowS
$cshowList :: [LambdaActivity] -> ShowS
show :: LambdaActivity -> String
$cshow :: LambdaActivity -> String
showsPrec :: Int -> LambdaActivity -> ShowS
$cshowsPrec :: Int -> LambdaActivity -> ShowS
Prelude.Show, forall x. Rep LambdaActivity x -> LambdaActivity
forall x. LambdaActivity -> Rep LambdaActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaActivity x -> LambdaActivity
$cfrom :: forall x. LambdaActivity -> Rep LambdaActivity x
Prelude.Generic)
newLambdaActivity ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
LambdaActivity
newLambdaActivity :: Text -> Text -> Natural -> LambdaActivity
newLambdaActivity Text
pName_ Text
pLambdaName_ Natural
pBatchSize_ =
LambdaActivity'
{ $sel:next:LambdaActivity' :: Maybe Text
next = forall a. Maybe a
Prelude.Nothing,
$sel:name:LambdaActivity' :: Text
name = Text
pName_,
$sel:lambdaName:LambdaActivity' :: Text
lambdaName = Text
pLambdaName_,
$sel:batchSize:LambdaActivity' :: Natural
batchSize = Natural
pBatchSize_
}
lambdaActivity_next :: Lens.Lens' LambdaActivity (Prelude.Maybe Prelude.Text)
lambdaActivity_next :: Lens' LambdaActivity (Maybe Text)
lambdaActivity_next = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaActivity' {Maybe Text
next :: Maybe Text
$sel:next:LambdaActivity' :: LambdaActivity -> Maybe Text
next} -> Maybe Text
next) (\s :: LambdaActivity
s@LambdaActivity' {} Maybe Text
a -> LambdaActivity
s {$sel:next:LambdaActivity' :: Maybe Text
next = Maybe Text
a} :: LambdaActivity)
lambdaActivity_name :: Lens.Lens' LambdaActivity Prelude.Text
lambdaActivity_name :: Lens' LambdaActivity Text
lambdaActivity_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaActivity' {Text
name :: Text
$sel:name:LambdaActivity' :: LambdaActivity -> Text
name} -> Text
name) (\s :: LambdaActivity
s@LambdaActivity' {} Text
a -> LambdaActivity
s {$sel:name:LambdaActivity' :: Text
name = Text
a} :: LambdaActivity)
lambdaActivity_lambdaName :: Lens.Lens' LambdaActivity Prelude.Text
lambdaActivity_lambdaName :: Lens' LambdaActivity Text
lambdaActivity_lambdaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaActivity' {Text
lambdaName :: Text
$sel:lambdaName:LambdaActivity' :: LambdaActivity -> Text
lambdaName} -> Text
lambdaName) (\s :: LambdaActivity
s@LambdaActivity' {} Text
a -> LambdaActivity
s {$sel:lambdaName:LambdaActivity' :: Text
lambdaName = Text
a} :: LambdaActivity)
lambdaActivity_batchSize :: Lens.Lens' LambdaActivity Prelude.Natural
lambdaActivity_batchSize :: Lens' LambdaActivity Natural
lambdaActivity_batchSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaActivity' {Natural
batchSize :: Natural
$sel:batchSize:LambdaActivity' :: LambdaActivity -> Natural
batchSize} -> Natural
batchSize) (\s :: LambdaActivity
s@LambdaActivity' {} Natural
a -> LambdaActivity
s {$sel:batchSize:LambdaActivity' :: Natural
batchSize = Natural
a} :: LambdaActivity)
instance Data.FromJSON LambdaActivity where
parseJSON :: Value -> Parser LambdaActivity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LambdaActivity"
( \Object
x ->
Maybe Text -> Text -> Text -> Natural -> LambdaActivity
LambdaActivity'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"next")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"lambdaName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"batchSize")
)
instance Prelude.Hashable LambdaActivity where
hashWithSalt :: Int -> LambdaActivity -> Int
hashWithSalt Int
_salt LambdaActivity' {Natural
Maybe Text
Text
batchSize :: Natural
lambdaName :: Text
name :: Text
next :: Maybe Text
$sel:batchSize:LambdaActivity' :: LambdaActivity -> Natural
$sel:lambdaName:LambdaActivity' :: LambdaActivity -> Text
$sel:name:LambdaActivity' :: LambdaActivity -> Text
$sel:next:LambdaActivity' :: LambdaActivity -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
next
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lambdaName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
batchSize
instance Prelude.NFData LambdaActivity where
rnf :: LambdaActivity -> ()
rnf LambdaActivity' {Natural
Maybe Text
Text
batchSize :: Natural
lambdaName :: Text
name :: Text
next :: Maybe Text
$sel:batchSize:LambdaActivity' :: LambdaActivity -> Natural
$sel:lambdaName:LambdaActivity' :: LambdaActivity -> Text
$sel:name:LambdaActivity' :: LambdaActivity -> Text
$sel:next:LambdaActivity' :: LambdaActivity -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
next
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lambdaName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
batchSize
instance Data.ToJSON LambdaActivity where
toJSON :: LambdaActivity -> Value
toJSON LambdaActivity' {Natural
Maybe Text
Text
batchSize :: Natural
lambdaName :: Text
name :: Text
next :: Maybe Text
$sel:batchSize:LambdaActivity' :: LambdaActivity -> Natural
$sel:lambdaName:LambdaActivity' :: LambdaActivity -> Text
$sel:name:LambdaActivity' :: LambdaActivity -> Text
$sel:next:LambdaActivity' :: LambdaActivity -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"next" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
next,
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"lambdaName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
lambdaName),
forall a. a -> Maybe a
Prelude.Just (Key
"batchSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
batchSize)
]
)