{-# 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.SES.Types.LambdaAction 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
import Amazonka.SES.Types.InvocationType
data LambdaAction = LambdaAction'
{
LambdaAction -> Maybe InvocationType
invocationType :: Prelude.Maybe InvocationType,
LambdaAction -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
LambdaAction -> Text
functionArn :: Prelude.Text
}
deriving (LambdaAction -> LambdaAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaAction -> LambdaAction -> Bool
$c/= :: LambdaAction -> LambdaAction -> Bool
== :: LambdaAction -> LambdaAction -> Bool
$c== :: LambdaAction -> LambdaAction -> Bool
Prelude.Eq, ReadPrec [LambdaAction]
ReadPrec LambdaAction
Int -> ReadS LambdaAction
ReadS [LambdaAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaAction]
$creadListPrec :: ReadPrec [LambdaAction]
readPrec :: ReadPrec LambdaAction
$creadPrec :: ReadPrec LambdaAction
readList :: ReadS [LambdaAction]
$creadList :: ReadS [LambdaAction]
readsPrec :: Int -> ReadS LambdaAction
$creadsPrec :: Int -> ReadS LambdaAction
Prelude.Read, Int -> LambdaAction -> ShowS
[LambdaAction] -> ShowS
LambdaAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaAction] -> ShowS
$cshowList :: [LambdaAction] -> ShowS
show :: LambdaAction -> String
$cshow :: LambdaAction -> String
showsPrec :: Int -> LambdaAction -> ShowS
$cshowsPrec :: Int -> LambdaAction -> ShowS
Prelude.Show, forall x. Rep LambdaAction x -> LambdaAction
forall x. LambdaAction -> Rep LambdaAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaAction x -> LambdaAction
$cfrom :: forall x. LambdaAction -> Rep LambdaAction x
Prelude.Generic)
newLambdaAction ::
Prelude.Text ->
LambdaAction
newLambdaAction :: Text -> LambdaAction
newLambdaAction Text
pFunctionArn_ =
LambdaAction'
{ $sel:invocationType:LambdaAction' :: Maybe InvocationType
invocationType = forall a. Maybe a
Prelude.Nothing,
$sel:topicArn:LambdaAction' :: Maybe Text
topicArn = forall a. Maybe a
Prelude.Nothing,
$sel:functionArn:LambdaAction' :: Text
functionArn = Text
pFunctionArn_
}
lambdaAction_invocationType :: Lens.Lens' LambdaAction (Prelude.Maybe InvocationType)
lambdaAction_invocationType :: Lens' LambdaAction (Maybe InvocationType)
lambdaAction_invocationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaAction' {Maybe InvocationType
invocationType :: Maybe InvocationType
$sel:invocationType:LambdaAction' :: LambdaAction -> Maybe InvocationType
invocationType} -> Maybe InvocationType
invocationType) (\s :: LambdaAction
s@LambdaAction' {} Maybe InvocationType
a -> LambdaAction
s {$sel:invocationType:LambdaAction' :: Maybe InvocationType
invocationType = Maybe InvocationType
a} :: LambdaAction)
lambdaAction_topicArn :: Lens.Lens' LambdaAction (Prelude.Maybe Prelude.Text)
lambdaAction_topicArn :: Lens' LambdaAction (Maybe Text)
lambdaAction_topicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaAction' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:LambdaAction' :: LambdaAction -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: LambdaAction
s@LambdaAction' {} Maybe Text
a -> LambdaAction
s {$sel:topicArn:LambdaAction' :: Maybe Text
topicArn = Maybe Text
a} :: LambdaAction)
lambdaAction_functionArn :: Lens.Lens' LambdaAction Prelude.Text
lambdaAction_functionArn :: Lens' LambdaAction Text
lambdaAction_functionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaAction' {Text
functionArn :: Text
$sel:functionArn:LambdaAction' :: LambdaAction -> Text
functionArn} -> Text
functionArn) (\s :: LambdaAction
s@LambdaAction' {} Text
a -> LambdaAction
s {$sel:functionArn:LambdaAction' :: Text
functionArn = Text
a} :: LambdaAction)
instance Data.FromXML LambdaAction where
parseXML :: [Node] -> Either String LambdaAction
parseXML [Node]
x =
Maybe InvocationType -> Maybe Text -> Text -> LambdaAction
LambdaAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"InvocationType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"FunctionArn")
instance Prelude.Hashable LambdaAction where
hashWithSalt :: Int -> LambdaAction -> Int
hashWithSalt Int
_salt LambdaAction' {Maybe Text
Maybe InvocationType
Text
functionArn :: Text
topicArn :: Maybe Text
invocationType :: Maybe InvocationType
$sel:functionArn:LambdaAction' :: LambdaAction -> Text
$sel:topicArn:LambdaAction' :: LambdaAction -> Maybe Text
$sel:invocationType:LambdaAction' :: LambdaAction -> Maybe InvocationType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InvocationType
invocationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionArn
instance Prelude.NFData LambdaAction where
rnf :: LambdaAction -> ()
rnf LambdaAction' {Maybe Text
Maybe InvocationType
Text
functionArn :: Text
topicArn :: Maybe Text
invocationType :: Maybe InvocationType
$sel:functionArn:LambdaAction' :: LambdaAction -> Text
$sel:topicArn:LambdaAction' :: LambdaAction -> Maybe Text
$sel:invocationType:LambdaAction' :: LambdaAction -> Maybe InvocationType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe InvocationType
invocationType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionArn
instance Data.ToQuery LambdaAction where
toQuery :: LambdaAction -> QueryString
toQuery LambdaAction' {Maybe Text
Maybe InvocationType
Text
functionArn :: Text
topicArn :: Maybe Text
invocationType :: Maybe InvocationType
$sel:functionArn:LambdaAction' :: LambdaAction -> Text
$sel:topicArn:LambdaAction' :: LambdaAction -> Maybe Text
$sel:invocationType:LambdaAction' :: LambdaAction -> Maybe InvocationType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"InvocationType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe InvocationType
invocationType,
ByteString
"TopicArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
topicArn,
ByteString
"FunctionArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
functionArn
]