{-# 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.PinpointEmail.Types.EventDestinationDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types.CloudWatchDestination
import Amazonka.PinpointEmail.Types.EventType
import Amazonka.PinpointEmail.Types.KinesisFirehoseDestination
import Amazonka.PinpointEmail.Types.PinpointDestination
import Amazonka.PinpointEmail.Types.SnsDestination
import qualified Amazonka.Prelude as Prelude
data EventDestinationDefinition = EventDestinationDefinition'
{
EventDestinationDefinition -> Maybe [EventType]
matchingEventTypes :: Prelude.Maybe [EventType],
EventDestinationDefinition -> Maybe PinpointDestination
pinpointDestination :: Prelude.Maybe PinpointDestination,
EventDestinationDefinition -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
EventDestinationDefinition -> Maybe KinesisFirehoseDestination
kinesisFirehoseDestination :: Prelude.Maybe KinesisFirehoseDestination,
EventDestinationDefinition -> Maybe CloudWatchDestination
cloudWatchDestination :: Prelude.Maybe CloudWatchDestination,
EventDestinationDefinition -> Maybe SnsDestination
snsDestination :: Prelude.Maybe SnsDestination
}
deriving (EventDestinationDefinition -> EventDestinationDefinition -> Bool
(EventDestinationDefinition -> EventDestinationDefinition -> Bool)
-> (EventDestinationDefinition
-> EventDestinationDefinition -> Bool)
-> Eq EventDestinationDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventDestinationDefinition -> EventDestinationDefinition -> Bool
$c/= :: EventDestinationDefinition -> EventDestinationDefinition -> Bool
== :: EventDestinationDefinition -> EventDestinationDefinition -> Bool
$c== :: EventDestinationDefinition -> EventDestinationDefinition -> Bool
Prelude.Eq, ReadPrec [EventDestinationDefinition]
ReadPrec EventDestinationDefinition
Int -> ReadS EventDestinationDefinition
ReadS [EventDestinationDefinition]
(Int -> ReadS EventDestinationDefinition)
-> ReadS [EventDestinationDefinition]
-> ReadPrec EventDestinationDefinition
-> ReadPrec [EventDestinationDefinition]
-> Read EventDestinationDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventDestinationDefinition]
$creadListPrec :: ReadPrec [EventDestinationDefinition]
readPrec :: ReadPrec EventDestinationDefinition
$creadPrec :: ReadPrec EventDestinationDefinition
readList :: ReadS [EventDestinationDefinition]
$creadList :: ReadS [EventDestinationDefinition]
readsPrec :: Int -> ReadS EventDestinationDefinition
$creadsPrec :: Int -> ReadS EventDestinationDefinition
Prelude.Read, Int -> EventDestinationDefinition -> ShowS
[EventDestinationDefinition] -> ShowS
EventDestinationDefinition -> String
(Int -> EventDestinationDefinition -> ShowS)
-> (EventDestinationDefinition -> String)
-> ([EventDestinationDefinition] -> ShowS)
-> Show EventDestinationDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventDestinationDefinition] -> ShowS
$cshowList :: [EventDestinationDefinition] -> ShowS
show :: EventDestinationDefinition -> String
$cshow :: EventDestinationDefinition -> String
showsPrec :: Int -> EventDestinationDefinition -> ShowS
$cshowsPrec :: Int -> EventDestinationDefinition -> ShowS
Prelude.Show, (forall x.
EventDestinationDefinition -> Rep EventDestinationDefinition x)
-> (forall x.
Rep EventDestinationDefinition x -> EventDestinationDefinition)
-> Generic EventDestinationDefinition
forall x.
Rep EventDestinationDefinition x -> EventDestinationDefinition
forall x.
EventDestinationDefinition -> Rep EventDestinationDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EventDestinationDefinition x -> EventDestinationDefinition
$cfrom :: forall x.
EventDestinationDefinition -> Rep EventDestinationDefinition x
Prelude.Generic)
newEventDestinationDefinition ::
EventDestinationDefinition
newEventDestinationDefinition :: EventDestinationDefinition
newEventDestinationDefinition =
EventDestinationDefinition' :: Maybe [EventType]
-> Maybe PinpointDestination
-> Maybe Bool
-> Maybe KinesisFirehoseDestination
-> Maybe CloudWatchDestination
-> Maybe SnsDestination
-> EventDestinationDefinition
EventDestinationDefinition'
{ $sel:matchingEventTypes:EventDestinationDefinition' :: Maybe [EventType]
matchingEventTypes =
Maybe [EventType]
forall a. Maybe a
Prelude.Nothing,
$sel:pinpointDestination:EventDestinationDefinition' :: Maybe PinpointDestination
pinpointDestination = Maybe PinpointDestination
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:EventDestinationDefinition' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisFirehoseDestination:EventDestinationDefinition' :: Maybe KinesisFirehoseDestination
kinesisFirehoseDestination = Maybe KinesisFirehoseDestination
forall a. Maybe a
Prelude.Nothing,
$sel:cloudWatchDestination:EventDestinationDefinition' :: Maybe CloudWatchDestination
cloudWatchDestination = Maybe CloudWatchDestination
forall a. Maybe a
Prelude.Nothing,
$sel:snsDestination:EventDestinationDefinition' :: Maybe SnsDestination
snsDestination = Maybe SnsDestination
forall a. Maybe a
Prelude.Nothing
}
eventDestinationDefinition_matchingEventTypes :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe [EventType])
eventDestinationDefinition_matchingEventTypes :: (Maybe [EventType] -> f (Maybe [EventType]))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_matchingEventTypes = (EventDestinationDefinition -> Maybe [EventType])
-> (EventDestinationDefinition
-> Maybe [EventType] -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe [EventType])
(Maybe [EventType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe [EventType]
matchingEventTypes :: Maybe [EventType]
$sel:matchingEventTypes:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe [EventType]
matchingEventTypes} -> Maybe [EventType]
matchingEventTypes) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe [EventType]
a -> EventDestinationDefinition
s {$sel:matchingEventTypes:EventDestinationDefinition' :: Maybe [EventType]
matchingEventTypes = Maybe [EventType]
a} :: EventDestinationDefinition) ((Maybe [EventType] -> f (Maybe [EventType]))
-> EventDestinationDefinition -> f EventDestinationDefinition)
-> ((Maybe [EventType] -> f (Maybe [EventType]))
-> Maybe [EventType] -> f (Maybe [EventType]))
-> (Maybe [EventType] -> f (Maybe [EventType]))
-> EventDestinationDefinition
-> f EventDestinationDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EventType] [EventType] [EventType] [EventType]
-> Iso
(Maybe [EventType])
(Maybe [EventType])
(Maybe [EventType])
(Maybe [EventType])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [EventType] [EventType] [EventType] [EventType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
eventDestinationDefinition_pinpointDestination :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe PinpointDestination)
eventDestinationDefinition_pinpointDestination :: (Maybe PinpointDestination -> f (Maybe PinpointDestination))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_pinpointDestination = (EventDestinationDefinition -> Maybe PinpointDestination)
-> (EventDestinationDefinition
-> Maybe PinpointDestination -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe PinpointDestination)
(Maybe PinpointDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe PinpointDestination
pinpointDestination :: Maybe PinpointDestination
$sel:pinpointDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe PinpointDestination
pinpointDestination} -> Maybe PinpointDestination
pinpointDestination) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe PinpointDestination
a -> EventDestinationDefinition
s {$sel:pinpointDestination:EventDestinationDefinition' :: Maybe PinpointDestination
pinpointDestination = Maybe PinpointDestination
a} :: EventDestinationDefinition)
eventDestinationDefinition_enabled :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe Prelude.Bool)
eventDestinationDefinition_enabled :: (Maybe Bool -> f (Maybe Bool))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_enabled = (EventDestinationDefinition -> Maybe Bool)
-> (EventDestinationDefinition
-> Maybe Bool -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe Bool
a -> EventDestinationDefinition
s {$sel:enabled:EventDestinationDefinition' :: Maybe Bool
enabled = Maybe Bool
a} :: EventDestinationDefinition)
eventDestinationDefinition_kinesisFirehoseDestination :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe KinesisFirehoseDestination)
eventDestinationDefinition_kinesisFirehoseDestination :: (Maybe KinesisFirehoseDestination
-> f (Maybe KinesisFirehoseDestination))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_kinesisFirehoseDestination = (EventDestinationDefinition -> Maybe KinesisFirehoseDestination)
-> (EventDestinationDefinition
-> Maybe KinesisFirehoseDestination -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe KinesisFirehoseDestination)
(Maybe KinesisFirehoseDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe KinesisFirehoseDestination
kinesisFirehoseDestination :: Maybe KinesisFirehoseDestination
$sel:kinesisFirehoseDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe KinesisFirehoseDestination
kinesisFirehoseDestination} -> Maybe KinesisFirehoseDestination
kinesisFirehoseDestination) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe KinesisFirehoseDestination
a -> EventDestinationDefinition
s {$sel:kinesisFirehoseDestination:EventDestinationDefinition' :: Maybe KinesisFirehoseDestination
kinesisFirehoseDestination = Maybe KinesisFirehoseDestination
a} :: EventDestinationDefinition)
eventDestinationDefinition_cloudWatchDestination :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe CloudWatchDestination)
eventDestinationDefinition_cloudWatchDestination :: (Maybe CloudWatchDestination -> f (Maybe CloudWatchDestination))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_cloudWatchDestination = (EventDestinationDefinition -> Maybe CloudWatchDestination)
-> (EventDestinationDefinition
-> Maybe CloudWatchDestination -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe CloudWatchDestination)
(Maybe CloudWatchDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe CloudWatchDestination
cloudWatchDestination :: Maybe CloudWatchDestination
$sel:cloudWatchDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe CloudWatchDestination
cloudWatchDestination} -> Maybe CloudWatchDestination
cloudWatchDestination) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe CloudWatchDestination
a -> EventDestinationDefinition
s {$sel:cloudWatchDestination:EventDestinationDefinition' :: Maybe CloudWatchDestination
cloudWatchDestination = Maybe CloudWatchDestination
a} :: EventDestinationDefinition)
eventDestinationDefinition_snsDestination :: Lens.Lens' EventDestinationDefinition (Prelude.Maybe SnsDestination)
eventDestinationDefinition_snsDestination :: (Maybe SnsDestination -> f (Maybe SnsDestination))
-> EventDestinationDefinition -> f EventDestinationDefinition
eventDestinationDefinition_snsDestination = (EventDestinationDefinition -> Maybe SnsDestination)
-> (EventDestinationDefinition
-> Maybe SnsDestination -> EventDestinationDefinition)
-> Lens
EventDestinationDefinition
EventDestinationDefinition
(Maybe SnsDestination)
(Maybe SnsDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDestinationDefinition' {Maybe SnsDestination
snsDestination :: Maybe SnsDestination
$sel:snsDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe SnsDestination
snsDestination} -> Maybe SnsDestination
snsDestination) (\s :: EventDestinationDefinition
s@EventDestinationDefinition' {} Maybe SnsDestination
a -> EventDestinationDefinition
s {$sel:snsDestination:EventDestinationDefinition' :: Maybe SnsDestination
snsDestination = Maybe SnsDestination
a} :: EventDestinationDefinition)
instance Prelude.Hashable EventDestinationDefinition
instance Prelude.NFData EventDestinationDefinition
instance Core.ToJSON EventDestinationDefinition where
toJSON :: EventDestinationDefinition -> Value
toJSON EventDestinationDefinition' {Maybe Bool
Maybe [EventType]
Maybe CloudWatchDestination
Maybe KinesisFirehoseDestination
Maybe PinpointDestination
Maybe SnsDestination
snsDestination :: Maybe SnsDestination
cloudWatchDestination :: Maybe CloudWatchDestination
kinesisFirehoseDestination :: Maybe KinesisFirehoseDestination
enabled :: Maybe Bool
pinpointDestination :: Maybe PinpointDestination
matchingEventTypes :: Maybe [EventType]
$sel:snsDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe SnsDestination
$sel:cloudWatchDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe CloudWatchDestination
$sel:kinesisFirehoseDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe KinesisFirehoseDestination
$sel:enabled:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe Bool
$sel:pinpointDestination:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe PinpointDestination
$sel:matchingEventTypes:EventDestinationDefinition' :: EventDestinationDefinition -> Maybe [EventType]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MatchingEventTypes" Text -> [EventType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([EventType] -> Pair) -> Maybe [EventType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EventType]
matchingEventTypes,
(Text
"PinpointDestination" Text -> PinpointDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PinpointDestination -> Pair)
-> Maybe PinpointDestination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PinpointDestination
pinpointDestination,
(Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
(Text
"KinesisFirehoseDestination" Text -> KinesisFirehoseDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisFirehoseDestination -> Pair)
-> Maybe KinesisFirehoseDestination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisFirehoseDestination
kinesisFirehoseDestination,
(Text
"CloudWatchDestination" Text -> CloudWatchDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CloudWatchDestination -> Pair)
-> Maybe CloudWatchDestination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchDestination
cloudWatchDestination,
(Text
"SnsDestination" Text -> SnsDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SnsDestination -> Pair) -> Maybe SnsDestination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SnsDestination
snsDestination
]
)