{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ModifyEventSubscription
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies an existing Amazon Redshift event notification subscription.
module Amazonka.Redshift.ModifyEventSubscription
  ( -- * Creating a Request
    ModifyEventSubscription (..),
    newModifyEventSubscription,

    -- * Request Lenses
    modifyEventSubscription_enabled,
    modifyEventSubscription_eventCategories,
    modifyEventSubscription_severity,
    modifyEventSubscription_snsTopicArn,
    modifyEventSubscription_sourceIds,
    modifyEventSubscription_sourceType,
    modifyEventSubscription_subscriptionName,

    -- * Destructuring the Response
    ModifyEventSubscriptionResponse (..),
    newModifyEventSubscriptionResponse,

    -- * Response Lenses
    modifyEventSubscriptionResponse_eventSubscription,
    modifyEventSubscriptionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newModifyEventSubscription' smart constructor.
data ModifyEventSubscription = ModifyEventSubscription'
  { -- | A Boolean value indicating if the subscription is enabled. @true@
    -- indicates the subscription is enabled
    ModifyEventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the Amazon Redshift event categories to be published by the
    -- event notification subscription.
    --
    -- Values: configuration, management, monitoring, security, pending
    ModifyEventSubscription -> Maybe [Text]
eventCategories :: Prelude.Maybe [Prelude.Text],
    -- | Specifies the Amazon Redshift event severity to be published by the
    -- event notification subscription.
    --
    -- Values: ERROR, INFO
    ModifyEventSubscription -> Maybe Text
severity :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the SNS topic to be used by the event
    -- notification subscription.
    ModifyEventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | A list of one or more identifiers of Amazon Redshift source objects. All
    -- of the objects must be of the same type as was specified in the source
    -- type parameter. The event subscription will return only events generated
    -- by the specified objects. If not specified, then events are returned for
    -- all objects within the source type specified.
    --
    -- Example: my-cluster-1, my-cluster-2
    --
    -- Example: my-snapshot-20131010
    ModifyEventSubscription -> Maybe [Text]
sourceIds :: Prelude.Maybe [Prelude.Text],
    -- | The type of source that will be generating the events. For example, if
    -- you want to be notified of events generated by a cluster, you would set
    -- this parameter to cluster. If this value is not specified, events are
    -- returned for all Amazon Redshift objects in your Amazon Web Services
    -- account. You must specify a source type in order to specify source IDs.
    --
    -- Valid values: cluster, cluster-parameter-group, cluster-security-group,
    -- cluster-snapshot, and scheduled-action.
    ModifyEventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | The name of the modified Amazon Redshift event notification
    -- subscription.
    ModifyEventSubscription -> Text
subscriptionName :: Prelude.Text
  }
  deriving (ModifyEventSubscription -> ModifyEventSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyEventSubscription -> ModifyEventSubscription -> Bool
$c/= :: ModifyEventSubscription -> ModifyEventSubscription -> Bool
== :: ModifyEventSubscription -> ModifyEventSubscription -> Bool
$c== :: ModifyEventSubscription -> ModifyEventSubscription -> Bool
Prelude.Eq, ReadPrec [ModifyEventSubscription]
ReadPrec ModifyEventSubscription
Int -> ReadS ModifyEventSubscription
ReadS [ModifyEventSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyEventSubscription]
$creadListPrec :: ReadPrec [ModifyEventSubscription]
readPrec :: ReadPrec ModifyEventSubscription
$creadPrec :: ReadPrec ModifyEventSubscription
readList :: ReadS [ModifyEventSubscription]
$creadList :: ReadS [ModifyEventSubscription]
readsPrec :: Int -> ReadS ModifyEventSubscription
$creadsPrec :: Int -> ReadS ModifyEventSubscription
Prelude.Read, Int -> ModifyEventSubscription -> ShowS
[ModifyEventSubscription] -> ShowS
ModifyEventSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyEventSubscription] -> ShowS
$cshowList :: [ModifyEventSubscription] -> ShowS
show :: ModifyEventSubscription -> String
$cshow :: ModifyEventSubscription -> String
showsPrec :: Int -> ModifyEventSubscription -> ShowS
$cshowsPrec :: Int -> ModifyEventSubscription -> ShowS
Prelude.Show, forall x. Rep ModifyEventSubscription x -> ModifyEventSubscription
forall x. ModifyEventSubscription -> Rep ModifyEventSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyEventSubscription x -> ModifyEventSubscription
$cfrom :: forall x. ModifyEventSubscription -> Rep ModifyEventSubscription x
Prelude.Generic)

-- |
-- Create a value of 'ModifyEventSubscription' 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:
--
-- 'enabled', 'modifyEventSubscription_enabled' - A Boolean value indicating if the subscription is enabled. @true@
-- indicates the subscription is enabled
--
-- 'eventCategories', 'modifyEventSubscription_eventCategories' - Specifies the Amazon Redshift event categories to be published by the
-- event notification subscription.
--
-- Values: configuration, management, monitoring, security, pending
--
-- 'severity', 'modifyEventSubscription_severity' - Specifies the Amazon Redshift event severity to be published by the
-- event notification subscription.
--
-- Values: ERROR, INFO
--
-- 'snsTopicArn', 'modifyEventSubscription_snsTopicArn' - The Amazon Resource Name (ARN) of the SNS topic to be used by the event
-- notification subscription.
--
-- 'sourceIds', 'modifyEventSubscription_sourceIds' - A list of one or more identifiers of Amazon Redshift source objects. All
-- of the objects must be of the same type as was specified in the source
-- type parameter. The event subscription will return only events generated
-- by the specified objects. If not specified, then events are returned for
-- all objects within the source type specified.
--
-- Example: my-cluster-1, my-cluster-2
--
-- Example: my-snapshot-20131010
--
-- 'sourceType', 'modifyEventSubscription_sourceType' - The type of source that will be generating the events. For example, if
-- you want to be notified of events generated by a cluster, you would set
-- this parameter to cluster. If this value is not specified, events are
-- returned for all Amazon Redshift objects in your Amazon Web Services
-- account. You must specify a source type in order to specify source IDs.
--
-- Valid values: cluster, cluster-parameter-group, cluster-security-group,
-- cluster-snapshot, and scheduled-action.
--
-- 'subscriptionName', 'modifyEventSubscription_subscriptionName' - The name of the modified Amazon Redshift event notification
-- subscription.
newModifyEventSubscription ::
  -- | 'subscriptionName'
  Prelude.Text ->
  ModifyEventSubscription
newModifyEventSubscription :: Text -> ModifyEventSubscription
newModifyEventSubscription Text
pSubscriptionName_ =
  ModifyEventSubscription'
    { $sel:enabled:ModifyEventSubscription' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:eventCategories:ModifyEventSubscription' :: Maybe [Text]
eventCategories = forall a. Maybe a
Prelude.Nothing,
      $sel:severity:ModifyEventSubscription' :: Maybe Text
severity = forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicArn:ModifyEventSubscription' :: Maybe Text
snsTopicArn = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceIds:ModifyEventSubscription' :: Maybe [Text]
sourceIds = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:ModifyEventSubscription' :: Maybe Text
sourceType = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionName:ModifyEventSubscription' :: Text
subscriptionName = Text
pSubscriptionName_
    }

-- | A Boolean value indicating if the subscription is enabled. @true@
-- indicates the subscription is enabled
modifyEventSubscription_enabled :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Bool)
modifyEventSubscription_enabled :: Lens' ModifyEventSubscription (Maybe Bool)
modifyEventSubscription_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe Bool
a -> ModifyEventSubscription
s {$sel:enabled:ModifyEventSubscription' :: Maybe Bool
enabled = Maybe Bool
a} :: ModifyEventSubscription)

