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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
import Amazonka.Redshift.Types.Tag

-- | Describes event subscriptions.
--
-- /See:/ 'newEventSubscription' smart constructor.
data EventSubscription = EventSubscription'
  { -- | The status of the Amazon Redshift event notification subscription.
    --
    -- Constraints:
    --
    -- -   Can be one of the following: active | no-permission |
    --     topic-not-exist
    --
    -- -   The status \"no-permission\" indicates that Amazon Redshift no
    --     longer has permission to post to the Amazon 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 account associated with the Amazon Redshift
    -- event notification subscription.
    EventSubscription -> Maybe Text
customerAwsId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Redshift event notification subscription.
    EventSubscription -> Maybe Text
custSubscriptionId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon SNS topic used by the event
    -- notification subscription.
    EventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | A boolean value indicating whether the subscription is enabled; @true@
    -- indicates that the subscription is enabled.
    EventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The source type of the events returned by the Amazon Redshift event
    -- notification, such as cluster, cluster-snapshot,
    -- cluster-parameter-group, cluster-security-group, or scheduled-action.
    EventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | The event severity specified in the Amazon Redshift event notification
    -- subscription.
    --
    -- Values: ERROR, INFO
    EventSubscription -> Maybe Text
severity :: Prelude.Maybe Prelude.Text,
    -- | The date and time the Amazon Redshift event notification subscription
    -- was created.
    EventSubscription -> Maybe ISO8601
subscriptionCreationTime :: Prelude.Maybe Core.ISO8601,
    -- | The list of Amazon Redshift event categories specified in the event
    -- notification subscription.
    --
    -- Values: Configuration, Management, Monitoring, Security, Pending
    EventSubscription -> Maybe [Text]
eventCategoriesList :: Prelude.Maybe [Prelude.Text],
    -- | The list of tags for the event subscription.
    EventSubscription -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A list of the sources that publish events to the Amazon Redshift 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 Amazon Redshift event notification subscription.
--
-- Constraints:
--
-- -   Can be one of the following: active | no-permission |
--     topic-not-exist
--
-- -   The status \"no-permission\" indicates that Amazon Redshift no
--     longer has permission to post to the Amazon 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 account associated with the Amazon Redshift
-- event notification subscription.
--
-- 'custSubscriptionId', 'eventSubscription_custSubscriptionId' - The name of the Amazon Redshift event notification subscription.
--
-- 'snsTopicArn', 'eventSubscription_snsTopicArn' - The Amazon Resource Name (ARN) of the Amazon SNS topic used by the event
-- notification subscription.
--
-- 'enabled', 'eventSubscription_enabled' - A boolean value indicating whether the subscription is enabled; @true@
-- indicates that the subscription is enabled.
--
-- 'sourceType', 'eventSubscription_sourceType' - The source type of the events returned by the Amazon Redshift event
-- notification, such as cluster, cluster-snapshot,
-- cluster-parameter-group, cluster-security-group, or scheduled-action.
--
-- 'severity', 'eventSubscription_severity' - The event severity specified in the Amazon Redshift event notification
-- subscription.
--
-- Values: ERROR, INFO
--
-- 'subscriptionCreationTime', 'eventSubscription_subscriptionCreationTime' - The date and time the Amazon Redshift event notification subscription
-- was created.
--
-- 'eventCategoriesList', 'eventSubscription_eventCategoriesList' - The list of Amazon Redshift event categories specified in the event
-- notification subscription.
--
-- Values: Configuration, Management, Monitoring, Security, Pending
--
-- 'tags', 'eventSubscription_tags' - The list of tags for the event subscription.
--
-- 'sourceIdsList', 'eventSubscription_sourceIdsList' - A list of the sources that publish events to the Amazon Redshift event
-- notification subscription.
newEventSubscription ::
  EventSubscription
newEventSubscription :: EventSubscription
newEventSubscription =
  EventSubscription' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe [Tag]
-> 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:severity:EventSubscription' :: Maybe Text
severity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionCreationTime:EventSubscription' :: Maybe ISO8601
subscriptionCreationTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:eventCategoriesList:EventSubscription' :: Maybe [Text]
eventCategoriesList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:EventSubscription' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceIdsList:EventSubscription' :: Maybe [Text]
sourceIdsList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the Amazon Redshift event notification subscription.
--
-- Constraints:
--
-- -   Can be one of the following: active | no-permission |
--     topic-not-exist
--
-- -   The status \"no-permission\" indicates that Amazon Redshift no
--     longer has permission to post to the Amazon 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 account associated with the Amazon Redshift
-- 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 name of the Amazon Redshift event notification subscription.
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 Amazon Resource Name (ARN) of the Amazon SNS topic used by the 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)

