{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_enabled,
    modifyEventSubscription_eventCategories,
    modifyEventSubscription_snsTopicArn,
    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 Amazonka.DMS.Types
import qualified Amazonka.Data as Data
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'
  { -- | A Boolean value; set to __true__ to activate the subscription.
    ModifyEventSubscription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | 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 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,
    -- | 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,
    -- | The name of the DMS event notification subscription to be modified.
    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; set to __true__ to activate the subscription.
--
-- '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.
--
-- '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.
--
-- 'sourceType', 'modifyEventSubscription_sourceType' - The type of DMS resource that generates the events you want to subscribe
-- to.
--
-- Valid values: replication-instance | replication-task
--
-- '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'
    { $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:snsTopicArn:ModifyEventSubscription' :: Maybe Text
snsTopicArn = 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; set to __true__ to activate the subscription.
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)

-- | 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 :: 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

-- | 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 :: 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)

-- | 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 :: 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 DMS event notification subscription to be modified.
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, ToJSON a) => Service -> a -> Request a
Request.postJSON (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 =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe EventSubscription -> Int -> ModifyEventSubscriptionResponse
ModifyEventSubscriptionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"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
snsTopicArn :: Maybe Text
eventCategories :: Maybe [Text]
enabled :: Maybe Bool
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:snsTopicArn: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
snsTopicArn
      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
snsTopicArn :: Maybe Text
eventCategories :: Maybe [Text]
enabled :: Maybe Bool
$sel:subscriptionName:ModifyEventSubscription' :: ModifyEventSubscription -> Text
$sel:sourceType:ModifyEventSubscription' :: ModifyEventSubscription -> Maybe Text
$sel:snsTopicArn: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
snsTopicArn
      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] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonDMSv20160101.ModifyEventSubscription" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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 = forall a b. a -> b -> a
Prelude.const 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
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' - 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'
    { $sel:eventSubscription:ModifyEventSubscriptionResponse' :: Maybe EventSubscription
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 :: 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