{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTAnalytics.Types.PipelineActivity
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTAnalytics.Types.PipelineActivity where

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.AddAttributesActivity
import Amazonka.IoTAnalytics.Types.ChannelActivity
import Amazonka.IoTAnalytics.Types.DatastoreActivity
import Amazonka.IoTAnalytics.Types.DeviceRegistryEnrichActivity
import Amazonka.IoTAnalytics.Types.DeviceShadowEnrichActivity
import Amazonka.IoTAnalytics.Types.FilterActivity
import Amazonka.IoTAnalytics.Types.LambdaActivity
import Amazonka.IoTAnalytics.Types.MathActivity
import Amazonka.IoTAnalytics.Types.RemoveAttributesActivity
import Amazonka.IoTAnalytics.Types.SelectAttributesActivity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An activity that performs a transformation on a message.
--
-- /See:/ 'newPipelineActivity' smart constructor.
data PipelineActivity = PipelineActivity'
  { -- | Used to create a new message using only the specified attributes from
    -- the original message.
    PipelineActivity -> Maybe SelectAttributesActivity
selectAttributes :: Prelude.Maybe SelectAttributesActivity,
    -- | Determines the source of the messages to be processed.
    PipelineActivity -> Maybe ChannelActivity
channel :: Prelude.Maybe ChannelActivity,
    -- | Adds other attributes based on existing attributes in the message.
    PipelineActivity -> Maybe AddAttributesActivity
addAttributes :: Prelude.Maybe AddAttributesActivity,
    -- | Adds data from the IoT device registry to your message.
    PipelineActivity -> Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich :: Prelude.Maybe DeviceRegistryEnrichActivity,
    -- | Removes attributes from a message.
    PipelineActivity -> Maybe RemoveAttributesActivity
removeAttributes :: Prelude.Maybe RemoveAttributesActivity,
    -- | Runs a Lambda function to modify the message.
    PipelineActivity -> Maybe LambdaActivity
lambda :: Prelude.Maybe LambdaActivity,
    -- | Specifies where to store the processed message data.
    PipelineActivity -> Maybe DatastoreActivity
datastore :: Prelude.Maybe DatastoreActivity,
    -- | Adds information from the IoT Device Shadow service to a message.
    PipelineActivity -> Maybe DeviceShadowEnrichActivity
deviceShadowEnrich :: Prelude.Maybe DeviceShadowEnrichActivity,
    -- | Filters a message based on its attributes.
    PipelineActivity -> Maybe FilterActivity
filter' :: Prelude.Maybe FilterActivity,
    -- | Computes an arithmetic expression using the message\'s attributes and
    -- adds it to the message.
    PipelineActivity -> Maybe MathActivity
math :: Prelude.Maybe MathActivity
  }
  deriving (PipelineActivity -> PipelineActivity -> Bool
(PipelineActivity -> PipelineActivity -> Bool)
-> (PipelineActivity -> PipelineActivity -> Bool)
-> Eq PipelineActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineActivity -> PipelineActivity -> Bool
$c/= :: PipelineActivity -> PipelineActivity -> Bool
== :: PipelineActivity -> PipelineActivity -> Bool
$c== :: PipelineActivity -> PipelineActivity -> Bool
Prelude.Eq, ReadPrec [PipelineActivity]
ReadPrec PipelineActivity
Int -> ReadS PipelineActivity
ReadS [PipelineActivity]
(Int -> ReadS PipelineActivity)
-> ReadS [PipelineActivity]
-> ReadPrec PipelineActivity
-> ReadPrec [PipelineActivity]
-> Read PipelineActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineActivity]
$creadListPrec :: ReadPrec [PipelineActivity]
readPrec :: ReadPrec PipelineActivity
$creadPrec :: ReadPrec PipelineActivity
readList :: ReadS [PipelineActivity]
$creadList :: ReadS [PipelineActivity]
readsPrec :: Int -> ReadS PipelineActivity
$creadsPrec :: Int -> ReadS PipelineActivity
Prelude.Read, Int -> PipelineActivity -> ShowS
[PipelineActivity] -> ShowS
PipelineActivity -> String
(Int -> PipelineActivity -> ShowS)
-> (PipelineActivity -> String)
-> ([PipelineActivity] -> ShowS)
-> Show PipelineActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineActivity] -> ShowS
$cshowList :: [PipelineActivity] -> ShowS
show :: PipelineActivity -> String
$cshow :: PipelineActivity -> String
showsPrec :: Int -> PipelineActivity -> ShowS
$cshowsPrec :: Int -> PipelineActivity -> ShowS
Prelude.Show, (forall x. PipelineActivity -> Rep PipelineActivity x)
-> (forall x. Rep PipelineActivity x -> PipelineActivity)
-> Generic PipelineActivity
forall x. Rep PipelineActivity x -> PipelineActivity
forall x. PipelineActivity -> Rep PipelineActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineActivity x -> PipelineActivity
$cfrom :: forall x. PipelineActivity -> Rep PipelineActivity x
Prelude.Generic)

