{-# 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.DMS.Types.EventSubscription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventSubscription = EventSubscription'
{
EventSubscription -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe Text
customerAwsId :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe Text
custSubscriptionId :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
EventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe Text
subscriptionCreationTime :: Prelude.Maybe Prelude.Text,
EventSubscription -> Maybe [Text]
eventCategoriesList :: Prelude.Maybe [Prelude.Text],
EventSubscription -> Maybe [Text]
sourceIdsList :: Prelude.Maybe [Prelude.Text]
}
deriving (EventSubscription -> EventSubscription -> Bool
(EventSubscription -> EventSubscription -> Bool)
-> (EventSubscription -> EventSubscription -> Bool)
-> Eq EventSubscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventSubscription -> EventSubscription -> Bool
$c/= :: EventSubscription -> EventSubscription -> Bool
== :: EventSubscription -> EventSubscription -> Bool
$c== :: EventSubscription -> EventSubscription -> Bool
Prelude.Eq, ReadPrec [EventSubscription]
ReadPrec EventSubscription
Int -> ReadS EventSubscription
ReadS [EventSubscription]
(Int -> ReadS EventSubscription)
-> ReadS [EventSubscription]
-> ReadPrec EventSubscription
-> ReadPrec [EventSubscription]
-> Read EventSubscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventSubscription]
$creadListPrec :: ReadPrec [EventSubscription]
readPrec :: ReadPrec EventSubscription
$creadPrec :: ReadPrec EventSubscription
readList :: ReadS [EventSubscription]
$creadList :: ReadS [EventSubscription]
readsPrec :: Int -> ReadS EventSubscription
$creadsPrec :: Int -> ReadS EventSubscription
Prelude.Read, Int -> EventSubscription -> ShowS
[EventSubscription] -> ShowS
EventSubscription -> String
(Int -> EventSubscription -> ShowS)
-> (EventSubscription -> String)
-> ([EventSubscription] -> ShowS)
-> Show EventSubscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventSubscription] -> ShowS
$cshowList :: [EventSubscription] -> ShowS
show :: EventSubscription -> String
$cshow :: EventSubscription -> String
showsPrec :: Int -> EventSubscription -> ShowS
$cshowsPrec :: Int -> EventSubscription -> ShowS
Prelude.Show, (forall x. EventSubscription -> Rep EventSubscription x)
-> (forall x. Rep EventSubscription x -> EventSubscription)
-> Generic EventSubscription
forall x. Rep EventSubscription x -> EventSubscription
forall x. EventSubscription -> Rep EventSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventSubscription x -> EventSubscription
$cfrom :: forall x. EventSubscription -> Rep EventSubscription x
Prelude.Generic)
newEventSubscription ::
EventSubscription
newEventSubscription :: EventSubscription
newEventSubscription =
EventSubscription' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription
EventSubscription'
{ $sel:status:EventSubscription' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:customerAwsId:EventSubscription' :: Maybe Text
customerAwsId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:custSubscriptionId:EventSubscription' :: Maybe Text
custSubscriptionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snsTopicArn:EventSubscription' :: Maybe Text
snsTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:EventSubscription' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sourceType:EventSubscription' :: Maybe Text
sourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subscriptionCreationTime:EventSubscription' :: Maybe Text
subscriptionCreationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventCategoriesList:EventSubscription' :: Maybe [Text]
eventCategoriesList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:sourceIdsList:EventSubscription' :: Maybe [Text]
sourceIdsList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
eventSubscription_status :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_status :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_status = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
status :: Maybe Text
$sel:status:EventSubscription' :: EventSubscription -> Maybe Text
status} -> Maybe Text
status) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:status:EventSubscription' :: Maybe Text
status = Maybe Text
a} :: EventSubscription)
eventSubscription_customerAwsId :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_customerAwsId :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_customerAwsId = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
customerAwsId :: Maybe Text
$sel:customerAwsId:EventSubscription' :: EventSubscription -> Maybe Text
customerAwsId} -> Maybe Text
customerAwsId) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:customerAwsId:EventSubscription' :: Maybe Text
customerAwsId = Maybe Text
a} :: EventSubscription)
eventSubscription_custSubscriptionId :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_custSubscriptionId :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_custSubscriptionId = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
custSubscriptionId :: Maybe Text
$sel:custSubscriptionId:EventSubscription' :: EventSubscription -> Maybe Text
custSubscriptionId} -> Maybe Text
custSubscriptionId) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:custSubscriptionId:EventSubscription' :: Maybe Text
custSubscriptionId = Maybe Text
a} :: EventSubscription)
eventSubscription_snsTopicArn :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_snsTopicArn = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:EventSubscription' :: EventSubscription -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:snsTopicArn:EventSubscription' :: Maybe Text
snsTopicArn = Maybe Text
a} :: EventSubscription)
eventSubscription_enabled :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Bool)
eventSubscription_enabled :: (Maybe Bool -> f (Maybe Bool))
-> EventSubscription -> f EventSubscription
eventSubscription_enabled = (EventSubscription -> Maybe Bool)
-> (EventSubscription -> Maybe Bool -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EventSubscription' :: EventSubscription -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: EventSubscription
s@EventSubscription' {} Maybe Bool
a -> EventSubscription
s {$sel:enabled:EventSubscription' :: Maybe Bool
enabled = Maybe Bool
a} :: EventSubscription)
eventSubscription_sourceType :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_sourceType :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_sourceType = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:EventSubscription' :: EventSubscription -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:sourceType:EventSubscription' :: Maybe Text
sourceType = Maybe Text
a} :: EventSubscription)
eventSubscription_subscriptionCreationTime :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_subscriptionCreationTime :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_subscriptionCreationTime = (EventSubscription -> Maybe Text)
-> (EventSubscription -> Maybe Text -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe Text
subscriptionCreationTime :: Maybe Text
$sel:subscriptionCreationTime:EventSubscription' :: EventSubscription -> Maybe Text
subscriptionCreationTime} -> Maybe Text
subscriptionCreationTime) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:subscriptionCreationTime:EventSubscription' :: Maybe Text
subscriptionCreationTime = Maybe Text
a} :: EventSubscription)
eventSubscription_eventCategoriesList :: Lens.Lens' EventSubscription (Prelude.Maybe [Prelude.Text])
eventSubscription_eventCategoriesList :: (Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription -> f EventSubscription
eventSubscription_eventCategoriesList = (EventSubscription -> Maybe [Text])
-> (EventSubscription -> Maybe [Text] -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe [Text]
eventCategoriesList :: Maybe [Text]
$sel:eventCategoriesList:EventSubscription' :: EventSubscription -> Maybe [Text]
eventCategoriesList} -> Maybe [Text]
eventCategoriesList) (\s :: EventSubscription
s@EventSubscription' {} Maybe [Text]
a -> EventSubscription
s {$sel:eventCategoriesList:EventSubscription' :: Maybe [Text]
eventCategoriesList = Maybe [Text]
a} :: EventSubscription) ((Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription -> f EventSubscription)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription
-> f EventSubscription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
eventSubscription_sourceIdsList :: Lens.Lens' EventSubscription (Prelude.Maybe [Prelude.Text])
eventSubscription_sourceIdsList :: (Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription -> f EventSubscription
eventSubscription_sourceIdsList = (EventSubscription -> Maybe [Text])
-> (EventSubscription -> Maybe [Text] -> EventSubscription)
-> Lens
EventSubscription EventSubscription (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe [Text]
sourceIdsList :: Maybe [Text]
$sel:sourceIdsList:EventSubscription' :: EventSubscription -> Maybe [Text]
sourceIdsList} -> Maybe [Text]
sourceIdsList) (\s :: EventSubscription
s@EventSubscription' {} Maybe [Text]
a -> EventSubscription
s {$sel:sourceIdsList:EventSubscription' :: Maybe [Text]
sourceIdsList = Maybe [Text]
a} :: EventSubscription) ((Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription -> f EventSubscription)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EventSubscription
-> f EventSubscription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON EventSubscription where
parseJSON :: Value -> Parser EventSubscription
parseJSON =
String
-> (Object -> Parser EventSubscription)
-> Value
-> Parser EventSubscription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventSubscription"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription
EventSubscription'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomerAwsId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustSubscriptionId")
Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnsTopicArn")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> EventSubscription)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
Parser
(Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceType")
Parser
(Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubscriptionCreationTime")
Parser (Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventCategoriesList"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [Text] -> EventSubscription)
-> Parser (Maybe [Text]) -> Parser EventSubscription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceIdsList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable EventSubscription
instance Prelude.NFData EventSubscription