{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DMS.Types.EventSubscription
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DMS.Types.EventSubscription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an event notification subscription created by the
-- @CreateEventSubscription@ operation.
--
-- /See:/ 'newEventSubscription' smart constructor.
data EventSubscription = EventSubscription'
  { -- | The status of the DMS event notification subscription.
    --
    -- Constraints:
    --
    -- Can be one of the following: creating | modifying | deleting | active |
    -- no-permission | topic-not-exist
    --
    -- The status \"no-permission\" indicates that DMS no longer has permission
    -- to post to the SNS topic. The status \"topic-not-exist\" indicates that
    -- the topic was deleted after the subscription was created.
    EventSubscription -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services customer account associated with the DMS event
    -- notification subscription.
    EventSubscription -> Maybe Text
customerAwsId :: Prelude.Maybe Prelude.Text,
    -- | The DMS event notification subscription Id.
    EventSubscription -> Maybe Text
custSubscriptionId :: Prelude.Maybe Prelude.Text,
    -- | The topic ARN of the DMS event notification subscription.
    EventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | Boolean value that indicates if the event subscription is enabled.
    EventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The type of DMS resource that generates events.
    --
    -- Valid values: replication-instance | replication-server | security-group
    -- | replication-task
    EventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | The time the DMS event notification subscription was created.
    EventSubscription -> Maybe Text
subscriptionCreationTime :: Prelude.Maybe Prelude.Text,
    -- | A lists of event categories.
    EventSubscription -> Maybe [Text]
eventCategoriesList :: Prelude.Maybe [Prelude.Text],
    -- | A list of source Ids for the event subscription.
    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)

-- |
-- Create a value of 'EventSubscription' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'eventSubscription_status' - The status of the DMS event notification subscription.
--
-- Constraints:
--
-- Can be one of the following: creating | modifying | deleting | active |
-- no-permission | topic-not-exist
--
-- The status \"no-permission\" indicates that DMS no longer has permission
-- to post to the SNS topic. The status \"topic-not-exist\" indicates that
-- the topic was deleted after the subscription was created.
--
-- 'customerAwsId', 'eventSubscription_customerAwsId' - The Amazon Web Services customer account associated with the DMS event
-- notification subscription.
--
-- 'custSubscriptionId', 'eventSubscription_custSubscriptionId' - The DMS event notification subscription Id.
--
-- 'snsTopicArn', 'eventSubscription_snsTopicArn' - The topic ARN of the DMS event notification subscription.
--
-- 'enabled', 'eventSubscription_enabled' - Boolean value that indicates if the event subscription is enabled.
--
-- 'sourceType', 'eventSubscription_sourceType' - The type of DMS resource that generates events.
--
-- Valid values: replication-instance | replication-server | security-group
-- | replication-task
--
-- 'subscriptionCreationTime', 'eventSubscription_subscriptionCreationTime' - The time the DMS event notification subscription was created.
--
-- 'eventCategoriesList', 'eventSubscription_eventCategoriesList' - A lists of event categories.
--
-- 'sourceIdsList', 'eventSubscription_sourceIdsList' - A list of source Ids for the event subscription.
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
    }

-- | The status of the DMS event notification subscription.
--
-- Constraints:
--
-- Can be one of the following: creating | modifying | deleting | active |
-- no-permission | topic-not-exist
--
-- The status \"no-permission\" indicates that DMS no longer has permission
-- to post to the SNS topic. The status \"topic-not-exist\" indicates that
-- the topic was deleted after the subscription was created.
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)

-- | The Amazon Web Services customer account associated with the DMS event
-- notification subscription.
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)

-- | The DMS event notification subscription Id.
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)

-- | The topic ARN of the DMS event notification subscription.
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)

-- | Boolean value that indicates if the event subscription is enabled.
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)

-- | The type of DMS resource that generates events.
--
-- Valid values: replication-instance | replication-server | security-group
-- | replication-task
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)

-- | The time the DMS event notification subscription was created.
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)

-- | A lists of event categories.
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

-- | A list of source Ids for the event subscription.
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