-- |
-- Create a value of 'PipelineActivity' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'selectAttributes', 'pipelineActivity_selectAttributes' - Used to create a new message using only the specified attributes from
-- the original message.
--
-- 'channel', 'pipelineActivity_channel' - Determines the source of the messages to be processed.
--
-- 'addAttributes', 'pipelineActivity_addAttributes' - Adds other attributes based on existing attributes in the message.
--
-- 'deviceRegistryEnrich', 'pipelineActivity_deviceRegistryEnrich' - Adds data from the IoT device registry to your message.
--
-- 'removeAttributes', 'pipelineActivity_removeAttributes' - Removes attributes from a message.
--
-- 'lambda', 'pipelineActivity_lambda' - Runs a Lambda function to modify the message.
--
-- 'datastore', 'pipelineActivity_datastore' - Specifies where to store the processed message data.
--
-- 'deviceShadowEnrich', 'pipelineActivity_deviceShadowEnrich' - Adds information from the IoT Device Shadow service to a message.
--
-- 'filter'', 'pipelineActivity_filter' - Filters a message based on its attributes.
--
-- 'math', 'pipelineActivity_math' - Computes an arithmetic expression using the message\'s attributes and
-- adds it to the message.
newPipelineActivity ::
  PipelineActivity
newPipelineActivity :: PipelineActivity
newPipelineActivity =
  PipelineActivity' :: Maybe SelectAttributesActivity
-> Maybe ChannelActivity
-> Maybe AddAttributesActivity
-> Maybe DeviceRegistryEnrichActivity
-> Maybe RemoveAttributesActivity
-> Maybe LambdaActivity
-> Maybe DatastoreActivity
-> Maybe DeviceShadowEnrichActivity
-> Maybe FilterActivity
-> Maybe MathActivity
-> PipelineActivity
PipelineActivity'
    { $sel:selectAttributes:PipelineActivity' :: Maybe SelectAttributesActivity
selectAttributes =
        Maybe SelectAttributesActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:channel:PipelineActivity' :: Maybe ChannelActivity
channel = Maybe ChannelActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:addAttributes:PipelineActivity' :: Maybe AddAttributesActivity
addAttributes = Maybe AddAttributesActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceRegistryEnrich:PipelineActivity' :: Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich = Maybe DeviceRegistryEnrichActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:removeAttributes:PipelineActivity' :: Maybe RemoveAttributesActivity
removeAttributes = Maybe RemoveAttributesActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:lambda:PipelineActivity' :: Maybe LambdaActivity
lambda = Maybe LambdaActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:datastore:PipelineActivity' :: Maybe DatastoreActivity
datastore = Maybe DatastoreActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceShadowEnrich:PipelineActivity' :: Maybe DeviceShadowEnrichActivity
deviceShadowEnrich = Maybe DeviceShadowEnrichActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':PipelineActivity' :: Maybe FilterActivity
filter' = Maybe FilterActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:math:PipelineActivity' :: Maybe MathActivity
math = Maybe MathActivity
forall a. Maybe a
Prelude.Nothing
    }

-- | Used to create a new message using only the specified attributes from
-- the original message.
pipelineActivity_selectAttributes :: Lens.Lens' PipelineActivity (Prelude.Maybe SelectAttributesActivity)
pipelineActivity_selectAttributes :: (Maybe SelectAttributesActivity
 -> f (Maybe SelectAttributesActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_selectAttributes = (PipelineActivity -> Maybe SelectAttributesActivity)
-> (PipelineActivity
    -> Maybe SelectAttributesActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe SelectAttributesActivity)
     (Maybe SelectAttributesActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe SelectAttributesActivity
selectAttributes :: Maybe SelectAttributesActivity
$sel:selectAttributes:PipelineActivity' :: PipelineActivity -> Maybe SelectAttributesActivity
selectAttributes} -> Maybe SelectAttributesActivity
selectAttributes) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe SelectAttributesActivity
a -> PipelineActivity
s {$sel:selectAttributes:PipelineActivity' :: Maybe SelectAttributesActivity
selectAttributes = Maybe SelectAttributesActivity
a} :: PipelineActivity)