-- | Specifies the Amazon Redshift event categories to be published by the
-- event notification subscription.
--
-- Values: configuration, management, monitoring, security, pending
modifyEventSubscription_eventCategories :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe [Prelude.Text])
modifyEventSubscription_eventCategories :: Lens' ModifyEventSubscription (Maybe [Text])
modifyEventSubscription_eventCategories = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe [Text]
eventCategories :: Maybe [Text]
$sel:eventCategories:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
eventCategories} -> Maybe [Text]
eventCategories) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe [Text]
a -> ModifyEventSubscription
s {$sel:eventCategories:ModifyEventSubscription' :: Maybe [Text]
eventCategories = Maybe [Text]
a} :: ModifyEventSubscription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the Amazon Redshift event severity to be published by the
-- event notification subscription.
--
-- Values: ERROR, INFO
modifyEventSubscription_severity :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Text)
modifyEventSubscription_severity :: Lens' ModifyEventSubscription (Maybe Text)
modifyEventSubscription_severity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe Text
severity :: Maybe Text
$sel:severity:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
severity} -> Maybe Text
severity) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe Text
a -> ModifyEventSubscription
s {$sel:severity:ModifyEventSubscription' :: Maybe Text
severity = Maybe Text
a} :: ModifyEventSubscription)

-- | The Amazon Resource Name (ARN) of the SNS topic to be used by the event
-- notification subscription.
modifyEventSubscription_snsTopicArn :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Text)
modifyEventSubscription_snsTopicArn :: Lens' ModifyEventSubscription (Maybe Text)
modifyEventSubscription_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe Text
a -> ModifyEventSubscription
s {$sel:snsTopicArn:ModifyEventSubscription' :: Maybe Text
snsTopicArn = Maybe Text
a} :: ModifyEventSubscription)

