{-# 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.DMS.ModifyEventSubscription
-- 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)
--
-- Modifies an existing DMS event notification subscription.
module Amazonka.DMS.ModifyEventSubscription
  ( -- * Creating a Request
    ModifyEventSubscription (..),
    newModifyEventSubscription,

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

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

    -- * Response Lenses
    modifyEventSubscriptionResponse_eventSubscription,
    modifyEventSubscriptionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newModifyEventSubscription' smart constructor.
data ModifyEventSubscription = ModifyEventSubscription'
  { -- | The Amazon Resource Name (ARN) of the Amazon SNS topic created for event
    -- notification. The ARN is created by Amazon SNS when you create a topic
    -- and subscribe to it.
    ModifyEventSubscription -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value; set to __true__ to activate the subscription.
    ModifyEventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The type of DMS resource that generates the events you want to subscribe
    -- to.
    --
    -- Valid values: replication-instance | replication-task
    ModifyEventSubscription -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | A list of event categories for a source type that you want to subscribe
    -- to. Use the @DescribeEventCategories@ action to see a list of event
    -- categories.
    ModifyEventSubscription -> Maybe [Text]
eventCategories :: Prelude.Maybe [Prelude.Text],
    -- | The name of the DMS event notification subscription to be modified.
    ModifyEventSubscription -> Text
subscriptionName :: Prelude.Text
  }
  deriving (ModifyEventSubscription -> ModifyEventSubscription -> Bool
(ModifyEventSubscription -> ModifyEventSubscription -> Bool)
-> (ModifyEventSubscription -> ModifyEventSubscription -> Bool)
-> Eq ModifyEventSubscription
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]
(Int -> ReadS ModifyEventSubscription)
-> ReadS [ModifyEventSubscription]
-> ReadPrec ModifyEventSubscription
-> ReadPrec [ModifyEventSubscription]
-> Read 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
(Int -> ModifyEventSubscription -> ShowS)
-> (ModifyEventSubscription -> String)
-> ([ModifyEventSubscription] -> ShowS)
-> Show ModifyEventSubscription
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.
 ModifyEventSubscription -> Rep ModifyEventSubscription x)
-> (forall x.
    Rep ModifyEventSubscription x -> ModifyEventSubscription)
-> Generic ModifyEventSubscription
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:
--
-- 'snsTopicArn', 'modifyEventSubscription_snsTopicArn' - The Amazon Resource Name (ARN) of the Amazon SNS topic created for event
-- notification. The ARN is created by Amazon SNS when you create a topic
-- and subscribe to it.
--
-- 'enabled', 'modifyEventSubscription_enabled' - A Boolean value; set to __true__ to activate the subscription.
--
-- 'sourceType', 'modifyEventSubscription_sourceType' - The type of DMS resource that generates the events you want to subscribe
-- to.
--
-- Valid values: replication-instance | replication-task
--
-- 'eventCategories', 'modifyEventSubscription_eventCategories' - A list of event categories for a source type that you want to subscribe
-- to. Use the @DescribeEventCategories@ action to see a list of event
-- categories.
--
-- 'subscriptionName', 'modifyEventSubscription_subscriptionName' - The name of the DMS event notification subscription to be modified.
newModifyEventSubscription ::
  -- | 'subscriptionName'
  Prelude.Text ->
  ModifyEventSubscription
newModifyEventSubscription :: Text -> ModifyEventSubscription
newModifyEventSubscription Text
pSubscriptionName_ =
  ModifyEventSubscription' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Text
-> ModifyEventSubscription
ModifyEventSubscription'
    { $sel:snsTopicArn:ModifyEventSubscription' :: Maybe Text
snsTopicArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:ModifyEventSubscription' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:ModifyEventSubscription' :: Maybe Text
sourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventCategories:ModifyEventSubscription' :: Maybe [Text]
eventCategories = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionName:ModifyEventSubscription' :: Text
subscriptionName = Text
pSubscriptionName_
    }

