{-# 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.CloudFront.Types.LambdaFunctionAssociation where
import Amazonka.CloudFront.Types.EventType
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 LambdaFunctionAssociation = LambdaFunctionAssociation'
{
LambdaFunctionAssociation -> Maybe Bool
includeBody :: Prelude.Maybe Prelude.Bool,
LambdaFunctionAssociation -> Text
lambdaFunctionARN :: Prelude.Text,
LambdaFunctionAssociation -> EventType
eventType :: EventType
}
deriving (LambdaFunctionAssociation -> LambdaFunctionAssociation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaFunctionAssociation -> LambdaFunctionAssociation -> Bool
$c/= :: LambdaFunctionAssociation -> LambdaFunctionAssociation -> Bool
== :: LambdaFunctionAssociation -> LambdaFunctionAssociation -> Bool
$c== :: LambdaFunctionAssociation -> LambdaFunctionAssociation -> Bool
Prelude.Eq, ReadPrec [LambdaFunctionAssociation]
ReadPrec LambdaFunctionAssociation
Int -> ReadS LambdaFunctionAssociation
ReadS [LambdaFunctionAssociation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaFunctionAssociation]
$creadListPrec :: ReadPrec [LambdaFunctionAssociation]
readPrec :: ReadPrec LambdaFunctionAssociation
$creadPrec :: ReadPrec LambdaFunctionAssociation
readList :: ReadS [LambdaFunctionAssociation]
$creadList :: ReadS [LambdaFunctionAssociation]
readsPrec :: Int -> ReadS LambdaFunctionAssociation
$creadsPrec :: Int -> ReadS LambdaFunctionAssociation
Prelude.Read, Int -> LambdaFunctionAssociation -> ShowS
[LambdaFunctionAssociation] -> ShowS
LambdaFunctionAssociation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaFunctionAssociation] -> ShowS
$cshowList :: [LambdaFunctionAssociation] -> ShowS
show :: LambdaFunctionAssociation -> String
$cshow :: LambdaFunctionAssociation -> String
showsPrec :: Int -> LambdaFunctionAssociation -> ShowS
$cshowsPrec :: Int -> LambdaFunctionAssociation -> ShowS
Prelude.Show, forall x.
Rep LambdaFunctionAssociation x -> LambdaFunctionAssociation
forall x.
LambdaFunctionAssociation -> Rep LambdaFunctionAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LambdaFunctionAssociation x -> LambdaFunctionAssociation
$cfrom :: forall x.
LambdaFunctionAssociation -> Rep LambdaFunctionAssociation x
Prelude.Generic)
newLambdaFunctionAssociation ::
Prelude.Text ->
EventType ->
LambdaFunctionAssociation
newLambdaFunctionAssociation :: Text -> EventType -> LambdaFunctionAssociation
newLambdaFunctionAssociation
Text
pLambdaFunctionARN_
EventType
pEventType_ =
LambdaFunctionAssociation'
{ $sel:includeBody:LambdaFunctionAssociation' :: Maybe Bool
includeBody =
forall a. Maybe a
Prelude.Nothing,
$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: Text
lambdaFunctionARN = Text
pLambdaFunctionARN_,
$sel:eventType:LambdaFunctionAssociation' :: EventType
eventType = EventType
pEventType_
}
lambdaFunctionAssociation_includeBody :: Lens.Lens' LambdaFunctionAssociation (Prelude.Maybe Prelude.Bool)
lambdaFunctionAssociation_includeBody :: Lens' LambdaFunctionAssociation (Maybe Bool)
lambdaFunctionAssociation_includeBody = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionAssociation' {Maybe Bool
includeBody :: Maybe Bool
$sel:includeBody:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Maybe Bool
includeBody} -> Maybe Bool
includeBody) (\s :: LambdaFunctionAssociation
s@LambdaFunctionAssociation' {} Maybe Bool
a -> LambdaFunctionAssociation
s {$sel:includeBody:LambdaFunctionAssociation' :: Maybe Bool
includeBody = Maybe Bool
a} :: LambdaFunctionAssociation)
lambdaFunctionAssociation_lambdaFunctionARN :: Lens.Lens' LambdaFunctionAssociation Prelude.Text
lambdaFunctionAssociation_lambdaFunctionARN :: Lens' LambdaFunctionAssociation Text
lambdaFunctionAssociation_lambdaFunctionARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionAssociation' {Text
lambdaFunctionARN :: Text
$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Text
lambdaFunctionARN} -> Text
lambdaFunctionARN) (\s :: LambdaFunctionAssociation
s@LambdaFunctionAssociation' {} Text
a -> LambdaFunctionAssociation
s {$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: Text
lambdaFunctionARN = Text
a} :: LambdaFunctionAssociation)
lambdaFunctionAssociation_eventType :: Lens.Lens' LambdaFunctionAssociation EventType
lambdaFunctionAssociation_eventType :: Lens' LambdaFunctionAssociation EventType
lambdaFunctionAssociation_eventType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaFunctionAssociation' {EventType
eventType :: EventType
$sel:eventType:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> EventType
eventType} -> EventType
eventType) (\s :: LambdaFunctionAssociation
s@LambdaFunctionAssociation' {} EventType
a -> LambdaFunctionAssociation
s {$sel:eventType:LambdaFunctionAssociation' :: EventType
eventType = EventType
a} :: LambdaFunctionAssociation)
instance Data.FromXML LambdaFunctionAssociation where
parseXML :: [Node] -> Either String LambdaFunctionAssociation
parseXML [Node]
x =
Maybe Bool -> Text -> EventType -> LambdaFunctionAssociation
LambdaFunctionAssociation'
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
"IncludeBody")
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
"LambdaFunctionARN")
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
"EventType")
instance Prelude.Hashable LambdaFunctionAssociation where
hashWithSalt :: Int -> LambdaFunctionAssociation -> Int
hashWithSalt Int
_salt LambdaFunctionAssociation' {Maybe Bool
Text
EventType
eventType :: EventType
lambdaFunctionARN :: Text
includeBody :: Maybe Bool
$sel:eventType:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> EventType
$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Text
$sel:includeBody:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeBody
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lambdaFunctionARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EventType
eventType
instance Prelude.NFData LambdaFunctionAssociation where
rnf :: LambdaFunctionAssociation -> ()
rnf LambdaFunctionAssociation' {Maybe Bool
Text
EventType
eventType :: EventType
lambdaFunctionARN :: Text
includeBody :: Maybe Bool
$sel:eventType:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> EventType
$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Text
$sel:includeBody:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeBody
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lambdaFunctionARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EventType
eventType
instance Data.ToXML LambdaFunctionAssociation where
toXML :: LambdaFunctionAssociation -> XML
toXML LambdaFunctionAssociation' {Maybe Bool
Text
EventType
eventType :: EventType
lambdaFunctionARN :: Text
includeBody :: Maybe Bool
$sel:eventType:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> EventType
$sel:lambdaFunctionARN:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Text
$sel:includeBody:LambdaFunctionAssociation' :: LambdaFunctionAssociation -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"IncludeBody" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Bool
includeBody,
Name
"LambdaFunctionARN" forall a. ToXML a => Name -> a -> XML
Data.@= Text
lambdaFunctionARN,
Name
"EventType" forall a. ToXML a => Name -> a -> XML
Data.@= EventType
eventType
]