-- | A list of one or more identifiers of Amazon Redshift source objects. All
-- of the objects must be of the same type as was specified in the source
-- type parameter. The event subscription will return only events generated
-- by the specified objects. If not specified, then events are returned for
-- all objects within the source type specified.
--
-- Example: my-cluster-1, my-cluster-2
--
-- Example: my-snapshot-20131010
modifyEventSubscription_sourceIds :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe [Prelude.Text])
modifyEventSubscription_sourceIds :: Lens' ModifyEventSubscription (Maybe [Text])
modifyEventSubscription_sourceIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe [Text]
sourceIds :: Maybe [Text]
$sel:sourceIds:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
sourceIds} -> Maybe [Text]
sourceIds) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe [Text]
a -> ModifyEventSubscription
s {$sel:sourceIds:ModifyEventSubscription' :: Maybe [Text]
sourceIds = Maybe [Text]
a} :: ModifyEventSubscription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of source that will be generating the events. For example, if
-- you want to be notified of events generated by a cluster, you would set
-- this parameter to cluster. If this value is not specified, events are
-- returned for all Amazon Redshift objects in your Amazon Web Services
-- account. You must specify a source type in order to specify source IDs.
--
-- Valid values: cluster, cluster-parameter-group, cluster-security-group,
-- cluster-snapshot, and scheduled-action.
modifyEventSubscription_sourceType :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Text)
modifyEventSubscription_sourceType :: Lens' ModifyEventSubscription (Maybe Text)
modifyEventSubscription_sourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Maybe Text
a -> ModifyEventSubscription
s {$sel:sourceType:ModifyEventSubscription' :: Maybe Text
sourceType = Maybe Text
a} :: ModifyEventSubscription)

-- | The name of the modified Amazon Redshift event notification
-- subscription.
modifyEventSubscription_subscriptionName :: Lens.Lens' ModifyEventSubscription Prelude.Text
modifyEventSubscription_subscriptionName :: Lens' ModifyEventSubscription Text
modifyEventSubscription_subscriptionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscription' {Text
subscriptionName :: Text
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
subscriptionName} -> Text
subscriptionName) (\s :: ModifyEventSubscription
s@ModifyEventSubscription' {} Text
a -> ModifyEventSubscription
s {$sel:subscriptionName:ModifyEventSubscription' :: Text
subscriptionName = Text
a} :: ModifyEventSubscription)