-- | Determines the source of the messages to be processed.
pipelineActivity_channel :: Lens.Lens' PipelineActivity (Prelude.Maybe ChannelActivity)
pipelineActivity_channel :: (Maybe ChannelActivity -> f (Maybe ChannelActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_channel = (PipelineActivity -> Maybe ChannelActivity)
-> (PipelineActivity -> Maybe ChannelActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe ChannelActivity)
     (Maybe ChannelActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe ChannelActivity
channel :: Maybe ChannelActivity
$sel:channel:PipelineActivity' :: PipelineActivity -> Maybe ChannelActivity
channel} -> Maybe ChannelActivity
channel) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe ChannelActivity
a -> PipelineActivity
s {$sel:channel:PipelineActivity' :: Maybe ChannelActivity
channel = Maybe ChannelActivity
a} :: PipelineActivity)

-- | Adds other attributes based on existing attributes in the message.
pipelineActivity_addAttributes :: Lens.Lens' PipelineActivity (Prelude.Maybe AddAttributesActivity)
pipelineActivity_addAttributes :: (Maybe AddAttributesActivity -> f (Maybe AddAttributesActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_addAttributes = (PipelineActivity -> Maybe AddAttributesActivity)
-> (PipelineActivity
    -> Maybe AddAttributesActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe AddAttributesActivity)
     (Maybe AddAttributesActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe AddAttributesActivity
addAttributes :: Maybe AddAttributesActivity
$sel:addAttributes:PipelineActivity' :: PipelineActivity -> Maybe AddAttributesActivity
addAttributes} -> Maybe AddAttributesActivity
addAttributes) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe AddAttributesActivity
a -> PipelineActivity
s {$sel:addAttributes:PipelineActivity' :: Maybe AddAttributesActivity
addAttributes = Maybe AddAttributesActivity
a} :: PipelineActivity)