-- | The Amazon Resource Name (ARN) of the Amazon SNS topic created for event
-- notification. The ARN is created by Amazon SNS when you create a topic
-- and subscribe to it.
modifyEventSubscription_snsTopicArn :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Text)
modifyEventSubscription_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> ModifyEventSubscription -> f ModifyEventSubscription
modifyEventSubscription_snsTopicArn = (ModifyEventSubscription -> Maybe Text)
-> (ModifyEventSubscription
    -> Maybe Text -> ModifyEventSubscription)
-> Lens
     ModifyEventSubscription
     ModifyEventSubscription
     (Maybe Text)
     (Maybe Text)
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 Boolean value; set to __true__ to activate the subscription.
modifyEventSubscription_enabled :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Bool)
modifyEventSubscription_enabled :: (Maybe Bool -> f (Maybe Bool))
-> ModifyEventSubscription -> f ModifyEventSubscription
modifyEventSubscription_enabled = (ModifyEventSubscription -> Maybe Bool)
-> (ModifyEventSubscription
    -> Maybe Bool -> ModifyEventSubscription)
-> Lens
     ModifyEventSubscription
     ModifyEventSubscription
     (Maybe Bool)
     (Maybe Bool)
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)

-- | The type of DMS resource that generates the events you want to subscribe
-- to.
--
-- Valid values: replication-instance | replication-task
modifyEventSubscription_sourceType :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe Prelude.Text)
modifyEventSubscription_sourceType :: (Maybe Text -> f (Maybe Text))
-> ModifyEventSubscription -> f ModifyEventSubscription
modifyEventSubscription_sourceType = (ModifyEventSubscription -> Maybe Text)
-> (ModifyEventSubscription
    -> Maybe Text -> ModifyEventSubscription)
-> Lens
     ModifyEventSubscription
     ModifyEventSubscription
     (Maybe Text)
     (Maybe Text)
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)

-- | A list of event categories for a source type that you want to subscribe
-- to. Use the @DescribeEventCategories@ action to see a list of event
-- categories.
modifyEventSubscription_eventCategories :: Lens.Lens' ModifyEventSubscription (Prelude.Maybe [Prelude.Text])
modifyEventSubscription_eventCategories :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyEventSubscription -> f ModifyEventSubscription
modifyEventSubscription_eventCategories = (ModifyEventSubscription -> Maybe [Text])
-> (ModifyEventSubscription
    -> Maybe [Text] -> ModifyEventSubscription)
-> Lens
     ModifyEventSubscription
     ModifyEventSubscription
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyEventSubscription -> f ModifyEventSubscription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyEventSubscription
-> f ModifyEventSubscription
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 name of the DMS event notification subscription to be modified.
modifyEventSubscription_subscriptionName :: Lens.Lens' ModifyEventSubscription Prelude.Text
modifyEventSubscription_subscriptionName :: (Text -> f Text)
-> ModifyEventSubscription -> f ModifyEventSubscription
modifyEventSubscription_subscriptionName = (ModifyEventSubscription -> Text)
-> (ModifyEventSubscription -> Text -> ModifyEventSubscription)
-> Lens ModifyEventSubscription ModifyEventSubscription Text Text
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 :: ModifyEventSubscription -> Request ModifyEventSubscription
request = Service
-> ModifyEventSubscription -> Request ModifyEventSubscription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyEventSubscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyEventSubscription)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ModifyEventSubscription))
-> Logger
-> Service
-> Proxy ModifyEventSubscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyEventSubscription)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe EventSubscription -> Int -> ModifyEventSubscriptionResponse
ModifyEventSubscriptionResponse'
            (Maybe EventSubscription -> Int -> ModifyEventSubscriptionResponse)