-- | A boolean value indicating whether the subscription is enabled; @true@
-- indicates that 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 of the events returned by the Amazon Redshift event
-- notification, such as cluster, cluster-snapshot,
-- cluster-parameter-group, cluster-security-group, or scheduled-action.
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 event severity specified in the Amazon Redshift event notification
-- subscription.
--
-- Values: ERROR, INFO
eventSubscription_severity :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.Text)
eventSubscription_severity :: (Maybe Text -> f (Maybe Text))
-> EventSubscription -> f EventSubscription
eventSubscription_severity = (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
severity :: Maybe Text
$sel:severity:EventSubscription' :: EventSubscription -> Maybe Text
severity} -> Maybe Text
severity) (\s :: EventSubscription
s@EventSubscription' {} Maybe Text
a -> EventSubscription
s {$sel:severity:EventSubscription' :: Maybe Text
severity = Maybe Text
a} :: EventSubscription)

-- | The date and time the Amazon Redshift event notification subscription
-- was created.
eventSubscription_subscriptionCreationTime :: Lens.Lens' EventSubscription (Prelude.Maybe Prelude.UTCTime)
eventSubscription_subscriptionCreationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventSubscription -> f EventSubscription
eventSubscription_subscriptionCreationTime = (EventSubscription -> Maybe ISO8601)
-> (EventSubscription -> Maybe ISO8601 -> EventSubscription)
-> Lens
     EventSubscription EventSubscription (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe ISO8601
subscriptionCreationTime :: Maybe ISO8601
$sel:subscriptionCreationTime:EventSubscription' :: EventSubscription -> Maybe ISO8601
subscriptionCreationTime} -> Maybe ISO8601
subscriptionCreationTime) (\s :: EventSubscription
s@EventSubscription' {} Maybe ISO8601
a -> EventSubscription
s {$sel:subscriptionCreationTime:EventSubscription' :: Maybe ISO8601
subscriptionCreationTime = Maybe ISO8601
a} :: EventSubscription) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> EventSubscription -> f EventSubscription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventSubscription
-> f EventSubscription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The list of Amazon Redshift event categories specified in the event
-- notification subscription.
--
-- Values: Configuration, Management, Monitoring, Security, Pending
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

-- | The list of tags for the event subscription.
eventSubscription_tags :: Lens.Lens' EventSubscription (Prelude.Maybe [Tag])
eventSubscription_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> EventSubscription -> f EventSubscription
eventSubscription_tags = (EventSubscription -> Maybe [Tag])
-> (EventSubscription -> Maybe [Tag] -> EventSubscription)
-> Lens
     EventSubscription EventSubscription (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventSubscription' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:EventSubscription' :: EventSubscription -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: EventSubscription
s@EventSubscription' {} Maybe [Tag]
a -> EventSubscription
s {$sel:tags:EventSubscription' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: EventSubscription) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> EventSubscription -> f EventSubscription)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> EventSubscription
-> f EventSubscription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of the sources that publish events to the Amazon Redshift 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 Bool
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe [Tag]
-> Maybe [Text]
-> EventSubscription
EventSubscription'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe [Text]
 -> Maybe [Tag]
 -> Maybe [Text]
 -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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 ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe [Text]
      -> Maybe [Tag]
      -> 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
"Severity")
      Either
  String
  (Maybe ISO8601
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Maybe [Text]
   -> EventSubscription)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe [Text] -> Maybe [Tag] -> Maybe [Text] -> EventSubscription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SubscriptionCreationTime")
      Either
  String
  (Maybe [Text] -> Maybe [Tag] -> Maybe [Text] -> EventSubscription)
-> Either String (Maybe [Text])
-> Either String (Maybe [Tag] -> 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 [Tag] -> Maybe [Text] -> EventSubscription)
-> Either String (Maybe [Tag])
-> 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
"Tags" 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 [Tag]))
-> Either String (Maybe [Tag])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Tag])
-> [Node] -> Either String (Maybe [Tag])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Tag")
                  )
      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