-- | Adds data from the IoT device registry to your message.
pipelineActivity_deviceRegistryEnrich :: Lens.Lens' PipelineActivity (Prelude.Maybe DeviceRegistryEnrichActivity)
pipelineActivity_deviceRegistryEnrich :: (Maybe DeviceRegistryEnrichActivity
 -> f (Maybe DeviceRegistryEnrichActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_deviceRegistryEnrich = (PipelineActivity -> Maybe DeviceRegistryEnrichActivity)
-> (PipelineActivity
    -> Maybe DeviceRegistryEnrichActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe DeviceRegistryEnrichActivity)
     (Maybe DeviceRegistryEnrichActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich :: Maybe DeviceRegistryEnrichActivity
$sel:deviceRegistryEnrich:PipelineActivity' :: PipelineActivity -> Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich} -> Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe DeviceRegistryEnrichActivity
a -> PipelineActivity
s {$sel:deviceRegistryEnrich:PipelineActivity' :: Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich = Maybe DeviceRegistryEnrichActivity
a} :: PipelineActivity)

-- | Removes attributes from a message.
pipelineActivity_removeAttributes :: Lens.Lens' PipelineActivity (Prelude.Maybe RemoveAttributesActivity)
pipelineActivity_removeAttributes :: (Maybe RemoveAttributesActivity
 -> f (Maybe RemoveAttributesActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_removeAttributes = (PipelineActivity -> Maybe RemoveAttributesActivity)
-> (PipelineActivity
    -> Maybe RemoveAttributesActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe RemoveAttributesActivity)
     (Maybe RemoveAttributesActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe RemoveAttributesActivity
removeAttributes :: Maybe RemoveAttributesActivity
$sel:removeAttributes:PipelineActivity' :: PipelineActivity -> Maybe RemoveAttributesActivity
removeAttributes} -> Maybe RemoveAttributesActivity
removeAttributes) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe RemoveAttributesActivity
a -> PipelineActivity
s {$sel:removeAttributes:PipelineActivity' :: Maybe RemoveAttributesActivity
removeAttributes = Maybe RemoveAttributesActivity
a} :: PipelineActivity)

-- | Runs a Lambda function to modify the message.
pipelineActivity_lambda :: Lens.Lens' PipelineActivity (Prelude.Maybe LambdaActivity)
pipelineActivity_lambda :: (Maybe LambdaActivity -> f (Maybe LambdaActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_lambda = (PipelineActivity -> Maybe LambdaActivity)
-> (PipelineActivity -> Maybe LambdaActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe LambdaActivity)
     (Maybe LambdaActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe LambdaActivity
lambda :: Maybe LambdaActivity
$sel:lambda:PipelineActivity' :: PipelineActivity -> Maybe LambdaActivity
lambda} -> Maybe LambdaActivity
lambda) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe LambdaActivity
a -> PipelineActivity
s {$sel:lambda:PipelineActivity' :: Maybe LambdaActivity
lambda = Maybe LambdaActivity
a} :: PipelineActivity)

-- | Specifies where to store the processed message data.
pipelineActivity_datastore :: Lens.Lens' PipelineActivity (Prelude.Maybe DatastoreActivity)
pipelineActivity_datastore :: (Maybe DatastoreActivity -> f (Maybe DatastoreActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_datastore = (PipelineActivity -> Maybe DatastoreActivity)
-> (PipelineActivity
    -> Maybe DatastoreActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe DatastoreActivity)
     (Maybe DatastoreActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe DatastoreActivity
datastore :: Maybe DatastoreActivity
$sel:datastore:PipelineActivity' :: PipelineActivity -> Maybe DatastoreActivity
datastore} -> Maybe DatastoreActivity
datastore) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe DatastoreActivity
a -> PipelineActivity
s {$sel:datastore:PipelineActivity' :: Maybe DatastoreActivity
datastore = Maybe DatastoreActivity
a} :: PipelineActivity)

-- | Adds information from the IoT Device Shadow service to a message.
pipelineActivity_deviceShadowEnrich :: Lens.Lens' PipelineActivity (Prelude.Maybe DeviceShadowEnrichActivity)
pipelineActivity_deviceShadowEnrich :: (Maybe DeviceShadowEnrichActivity
 -> f (Maybe DeviceShadowEnrichActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_deviceShadowEnrich = (PipelineActivity -> Maybe DeviceShadowEnrichActivity)
-> (PipelineActivity
    -> Maybe DeviceShadowEnrichActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe DeviceShadowEnrichActivity)
     (Maybe DeviceShadowEnrichActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe DeviceShadowEnrichActivity
deviceShadowEnrich :: Maybe DeviceShadowEnrichActivity
$sel:deviceShadowEnrich:PipelineActivity' :: PipelineActivity -> Maybe DeviceShadowEnrichActivity
deviceShadowEnrich} -> Maybe DeviceShadowEnrichActivity
deviceShadowEnrich) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe DeviceShadowEnrichActivity
a -> PipelineActivity
s {$sel:deviceShadowEnrich:PipelineActivity' :: Maybe DeviceShadowEnrichActivity
deviceShadowEnrich = Maybe DeviceShadowEnrichActivity
a} :: PipelineActivity)

-- | Filters a message based on its attributes.
pipelineActivity_filter :: Lens.Lens' PipelineActivity (Prelude.Maybe FilterActivity)
pipelineActivity_filter :: (Maybe FilterActivity -> f (Maybe FilterActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_filter = (PipelineActivity -> Maybe FilterActivity)
-> (PipelineActivity -> Maybe FilterActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe FilterActivity)
     (Maybe FilterActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe FilterActivity
filter' :: Maybe FilterActivity
$sel:filter':PipelineActivity' :: PipelineActivity -> Maybe FilterActivity
filter'} -> Maybe FilterActivity
filter') (\s :: PipelineActivity
s@PipelineActivity' {} Maybe FilterActivity
a -> PipelineActivity
s {$sel:filter':PipelineActivity' :: Maybe FilterActivity
filter' = Maybe FilterActivity
a} :: PipelineActivity)

-- | Computes an arithmetic expression using the message\'s attributes and
-- adds it to the message.
pipelineActivity_math :: Lens.Lens' PipelineActivity (Prelude.Maybe MathActivity)
pipelineActivity_math :: (Maybe MathActivity -> f (Maybe MathActivity))
-> PipelineActivity -> f PipelineActivity
pipelineActivity_math = (PipelineActivity -> Maybe MathActivity)
-> (PipelineActivity -> Maybe MathActivity -> PipelineActivity)
-> Lens
     PipelineActivity
     PipelineActivity
     (Maybe MathActivity)
     (Maybe MathActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineActivity' {Maybe MathActivity
math :: Maybe MathActivity
$sel:math:PipelineActivity' :: PipelineActivity -> Maybe MathActivity
math} -> Maybe MathActivity
math) (\s :: PipelineActivity
s@PipelineActivity' {} Maybe MathActivity
a -> PipelineActivity
s {$sel:math:PipelineActivity' :: Maybe MathActivity
math = Maybe MathActivity
a} :: PipelineActivity)

instance Core.FromJSON PipelineActivity where
  parseJSON :: Value -> Parser PipelineActivity
parseJSON =
    String
-> (Object -> Parser PipelineActivity)
-> Value
-> Parser PipelineActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PipelineActivity"
      ( \Object
x ->
          Maybe SelectAttributesActivity
-> Maybe ChannelActivity
-> Maybe AddAttributesActivity
-> Maybe DeviceRegistryEnrichActivity
-> Maybe RemoveAttributesActivity
-> Maybe LambdaActivity
-> Maybe DatastoreActivity
-> Maybe DeviceShadowEnrichActivity
-> Maybe FilterActivity
-> Maybe MathActivity
-> PipelineActivity
PipelineActivity'
            (Maybe SelectAttributesActivity
 -> Maybe ChannelActivity
 -> Maybe AddAttributesActivity
 -> Maybe DeviceRegistryEnrichActivity
 -> Maybe RemoveAttributesActivity
 -> Maybe LambdaActivity
 -> Maybe DatastoreActivity
 -> Maybe DeviceShadowEnrichActivity
 -> Maybe FilterActivity
 -> Maybe MathActivity
 -> PipelineActivity)
-> Parser (Maybe SelectAttributesActivity)
-> Parser
     (Maybe ChannelActivity
      -> Maybe AddAttributesActivity
      -> Maybe DeviceRegistryEnrichActivity
      -> Maybe RemoveAttributesActivity
      -> Maybe LambdaActivity
      -> Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SelectAttributesActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"selectAttributes")
            Parser
  (Maybe ChannelActivity
   -> Maybe AddAttributesActivity
   -> Maybe DeviceRegistryEnrichActivity
   -> Maybe RemoveAttributesActivity
   -> Maybe LambdaActivity
   -> Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe ChannelActivity)
-> Parser
     (Maybe AddAttributesActivity
      -> Maybe DeviceRegistryEnrichActivity
      -> Maybe RemoveAttributesActivity
      -> Maybe LambdaActivity
      -> Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"channel")
            Parser
  (Maybe AddAttributesActivity
   -> Maybe DeviceRegistryEnrichActivity
   -> Maybe RemoveAttributesActivity
   -> Maybe LambdaActivity
   -> Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe AddAttributesActivity)
-> Parser
     (Maybe DeviceRegistryEnrichActivity
      -> Maybe RemoveAttributesActivity
      -> Maybe LambdaActivity
      -> Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AddAttributesActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"addAttributes")
            Parser
  (Maybe DeviceRegistryEnrichActivity
   -> Maybe RemoveAttributesActivity
   -> Maybe LambdaActivity
   -> Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe DeviceRegistryEnrichActivity)
-> Parser
     (Maybe RemoveAttributesActivity
      -> Maybe LambdaActivity
      -> Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceRegistryEnrichActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deviceRegistryEnrich")
            Parser
  (Maybe RemoveAttributesActivity
   -> Maybe LambdaActivity
   -> Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe RemoveAttributesActivity)
-> Parser
     (Maybe LambdaActivity
      -> Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RemoveAttributesActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"removeAttributes")
            Parser
  (Maybe LambdaActivity
   -> Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe LambdaActivity)
-> Parser
     (Maybe DatastoreActivity
      -> Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity
      -> Maybe MathActivity
      -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LambdaActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lambda")
            Parser
  (Maybe DatastoreActivity
   -> Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity
   -> Maybe MathActivity
   -> PipelineActivity)
-> Parser (Maybe DatastoreActivity)
-> Parser
     (Maybe DeviceShadowEnrichActivity
      -> Maybe FilterActivity -> Maybe MathActivity -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatastoreActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"datastore")
            Parser
  (Maybe DeviceShadowEnrichActivity
   -> Maybe FilterActivity -> Maybe MathActivity -> PipelineActivity)
-> Parser (Maybe DeviceShadowEnrichActivity)
-> Parser
     (Maybe FilterActivity -> Maybe MathActivity -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceShadowEnrichActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deviceShadowEnrich")
            Parser
  (Maybe FilterActivity -> Maybe MathActivity -> PipelineActivity)
-> Parser (Maybe FilterActivity)
-> Parser (Maybe MathActivity -> PipelineActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FilterActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"filter")
            Parser (Maybe MathActivity -> PipelineActivity)
-> Parser (Maybe MathActivity) -> Parser PipelineActivity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MathActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"math")
      )

instance Prelude.Hashable PipelineActivity

instance Prelude.NFData PipelineActivity

instance Core.ToJSON PipelineActivity where
  toJSON :: PipelineActivity -> Value
toJSON PipelineActivity' {Maybe AddAttributesActivity
Maybe ChannelActivity
Maybe DatastoreActivity
Maybe DeviceRegistryEnrichActivity
Maybe DeviceShadowEnrichActivity
Maybe FilterActivity
Maybe LambdaActivity
Maybe MathActivity
Maybe RemoveAttributesActivity
Maybe SelectAttributesActivity
math :: Maybe MathActivity
filter' :: Maybe FilterActivity
deviceShadowEnrich :: Maybe DeviceShadowEnrichActivity
datastore :: Maybe DatastoreActivity
lambda :: Maybe LambdaActivity
removeAttributes :: Maybe RemoveAttributesActivity
deviceRegistryEnrich :: Maybe DeviceRegistryEnrichActivity
addAttributes :: Maybe AddAttributesActivity
channel :: Maybe ChannelActivity
selectAttributes :: Maybe SelectAttributesActivity
$sel:math:PipelineActivity' :: PipelineActivity -> Maybe MathActivity
$sel:filter':PipelineActivity' :: PipelineActivity -> Maybe FilterActivity
$sel:deviceShadowEnrich:PipelineActivity' :: PipelineActivity -> Maybe DeviceShadowEnrichActivity
$sel:datastore:PipelineActivity' :: PipelineActivity -> Maybe DatastoreActivity
$sel:lambda:PipelineActivity' :: PipelineActivity -> Maybe LambdaActivity
$sel:removeAttributes:PipelineActivity' :: PipelineActivity -> Maybe RemoveAttributesActivity
$sel:deviceRegistryEnrich:PipelineActivity' :: PipelineActivity -> Maybe DeviceRegistryEnrichActivity
$sel:addAttributes:PipelineActivity' :: PipelineActivity -> Maybe AddAttributesActivity
$sel:channel:PipelineActivity' :: PipelineActivity -> Maybe ChannelActivity
$sel:selectAttributes:PipelineActivity' :: PipelineActivity -> Maybe SelectAttributesActivity
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"selectAttributes" Text -> SelectAttributesActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SelectAttributesActivity -> Pair)
-> Maybe SelectAttributesActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SelectAttributesActivity
selectAttributes,
            (Text
"channel" Text -> ChannelActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChannelActivity -> Pair) -> Maybe ChannelActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelActivity
channel,
            (Text
"addAttributes" Text -> AddAttributesActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AddAttributesActivity -> Pair)
-> Maybe AddAttributesActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AddAttributesActivity
addAttributes,
            (Text
"deviceRegistryEnrich" Text -> DeviceRegistryEnrichActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeviceRegistryEnrichActivity -> Pair)
-> Maybe DeviceRegistryEnrichActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeviceRegistryEnrichActivity
deviceRegistryEnrich,
            (Text
"removeAttributes" Text -> RemoveAttributesActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RemoveAttributesActivity -> Pair)
-> Maybe RemoveAttributesActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RemoveAttributesActivity
removeAttributes,
            (Text
"lambda" Text -> LambdaActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaActivity -> Pair) -> Maybe LambdaActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaActivity
lambda,
            (Text
"datastore" Text -> DatastoreActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DatastoreActivity -> Pair)
-> Maybe DatastoreActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DatastoreActivity
datastore,
            (Text
"deviceShadowEnrich" Text -> DeviceShadowEnrichActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeviceShadowEnrichActivity -> Pair)
-> Maybe DeviceShadowEnrichActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeviceShadowEnrichActivity
deviceShadowEnrich,
            (Text
"filter" Text -> FilterActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FilterActivity -> Pair) -> Maybe FilterActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FilterActivity
filter',
            (Text
"math" Text -> MathActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MathActivity -> Pair) -> Maybe MathActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MathActivity
math
          ]
      )