-> Either String (Maybe EventSubscription)
-> Either String (Int -> ModifyEventSubscriptionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EventSubscription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EventSubscription")
            Either String (Int -> ModifyEventSubscriptionResponse)
-> Either String Int
-> Either String ModifyEventSubscriptionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ModifyEventSubscription

instance Prelude.NFData ModifyEventSubscription

instance Core.ToHeaders ModifyEventSubscription where
  toHeaders :: ModifyEventSubscription -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ModifyEventSubscription -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.ModifyEventSubscription" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ModifyEventSubscription where
  toJSON :: ModifyEventSubscription -> Value
toJSON ModifyEventSubscription' {Maybe Bool
Maybe [Text]
Maybe Text
Text
subscriptionName :: Text
eventCategories :: Maybe [Text]
sourceType :: Maybe Text
enabled :: Maybe Bool
snsTopicArn :: Maybe Text
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:eventCategories:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe [Text]
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:enabled:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Bool
$sel:snsTopicArn:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SnsTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicArn,
            (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
            (Text
"SourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceType,
            (Text
"EventCategories" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
eventCategories,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SubscriptionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subscriptionName)
          ]
      )

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

instance Core.ToQuery ModifyEventSubscription where
  toQuery :: ModifyEventSubscription -> QueryString
toQuery = QueryString -> ModifyEventSubscription -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- |
--
-- /See:/ 'newModifyEventSubscriptionResponse' smart constructor.
data ModifyEventSubscriptionResponse = ModifyEventSubscriptionResponse'
  { -- | The modified event subscription.
    ModifyEventSubscriptionResponse -> Maybe EventSubscription
eventSubscription :: Prelude.Maybe EventSubscription,
    -- | The response's http status code.
    ModifyEventSubscriptionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyEventSubscriptionResponse
-> ModifyEventSubscriptionResponse -> Bool
(ModifyEventSubscriptionResponse
 -> ModifyEventSubscriptionResponse -> Bool)
-> (ModifyEventSubscriptionResponse
    -> ModifyEventSubscriptionResponse -> Bool)
-> Eq ModifyEventSubscriptionResponse
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]
(Int -> ReadS ModifyEventSubscriptionResponse)
-> ReadS [ModifyEventSubscriptionResponse]
-> ReadPrec ModifyEventSubscriptionResponse
-> ReadPrec [ModifyEventSubscriptionResponse]
-> Read 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
(Int -> ModifyEventSubscriptionResponse -> ShowS)
-> (ModifyEventSubscriptionResponse -> String)
-> ([ModifyEventSubscriptionResponse] -> ShowS)
-> Show ModifyEventSubscriptionResponse
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.
 ModifyEventSubscriptionResponse
 -> Rep ModifyEventSubscriptionResponse x)
-> (forall x.
    Rep ModifyEventSubscriptionResponse x
    -> ModifyEventSubscriptionResponse)
-> Generic ModifyEventSubscriptionResponse
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' - The modified event subscription.
--
-- 'httpStatus', 'modifyEventSubscriptionResponse_httpStatus' - The response's http status code.
newModifyEventSubscriptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyEventSubscriptionResponse
newModifyEventSubscriptionResponse :: Int -> ModifyEventSubscriptionResponse
newModifyEventSubscriptionResponse Int
pHttpStatus_ =
  ModifyEventSubscriptionResponse' :: Maybe EventSubscription -> Int -> ModifyEventSubscriptionResponse
ModifyEventSubscriptionResponse'
    { $sel:eventSubscription:ModifyEventSubscriptionResponse' :: Maybe EventSubscription
eventSubscription =
        Maybe EventSubscription
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyEventSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The modified event subscription.
modifyEventSubscriptionResponse_eventSubscription :: Lens.Lens' ModifyEventSubscriptionResponse (Prelude.Maybe EventSubscription)
modifyEventSubscriptionResponse_eventSubscription :: (Maybe EventSubscription -> f (Maybe EventSubscription))
-> ModifyEventSubscriptionResponse
-> f ModifyEventSubscriptionResponse
modifyEventSubscriptionResponse_eventSubscription = (ModifyEventSubscriptionResponse -> Maybe EventSubscription)
-> (ModifyEventSubscriptionResponse
    -> Maybe EventSubscription -> ModifyEventSubscriptionResponse)
-> Lens
     ModifyEventSubscriptionResponse
     ModifyEventSubscriptionResponse
     (Maybe EventSubscription)
     (Maybe 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 :: (Int -> f Int)
-> ModifyEventSubscriptionResponse
-> f ModifyEventSubscriptionResponse
modifyEventSubscriptionResponse_httpStatus = (ModifyEventSubscriptionResponse -> Int)
-> (ModifyEventSubscriptionResponse
    -> Int -> ModifyEventSubscriptionResponse)
-> Lens
     ModifyEventSubscriptionResponse
     ModifyEventSubscriptionResponse
     Int
     Int
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