{-# 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.RDS.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.RDS.Types.EventSubscription where

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

-- | Contains the results of a successful invocation of the
-- @DescribeEventSubscriptions@ action.
--
-- /See:/ 'newEventSubscription' smart constructor.
data EventSubscription = EventSubscription'
  { -- | The status of the RDS 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 RDS 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 RDS event
    -- notification subscription.
    EventSubscription -> Maybe Text
customerAwsId :: Prelude.Maybe Prelude.Text,
    -- | The RDS event notification subscription Id.
    EventSubscription -> Maybe Text
custSubscriptionId :: Prelude.Maybe Prelude.Text,
    -- | The topic ARN of the RDS event notification subscription.
    EventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the event subscription.
    EventSubscription -> Maybe Text
eventSubscriptionArn :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating if the subscription is enabled. True
    -- indicates the subscription is enabled.
    EventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The source type for the RDS event notification subscription.
    EventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | The time the RDS event notification subscription was created.
    EventSubscription -> Maybe Text
subscriptionCreationTime :: Prelude.Maybe Prelude.Text,
    -- | A list of event categories for the RDS event notification subscription.
    EventSubscription -> Maybe [Text]
eventCategoriesList :: Prelude.Maybe [Prelude.Text],
    -- | A list of source IDs for the RDS event notification 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 RDS 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 RDS 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 RDS event
-- notification subscription.
--
-- 'custSubscriptionId', 'eventSubscription_custSubscriptionId' - The RDS event notification subscription Id.
--
-- 'snsTopicArn', 'eventSubscription_snsTopicArn' - The topic ARN of the RDS event notification subscription.
--
-- 'eventSubscriptionArn', 'eventSubscription_eventSubscriptionArn' - The Amazon Resource Name (ARN) for the event subscription.
--
-- 'enabled', 'eventSubscription_enabled' - A Boolean value indicating if the subscription is enabled. True
-- indicates the subscription is enabled.
--
-- 'sourceType', 'eventSubscription_sourceType' - The source type for the RDS event notification subscription.
--
-- 'subscriptionCreationTime', 'eventSubscription_subscriptionCreationTime' - The time the RDS event notification subscription was created.
--
-- 'eventCategoriesList', 'eventSubscription_eventCategoriesList' - A list of event categories for the RDS event notification subscription.
--
-- 'sourceIdsList', 'eventSubscription_sourceIdsList' - A list of source IDs for the RDS event notification subscription.
newEventSubscription ::
  EventSubscription
newEventSubscription :: EventSubscription
newEventSubscription =
  EventSubscription' :: Maybe Text
-> 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:eventSubscriptionArn:EventSubscription' :: Maybe Text
eventSubscriptionArn = 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 RDS 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 RDS 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 RDS 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 RDS 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 RDS 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)

-- | The Amazon Resource Name (ARN) for the event subscription.
eventSubscription_eventSubscriptionArn :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_eventSubscriptionArn :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_eventSubscriptionArn = (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
eventSubscriptionArn :: Maybe Text
$sel:eventSubscriptionArn:EventSubscription' :: EventSubscription -> Maybe Text
eventSubscriptionArn} -> Maybe Text
eventSubscriptionArn) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:eventSubscriptionArn:EventSubscription' :: Maybe Text
eventSubscriptionArn = Maybe Text
a} :: EventSubscription)

-- | A Boolean value indicating if the subscription is enabled. True
-- indicates the 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 source type for the RDS event notification subscription.
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 RDS 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 list of event categories for the RDS event notification subscription.
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 RDS event notification 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.FromXML EventSubscription where
  parseXML :: [Node] -> Either String EventSubscription
parseXML [Node]
x =
    Maybe Text
-> 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 Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe [Text]
 -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> 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.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> 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.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CustomerAwsId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (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.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CustSubscriptionId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (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.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SnsTopicArn")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (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.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EventSubscriptionArn")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Enabled")
      Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceType")
      Either
  String
  (Maybe Text -> Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SubscriptionCreationTime")
      Either String (Maybe [Text] -> Maybe [Text] -> EventSubscription)
-> Either String (Maybe [Text])
-> Either String (Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EventCategoriesList"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"EventCategory")
                  )
      Either String (Maybe [Text] -> EventSubscription)
-> Either String (Maybe [Text]) -> Either String EventSubscription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceIdsList" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"SourceId")
                  )

instance Prelude.Hashable EventSubscription

instance Prelude.NFData EventSubscription