{-# 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.IoTEvents.Types.Action where
import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types.ClearTimerAction
import Amazonka.IoTEvents.Types.DynamoDBAction
import Amazonka.IoTEvents.Types.DynamoDBv2Action
import Amazonka.IoTEvents.Types.FirehoseAction
import Amazonka.IoTEvents.Types.IotEventsAction
import Amazonka.IoTEvents.Types.IotSiteWiseAction
import Amazonka.IoTEvents.Types.IotTopicPublishAction
import Amazonka.IoTEvents.Types.LambdaAction
import Amazonka.IoTEvents.Types.ResetTimerAction
import Amazonka.IoTEvents.Types.SNSTopicPublishAction
import Amazonka.IoTEvents.Types.SetTimerAction
import Amazonka.IoTEvents.Types.SetVariableAction
import Amazonka.IoTEvents.Types.SqsAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Action = Action'
{
Action -> Maybe IotTopicPublishAction
iotTopicPublish :: Prelude.Maybe IotTopicPublishAction,
Action -> Maybe DynamoDBv2Action
dynamoDBv2 :: Prelude.Maybe DynamoDBv2Action,
Action -> Maybe ResetTimerAction
resetTimer :: Prelude.Maybe ResetTimerAction,
Action -> Maybe SetTimerAction
setTimer :: Prelude.Maybe SetTimerAction,
Action -> Maybe SNSTopicPublishAction
sns :: Prelude.Maybe SNSTopicPublishAction,
Action -> Maybe ClearTimerAction
clearTimer :: Prelude.Maybe ClearTimerAction,
Action -> Maybe DynamoDBAction
dynamoDB :: Prelude.Maybe DynamoDBAction,
Action -> Maybe FirehoseAction
firehose :: Prelude.Maybe FirehoseAction,
Action -> Maybe IotSiteWiseAction
iotSiteWise :: Prelude.Maybe IotSiteWiseAction,
Action -> Maybe SetVariableAction
setVariable :: Prelude.Maybe SetVariableAction,
Action -> Maybe LambdaAction
lambda :: Prelude.Maybe LambdaAction,
Action -> Maybe IotEventsAction
iotEvents :: Prelude.Maybe IotEventsAction,
Action -> Maybe SqsAction
sqs :: Prelude.Maybe SqsAction
}
deriving (Action -> Action -> Bool
(Action -> Action -> Bool)
-> (Action -> Action -> Bool) -> Eq Action
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c== :: Action -> Action -> Bool
Prelude.Eq, ReadPrec [Action]
ReadPrec Action
Int -> ReadS Action
ReadS [Action]
(Int -> ReadS Action)
-> ReadS [Action]
-> ReadPrec Action
-> ReadPrec [Action]
-> Read Action
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Action]
$creadListPrec :: ReadPrec [Action]
readPrec :: ReadPrec Action
$creadPrec :: ReadPrec Action
readList :: ReadS [Action]
$creadList :: ReadS [Action]
readsPrec :: Int -> ReadS Action
$creadsPrec :: Int -> ReadS Action
Prelude.Read, Int -> Action -> ShowS
[Action] -> ShowS
Action -> String
(Int -> Action -> ShowS)
-> (Action -> String) -> ([Action] -> ShowS) -> Show Action
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Action] -> ShowS
$cshowList :: [Action] -> ShowS
show :: Action -> String
$cshow :: Action -> String
showsPrec :: Int -> Action -> ShowS
$cshowsPrec :: Int -> Action -> ShowS
Prelude.Show, (forall x. Action -> Rep Action x)
-> (forall x. Rep Action x -> Action) -> Generic Action
forall x. Rep Action x -> Action
forall x. Action -> Rep Action x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Action x -> Action
$cfrom :: forall x. Action -> Rep Action x
Prelude.Generic)
newAction ::
Action
newAction :: Action
newAction =
Action' :: Maybe IotTopicPublishAction
-> Maybe DynamoDBv2Action
-> Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action
Action'
{ $sel:iotTopicPublish:Action' :: Maybe IotTopicPublishAction
iotTopicPublish = Maybe IotTopicPublishAction
forall a. Maybe a
Prelude.Nothing,
$sel:dynamoDBv2:Action' :: Maybe DynamoDBv2Action
dynamoDBv2 = Maybe DynamoDBv2Action
forall a. Maybe a
Prelude.Nothing,
$sel:resetTimer:Action' :: Maybe ResetTimerAction
resetTimer = Maybe ResetTimerAction
forall a. Maybe a
Prelude.Nothing,
$sel:setTimer:Action' :: Maybe SetTimerAction
setTimer = Maybe SetTimerAction
forall a. Maybe a
Prelude.Nothing,
$sel:sns:Action' :: Maybe SNSTopicPublishAction
sns = Maybe SNSTopicPublishAction
forall a. Maybe a
Prelude.Nothing,
$sel:clearTimer:Action' :: Maybe ClearTimerAction
clearTimer = Maybe ClearTimerAction
forall a. Maybe a
Prelude.Nothing,
$sel:dynamoDB:Action' :: Maybe DynamoDBAction
dynamoDB = Maybe DynamoDBAction
forall a. Maybe a
Prelude.Nothing,
$sel:firehose:Action' :: Maybe FirehoseAction
firehose = Maybe FirehoseAction
forall a. Maybe a
Prelude.Nothing,
$sel:iotSiteWise:Action' :: Maybe IotSiteWiseAction
iotSiteWise = Maybe IotSiteWiseAction
forall a. Maybe a
Prelude.Nothing,
$sel:setVariable:Action' :: Maybe SetVariableAction
setVariable = Maybe SetVariableAction
forall a. Maybe a
Prelude.Nothing,
$sel:lambda:Action' :: Maybe LambdaAction
lambda = Maybe LambdaAction
forall a. Maybe a
Prelude.Nothing,
$sel:iotEvents:Action' :: Maybe IotEventsAction
iotEvents = Maybe IotEventsAction
forall a. Maybe a
Prelude.Nothing,
$sel:sqs:Action' :: Maybe SqsAction
sqs = Maybe SqsAction
forall a. Maybe a
Prelude.Nothing
}
action_iotTopicPublish :: Lens.Lens' Action (Prelude.Maybe IotTopicPublishAction)
action_iotTopicPublish :: (Maybe IotTopicPublishAction -> f (Maybe IotTopicPublishAction))
-> Action -> f Action
action_iotTopicPublish = (Action -> Maybe IotTopicPublishAction)
-> (Action -> Maybe IotTopicPublishAction -> Action)
-> Lens
Action
Action
(Maybe IotTopicPublishAction)
(Maybe IotTopicPublishAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe IotTopicPublishAction
iotTopicPublish :: Maybe IotTopicPublishAction
$sel:iotTopicPublish:Action' :: Action -> Maybe IotTopicPublishAction
iotTopicPublish} -> Maybe IotTopicPublishAction
iotTopicPublish) (\s :: Action
s@Action' {} Maybe IotTopicPublishAction
a -> Action
s {$sel:iotTopicPublish:Action' :: Maybe IotTopicPublishAction
iotTopicPublish = Maybe IotTopicPublishAction
a} :: Action)
action_dynamoDBv2 :: Lens.Lens' Action (Prelude.Maybe DynamoDBv2Action)
action_dynamoDBv2 :: (Maybe DynamoDBv2Action -> f (Maybe DynamoDBv2Action))
-> Action -> f Action
action_dynamoDBv2 = (Action -> Maybe DynamoDBv2Action)
-> (Action -> Maybe DynamoDBv2Action -> Action)
-> Lens
Action Action (Maybe DynamoDBv2Action) (Maybe DynamoDBv2Action)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe DynamoDBv2Action
dynamoDBv2 :: Maybe DynamoDBv2Action
$sel:dynamoDBv2:Action' :: Action -> Maybe DynamoDBv2Action
dynamoDBv2} -> Maybe DynamoDBv2Action
dynamoDBv2) (\s :: Action
s@Action' {} Maybe DynamoDBv2Action
a -> Action
s {$sel:dynamoDBv2:Action' :: Maybe DynamoDBv2Action
dynamoDBv2 = Maybe DynamoDBv2Action
a} :: Action)
action_resetTimer :: Lens.Lens' Action (Prelude.Maybe ResetTimerAction)
action_resetTimer :: (Maybe ResetTimerAction -> f (Maybe ResetTimerAction))
-> Action -> f Action
action_resetTimer = (Action -> Maybe ResetTimerAction)
-> (Action -> Maybe ResetTimerAction -> Action)
-> Lens
Action Action (Maybe ResetTimerAction) (Maybe ResetTimerAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe ResetTimerAction
resetTimer :: Maybe ResetTimerAction
$sel:resetTimer:Action' :: Action -> Maybe ResetTimerAction
resetTimer} -> Maybe ResetTimerAction
resetTimer) (\s :: Action
s@Action' {} Maybe ResetTimerAction
a -> Action
s {$sel:resetTimer:Action' :: Maybe ResetTimerAction
resetTimer = Maybe ResetTimerAction
a} :: Action)
action_setTimer :: Lens.Lens' Action (Prelude.Maybe SetTimerAction)
action_setTimer :: (Maybe SetTimerAction -> f (Maybe SetTimerAction))
-> Action -> f Action
action_setTimer = (Action -> Maybe SetTimerAction)
-> (Action -> Maybe SetTimerAction -> Action)
-> Lens Action Action (Maybe SetTimerAction) (Maybe SetTimerAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe SetTimerAction
setTimer :: Maybe SetTimerAction
$sel:setTimer:Action' :: Action -> Maybe SetTimerAction
setTimer} -> Maybe SetTimerAction
setTimer) (\s :: Action
s@Action' {} Maybe SetTimerAction
a -> Action
s {$sel:setTimer:Action' :: Maybe SetTimerAction
setTimer = Maybe SetTimerAction
a} :: Action)
action_sns :: Lens.Lens' Action (Prelude.Maybe SNSTopicPublishAction)
action_sns :: (Maybe SNSTopicPublishAction -> f (Maybe SNSTopicPublishAction))
-> Action -> f Action
action_sns = (Action -> Maybe SNSTopicPublishAction)
-> (Action -> Maybe SNSTopicPublishAction -> Action)
-> Lens
Action
Action
(Maybe SNSTopicPublishAction)
(Maybe SNSTopicPublishAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe SNSTopicPublishAction
sns :: Maybe SNSTopicPublishAction
$sel:sns:Action' :: Action -> Maybe SNSTopicPublishAction
sns} -> Maybe SNSTopicPublishAction
sns) (\s :: Action
s@Action' {} Maybe SNSTopicPublishAction
a -> Action
s {$sel:sns:Action' :: Maybe SNSTopicPublishAction
sns = Maybe SNSTopicPublishAction
a} :: Action)
action_clearTimer :: Lens.Lens' Action (Prelude.Maybe ClearTimerAction)
action_clearTimer :: (Maybe ClearTimerAction -> f (Maybe ClearTimerAction))
-> Action -> f Action
action_clearTimer = (Action -> Maybe ClearTimerAction)
-> (Action -> Maybe ClearTimerAction -> Action)
-> Lens
Action Action (Maybe ClearTimerAction) (Maybe ClearTimerAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe ClearTimerAction
clearTimer :: Maybe ClearTimerAction
$sel:clearTimer:Action' :: Action -> Maybe ClearTimerAction
clearTimer} -> Maybe ClearTimerAction
clearTimer) (\s :: Action
s@Action' {} Maybe ClearTimerAction
a -> Action
s {$sel:clearTimer:Action' :: Maybe ClearTimerAction
clearTimer = Maybe ClearTimerAction
a} :: Action)
action_dynamoDB :: Lens.Lens' Action (Prelude.Maybe DynamoDBAction)
action_dynamoDB :: (Maybe DynamoDBAction -> f (Maybe DynamoDBAction))
-> Action -> f Action
action_dynamoDB = (Action -> Maybe DynamoDBAction)
-> (Action -> Maybe DynamoDBAction -> Action)
-> Lens Action Action (Maybe DynamoDBAction) (Maybe DynamoDBAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe DynamoDBAction
dynamoDB :: Maybe DynamoDBAction
$sel:dynamoDB:Action' :: Action -> Maybe DynamoDBAction
dynamoDB} -> Maybe DynamoDBAction
dynamoDB) (\s :: Action
s@Action' {} Maybe DynamoDBAction
a -> Action
s {$sel:dynamoDB:Action' :: Maybe DynamoDBAction
dynamoDB = Maybe DynamoDBAction
a} :: Action)
action_firehose :: Lens.Lens' Action (Prelude.Maybe FirehoseAction)
action_firehose :: (Maybe FirehoseAction -> f (Maybe FirehoseAction))
-> Action -> f Action
action_firehose = (Action -> Maybe FirehoseAction)
-> (Action -> Maybe FirehoseAction -> Action)
-> Lens Action Action (Maybe FirehoseAction) (Maybe FirehoseAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe FirehoseAction
firehose :: Maybe FirehoseAction
$sel:firehose:Action' :: Action -> Maybe FirehoseAction
firehose} -> Maybe FirehoseAction
firehose) (\s :: Action
s@Action' {} Maybe FirehoseAction
a -> Action
s {$sel:firehose:Action' :: Maybe FirehoseAction
firehose = Maybe FirehoseAction
a} :: Action)
action_iotSiteWise :: Lens.Lens' Action (Prelude.Maybe IotSiteWiseAction)
action_iotSiteWise :: (Maybe IotSiteWiseAction -> f (Maybe IotSiteWiseAction))
-> Action -> f Action
action_iotSiteWise = (Action -> Maybe IotSiteWiseAction)
-> (Action -> Maybe IotSiteWiseAction -> Action)
-> Lens
Action Action (Maybe IotSiteWiseAction) (Maybe IotSiteWiseAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe IotSiteWiseAction
iotSiteWise :: Maybe IotSiteWiseAction
$sel:iotSiteWise:Action' :: Action -> Maybe IotSiteWiseAction
iotSiteWise} -> Maybe IotSiteWiseAction
iotSiteWise) (\s :: Action
s@Action' {} Maybe IotSiteWiseAction
a -> Action
s {$sel:iotSiteWise:Action' :: Maybe IotSiteWiseAction
iotSiteWise = Maybe IotSiteWiseAction
a} :: Action)
action_setVariable :: Lens.Lens' Action (Prelude.Maybe SetVariableAction)
action_setVariable :: (Maybe SetVariableAction -> f (Maybe SetVariableAction))
-> Action -> f Action
action_setVariable = (Action -> Maybe SetVariableAction)
-> (Action -> Maybe SetVariableAction -> Action)
-> Lens
Action Action (Maybe SetVariableAction) (Maybe SetVariableAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe SetVariableAction
setVariable :: Maybe SetVariableAction
$sel:setVariable:Action' :: Action -> Maybe SetVariableAction
setVariable} -> Maybe SetVariableAction
setVariable) (\s :: Action
s@Action' {} Maybe SetVariableAction
a -> Action
s {$sel:setVariable:Action' :: Maybe SetVariableAction
setVariable = Maybe SetVariableAction
a} :: Action)
action_lambda :: Lens.Lens' Action (Prelude.Maybe LambdaAction)
action_lambda :: (Maybe LambdaAction -> f (Maybe LambdaAction))
-> Action -> f Action
action_lambda = (Action -> Maybe LambdaAction)
-> (Action -> Maybe LambdaAction -> Action)
-> Lens Action Action (Maybe LambdaAction) (Maybe LambdaAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe LambdaAction
lambda :: Maybe LambdaAction
$sel:lambda:Action' :: Action -> Maybe LambdaAction
lambda} -> Maybe LambdaAction
lambda) (\s :: Action
s@Action' {} Maybe LambdaAction
a -> Action
s {$sel:lambda:Action' :: Maybe LambdaAction
lambda = Maybe LambdaAction
a} :: Action)
action_iotEvents :: Lens.Lens' Action (Prelude.Maybe IotEventsAction)
action_iotEvents :: (Maybe IotEventsAction -> f (Maybe IotEventsAction))
-> Action -> f Action
action_iotEvents = (Action -> Maybe IotEventsAction)
-> (Action -> Maybe IotEventsAction -> Action)
-> Lens
Action Action (Maybe IotEventsAction) (Maybe IotEventsAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe IotEventsAction
iotEvents :: Maybe IotEventsAction
$sel:iotEvents:Action' :: Action -> Maybe IotEventsAction
iotEvents} -> Maybe IotEventsAction
iotEvents) (\s :: Action
s@Action' {} Maybe IotEventsAction
a -> Action
s {$sel:iotEvents:Action' :: Maybe IotEventsAction
iotEvents = Maybe IotEventsAction
a} :: Action)
action_sqs :: Lens.Lens' Action (Prelude.Maybe SqsAction)
action_sqs :: (Maybe SqsAction -> f (Maybe SqsAction)) -> Action -> f Action
action_sqs = (Action -> Maybe SqsAction)
-> (Action -> Maybe SqsAction -> Action)
-> Lens Action Action (Maybe SqsAction) (Maybe SqsAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Action' {Maybe SqsAction
sqs :: Maybe SqsAction
$sel:sqs:Action' :: Action -> Maybe SqsAction
sqs} -> Maybe SqsAction
sqs) (\s :: Action
s@Action' {} Maybe SqsAction
a -> Action
s {$sel:sqs:Action' :: Maybe SqsAction
sqs = Maybe SqsAction
a} :: Action)
instance Core.FromJSON Action where
parseJSON :: Value -> Parser Action
parseJSON =
String -> (Object -> Parser Action) -> Value -> Parser Action
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Action"
( \Object
x ->
Maybe IotTopicPublishAction
-> Maybe DynamoDBv2Action
-> Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action
Action'
(Maybe IotTopicPublishAction
-> Maybe DynamoDBv2Action
-> Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe IotTopicPublishAction)
-> Parser
(Maybe DynamoDBv2Action
-> Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe IotTopicPublishAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iotTopicPublish")
Parser
(Maybe DynamoDBv2Action
-> Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe DynamoDBv2Action)
-> Parser
(Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DynamoDBv2Action)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dynamoDBv2")
Parser
(Maybe ResetTimerAction
-> Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe ResetTimerAction)
-> Parser
(Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResetTimerAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resetTimer")
Parser
(Maybe SetTimerAction
-> Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe SetTimerAction)
-> Parser
(Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SetTimerAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"setTimer")
Parser
(Maybe SNSTopicPublishAction
-> Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe SNSTopicPublishAction)
-> Parser
(Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SNSTopicPublishAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sns")
Parser
(Maybe ClearTimerAction
-> Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe ClearTimerAction)
-> Parser
(Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClearTimerAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clearTimer")
Parser
(Maybe DynamoDBAction
-> Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe DynamoDBAction)
-> Parser
(Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DynamoDBAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dynamoDB")
Parser
(Maybe FirehoseAction
-> Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe FirehoseAction)
-> Parser
(Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FirehoseAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"firehose")
Parser
(Maybe IotSiteWiseAction
-> Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe IotSiteWiseAction)
-> Parser
(Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IotSiteWiseAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iotSiteWise")
Parser
(Maybe SetVariableAction
-> Maybe LambdaAction
-> Maybe IotEventsAction
-> Maybe SqsAction
-> Action)
-> Parser (Maybe SetVariableAction)
-> Parser
(Maybe LambdaAction
-> Maybe IotEventsAction -> Maybe SqsAction -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SetVariableAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"setVariable")
Parser
(Maybe LambdaAction
-> Maybe IotEventsAction -> Maybe SqsAction -> Action)
-> Parser (Maybe LambdaAction)
-> Parser (Maybe IotEventsAction -> Maybe SqsAction -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LambdaAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lambda")
Parser (Maybe IotEventsAction -> Maybe SqsAction -> Action)
-> Parser (Maybe IotEventsAction)
-> Parser (Maybe SqsAction -> Action)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IotEventsAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iotEvents")
Parser (Maybe SqsAction -> Action)
-> Parser (Maybe SqsAction) -> Parser Action
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SqsAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sqs")
)
instance Prelude.Hashable Action
instance Prelude.NFData Action
instance Core.ToJSON Action where
toJSON :: Action -> Value
toJSON Action' {Maybe ClearTimerAction
Maybe IotSiteWiseAction
Maybe LambdaAction
Maybe IotTopicPublishAction
Maybe IotEventsAction
Maybe FirehoseAction
Maybe DynamoDBv2Action
Maybe DynamoDBAction
Maybe ResetTimerAction
Maybe SNSTopicPublishAction
Maybe SetTimerAction
Maybe SetVariableAction
Maybe SqsAction
sqs :: Maybe SqsAction
iotEvents :: Maybe IotEventsAction
lambda :: Maybe LambdaAction
setVariable :: Maybe SetVariableAction
iotSiteWise :: Maybe IotSiteWiseAction
firehose :: Maybe FirehoseAction
dynamoDB :: Maybe DynamoDBAction
clearTimer :: Maybe ClearTimerAction
sns :: Maybe SNSTopicPublishAction
setTimer :: Maybe SetTimerAction
resetTimer :: Maybe ResetTimerAction
dynamoDBv2 :: Maybe DynamoDBv2Action
iotTopicPublish :: Maybe IotTopicPublishAction
$sel:sqs:Action' :: Action -> Maybe SqsAction
$sel:iotEvents:Action' :: Action -> Maybe IotEventsAction
$sel:lambda:Action' :: Action -> Maybe LambdaAction
$sel:setVariable:Action' :: Action -> Maybe SetVariableAction
$sel:iotSiteWise:Action' :: Action -> Maybe IotSiteWiseAction
$sel:firehose:Action' :: Action -> Maybe FirehoseAction
$sel:dynamoDB:Action' :: Action -> Maybe DynamoDBAction
$sel:clearTimer:Action' :: Action -> Maybe ClearTimerAction
$sel:sns:Action' :: Action -> Maybe SNSTopicPublishAction
$sel:setTimer:Action' :: Action -> Maybe SetTimerAction
$sel:resetTimer:Action' :: Action -> Maybe ResetTimerAction
$sel:dynamoDBv2:Action' :: Action -> Maybe DynamoDBv2Action
$sel:iotTopicPublish:Action' :: Action -> Maybe IotTopicPublishAction
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"iotTopicPublish" Text -> IotTopicPublishAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IotTopicPublishAction -> Pair)
-> Maybe IotTopicPublishAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotTopicPublishAction
iotTopicPublish,
(Text
"dynamoDBv2" Text -> DynamoDBv2Action -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DynamoDBv2Action -> Pair) -> Maybe DynamoDBv2Action -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DynamoDBv2Action
dynamoDBv2,
(Text
"resetTimer" Text -> ResetTimerAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResetTimerAction -> Pair) -> Maybe ResetTimerAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResetTimerAction
resetTimer,
(Text
"setTimer" Text -> SetTimerAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SetTimerAction -> Pair) -> Maybe SetTimerAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetTimerAction
setTimer,
(Text
"sns" Text -> SNSTopicPublishAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SNSTopicPublishAction -> Pair)
-> Maybe SNSTopicPublishAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SNSTopicPublishAction
sns,
(Text
"clearTimer" Text -> ClearTimerAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ClearTimerAction -> Pair) -> Maybe ClearTimerAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClearTimerAction
clearTimer,
(Text
"dynamoDB" Text -> DynamoDBAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DynamoDBAction -> Pair) -> Maybe DynamoDBAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DynamoDBAction
dynamoDB,
(Text
"firehose" Text -> FirehoseAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FirehoseAction -> Pair) -> Maybe FirehoseAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FirehoseAction
firehose,
(Text
"iotSiteWise" Text -> IotSiteWiseAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (IotSiteWiseAction -> Pair)
-> Maybe IotSiteWiseAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotSiteWiseAction
iotSiteWise,
(Text
"setVariable" Text -> SetVariableAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SetVariableAction -> Pair)
-> Maybe SetVariableAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetVariableAction
setVariable,
(Text
"lambda" Text -> LambdaAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaAction -> Pair) -> Maybe LambdaAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaAction
lambda,
(Text
"iotEvents" Text -> IotEventsAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (IotEventsAction -> Pair) -> Maybe IotEventsAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotEventsAction
iotEvents,
(Text
"sqs" Text -> SqsAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SqsAction -> Pair) -> Maybe SqsAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SqsAction
sqs
]
)