instance Core.AWSRequest ModifyEventSubscription where
  type
    AWSResponse ModifyEventSubscription =
      ModifyEventSubscriptionResponse
  request :: (Service -> Service)
-> ModifyEventSubscription -> Request ModifyEventSubscription
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyEventSubscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyEventSubscription)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ModifyEventSubscriptionResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe EventSubscription -> Int -> ModifyEventSubscriptionResponse
ModifyEventSubscriptionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EventSubscription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ModifyEventSubscription where
  hashWithSalt :: Int -> ModifyEventSubscription -> Int
hashWithSalt Int
_salt ModifyEventSubscription' {Maybe Bool
Maybe [Text]
Maybe Text
Text
subscriptionName :: Text
sourceType :: Maybe Text
sourceIds :: Maybe [Text]
snsTopicArn :: Maybe Text
severity :: Maybe Text
eventCategories :: Maybe [Text]
enabled :: Maybe Bool
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:sourceIds:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:snsTopicArn:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:severity:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:eventCategories:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:enabled:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
eventCategories
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
severity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopicArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
sourceIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subscriptionName

instance Prelude.NFData ModifyEventSubscription where
  rnf :: ModifyEventSubscription -> ()
rnf ModifyEventSubscription' {Maybe Bool
Maybe [Text]
Maybe Text
Text
subscriptionName :: Text
sourceType :: Maybe Text
sourceIds :: Maybe [Text]
snsTopicArn :: Maybe Text
severity :: Maybe Text
eventCategories :: Maybe [Text]
enabled :: Maybe Bool
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:sourceIds:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:snsTopicArn:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:severity:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:eventCategories:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:enabled:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
eventCategories
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
severity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
sourceIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
subscriptionName

instance Data.ToHeaders ModifyEventSubscription where
  toHeaders :: ModifyEventSubscription -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ModifyEventSubscription where
  toPath :: ModifyEventSubscription -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ModifyEventSubscription where
  toQuery :: ModifyEventSubscription -> QueryString
toQuery ModifyEventSubscription' {Maybe Bool
Maybe [Text]
Maybe Text
Text
subscriptionName :: Text
sourceType :: Maybe Text
sourceIds :: Maybe [Text]
snsTopicArn :: Maybe Text
severity :: Maybe Text
eventCategories :: Maybe [Text]
enabled :: Maybe Bool
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:sourceIds:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:snsTopicArn:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:severity:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:eventCategories:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:enabled:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyEventSubscription" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"Enabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
enabled,
        ByteString
"EventCategories"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"EventCategory"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
eventCategories
            ),
        ByteString
"Severity" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
severity,
        ByteString
"SnsTopicArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snsTopicArn,
        ByteString
"SourceIds"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SourceId" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
sourceIds),
        ByteString
"SourceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceType,
        ByteString
"SubscriptionName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
subscriptionName
      ]

-- | /See:/ 'newModifyEventSubscriptionResponse' smart constructor.
data ModifyEventSubscriptionResponse = ModifyEventSubscriptionResponse'
  { ModifyEventSubscriptionResponse -> Maybe EventSubscription
eventSubscription :: Prelude.Maybe EventSubscription,
    -- | The response's http status code.
    ModifyEventSubscriptionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
$c/= :: ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
== :: ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
$c== :: ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [ModifyEventSubscriptionResponse]
ReadPrec ModifyEventSubscriptionResponse
Int -> ReadS ModifyEventSubscriptionResponse
ReadS [ModifyEventSubscriptionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyEventSubscriptionResponse]
$creadListPrec :: ReadPrec [ModifyEventSubscriptionResponse]
readPrec :: ReadPrec ModifyEventSubscriptionResponse
$creadPrec :: ReadPrec ModifyEventSubscriptionResponse
readList :: ReadS [ModifyEventSubscriptionResponse]
$creadList :: ReadS [ModifyEventSubscriptionResponse]
readsPrec :: Int -> ReadS ModifyEventSubscriptionResponse
$creadsPrec :: Int -> ReadS ModifyEventSubscriptionResponse
Prelude.Read, Int -> ModifyEventSubscriptionResponse -> ShowS
[ModifyEventSubscriptionResponse] -> ShowS
ModifyEventSubscriptionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyEventSubscriptionResponse] -> ShowS
$cshowList :: [ModifyEventSubscriptionResponse] -> ShowS
show :: ModifyEventSubscriptionResponse -> String
$cshow :: ModifyEventSubscriptionResponse -> String
showsPrec :: Int -> ModifyEventSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> ModifyEventSubscriptionResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyEventSubscriptionResponse x
-> ModifyEventSubscriptionResponse
forall x.
ModifyEventSubscriptionResponse
-> Rep ModifyEventSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyEventSubscriptionResponse x
-> ModifyEventSubscriptionResponse
$cfrom :: forall x.
ModifyEventSubscriptionResponse
-> Rep ModifyEventSubscriptionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyEventSubscriptionResponse' 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:
--
-- 'eventSubscription', 'modifyEventSubscriptionResponse_eventSubscription' - Undocumented member.
--
-- 'httpStatus', 'modifyEventSubscriptionResponse_httpStatus' - The response's http status code.
newModifyEventSubscriptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyEventSubscriptionResponse
newModifyEventSubscriptionResponse :: Int -> ModifyEventSubscriptionResponse
newModifyEventSubscriptionResponse Int
pHttpStatus_ =
  ModifyEventSubscriptionResponse'
    { $sel:eventSubscription:ModifyEventSubscriptionResponse' :: Maybe EventSubscription
eventSubscription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyEventSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
modifyEventSubscriptionResponse_eventSubscription :: Lens.Lens' ModifyEventSubscriptionResponse (Prelude.Maybe EventSubscription)
modifyEventSubscriptionResponse_eventSubscription :: Lens' ModifyEventSubscriptionResponse (Maybe EventSubscription)
modifyEventSubscriptionResponse_eventSubscription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscriptionResponse' {Maybe EventSubscription
eventSubscription :: Maybe EventSubscription
$sel:eventSubscription:ModifyEventSubscriptionResponse' :: ModifyEventSubscriptionResponse -> Maybe EventSubscription
eventSubscription} -> Maybe EventSubscription
eventSubscription) (\s :: ModifyEventSubscriptionResponse
s@ModifyEventSubscriptionResponse' {} Maybe EventSubscription
a -> ModifyEventSubscriptionResponse
s {$sel:eventSubscription:ModifyEventSubscriptionResponse' :: Maybe EventSubscription
eventSubscription = Maybe EventSubscription
a} :: ModifyEventSubscriptionResponse)

-- | The response's http status code.
modifyEventSubscriptionResponse_httpStatus :: Lens.Lens' ModifyEventSubscriptionResponse Prelude.Int
modifyEventSubscriptionResponse_httpStatus :: Lens' ModifyEventSubscriptionResponse Int
modifyEventSubscriptionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyEventSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyEventSubscriptionResponse' :: ModifyEventSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyEventSubscriptionResponse
s@ModifyEventSubscriptionResponse' {} Int
a -> ModifyEventSubscriptionResponse
s {$sel:httpStatus:ModifyEventSubscriptionResponse' :: Int
httpStatus = Int
a} :: ModifyEventSubscriptionResponse)

instance
  Prelude.NFData
    ModifyEventSubscriptionResponse
  where
  rnf :: ModifyEventSubscriptionResponse -> ()
rnf ModifyEventSubscriptionResponse' {Int
Maybe EventSubscription
httpStatus :: Int
eventSubscription :: Maybe EventSubscription
$sel:httpStatus:ModifyEventSubscriptionResponse' :: ModifyEventSubscriptionResponse -> Int
$sel:eventSubscription:ModifyEventSubscriptionResponse' :: ModifyEventSubscriptionResponse -> Maybe EventSubscription
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EventSubscription
eventSubscription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus