{-# 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.DescribeEventSubscriptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all the event subscriptions for a customer account. The
-- description of a subscription includes @SubscriptionName@,
-- @SNSTopicARN@, @CustomerID@, @SourceType@, @SourceID@, @CreationTime@,
-- and @Status@.
--
-- If you specify @SubscriptionName@, this action lists the description for
-- that subscription.
--
-- This operation returns paginated results.
module Amazonka.DMS.DescribeEventSubscriptions
  ( -- * Creating a Request
    DescribeEventSubscriptions (..),
    newDescribeEventSubscriptions,

    -- * Request Lenses
    describeEventSubscriptions_filters,
    describeEventSubscriptions_marker,
    describeEventSubscriptions_maxRecords,
    describeEventSubscriptions_subscriptionName,

    -- * Destructuring the Response
    DescribeEventSubscriptionsResponse (..),
    newDescribeEventSubscriptionsResponse,

    -- * Response Lenses
    describeEventSubscriptionsResponse_eventSubscriptionsList,
    describeEventSubscriptionsResponse_marker,
    describeEventSubscriptionsResponse_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:/ 'newDescribeEventSubscriptions' smart constructor.
data DescribeEventSubscriptions = DescribeEventSubscriptions'
  { -- | Filters applied to event subscriptions.
    --
    -- Valid filter names: event-subscription-arn | event-subscription-id
    DescribeEventSubscriptions -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeEventSubscriptions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeEventSubscriptions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The name of the DMS event subscription to be described.
    DescribeEventSubscriptions -> Maybe Text
subscriptionName :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
$c/= :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
== :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
$c== :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
Prelude.Eq, ReadPrec [DescribeEventSubscriptions]
ReadPrec DescribeEventSubscriptions
Int -> ReadS DescribeEventSubscriptions
ReadS [DescribeEventSubscriptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSubscriptions]
$creadListPrec :: ReadPrec [DescribeEventSubscriptions]
readPrec :: ReadPrec DescribeEventSubscriptions
$creadPrec :: ReadPrec DescribeEventSubscriptions
readList :: ReadS [DescribeEventSubscriptions]
$creadList :: ReadS [DescribeEventSubscriptions]
readsPrec :: Int -> ReadS DescribeEventSubscriptions
$creadsPrec :: Int -> ReadS DescribeEventSubscriptions
Prelude.Read, Int -> DescribeEventSubscriptions -> ShowS
[DescribeEventSubscriptions] -> ShowS
DescribeEventSubscriptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSubscriptions] -> ShowS
$cshowList :: [DescribeEventSubscriptions] -> ShowS
show :: DescribeEventSubscriptions -> String
$cshow :: DescribeEventSubscriptions -> String
showsPrec :: Int -> DescribeEventSubscriptions -> ShowS
$cshowsPrec :: Int -> DescribeEventSubscriptions -> ShowS
Prelude.Show, forall x.
Rep DescribeEventSubscriptions x -> DescribeEventSubscriptions
forall x.
DescribeEventSubscriptions -> Rep DescribeEventSubscriptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventSubscriptions x -> DescribeEventSubscriptions
$cfrom :: forall x.
DescribeEventSubscriptions -> Rep DescribeEventSubscriptions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSubscriptions' 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:
--
-- 'filters', 'describeEventSubscriptions_filters' - Filters applied to event subscriptions.
--
-- Valid filter names: event-subscription-arn | event-subscription-id
--
-- 'marker', 'describeEventSubscriptions_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeEventSubscriptions_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
--
-- 'subscriptionName', 'describeEventSubscriptions_subscriptionName' - The name of the DMS event subscription to be described.
newDescribeEventSubscriptions ::
  DescribeEventSubscriptions
newDescribeEventSubscriptions :: DescribeEventSubscriptions
newDescribeEventSubscriptions =
  DescribeEventSubscriptions'
    { $sel:filters:DescribeEventSubscriptions' :: Maybe [Filter]
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeEventSubscriptions' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeEventSubscriptions' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionName:DescribeEventSubscriptions' :: Maybe Text
subscriptionName = forall a. Maybe a
Prelude.Nothing
    }

-- | Filters applied to event subscriptions.
--
-- Valid filter names: event-subscription-arn | event-subscription-id
describeEventSubscriptions_filters :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe [Filter])
describeEventSubscriptions_filters :: Lens' DescribeEventSubscriptions (Maybe [Filter])
describeEventSubscriptions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe [Filter]
a -> DescribeEventSubscriptions
s {$sel:filters:DescribeEventSubscriptions' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeEventSubscriptions) 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

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeEventSubscriptions_marker :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Text)
describeEventSubscriptions_marker :: Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Text
a -> DescribeEventSubscriptions
s {$sel:marker:DescribeEventSubscriptions' :: Maybe Text
marker = Maybe Text
a} :: DescribeEventSubscriptions)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeEventSubscriptions_maxRecords :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Int)
describeEventSubscriptions_maxRecords :: Lens' DescribeEventSubscriptions (Maybe Int)
describeEventSubscriptions_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Int
a -> DescribeEventSubscriptions
s {$sel:maxRecords:DescribeEventSubscriptions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeEventSubscriptions)

-- | The name of the DMS event subscription to be described.
describeEventSubscriptions_subscriptionName :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Text)
describeEventSubscriptions_subscriptionName :: Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_subscriptionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Text
subscriptionName :: Maybe Text
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
subscriptionName} -> Maybe Text
subscriptionName) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Text
a -> DescribeEventSubscriptions
s {$sel:subscriptionName:DescribeEventSubscriptions' :: Maybe Text
subscriptionName = Maybe Text
a} :: DescribeEventSubscriptions)

instance Core.AWSPager DescribeEventSubscriptions where
  page :: DescribeEventSubscriptions
-> AWSResponse DescribeEventSubscriptions
-> Maybe DescribeEventSubscriptions
page DescribeEventSubscriptions
rq AWSResponse DescribeEventSubscriptions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeEventSubscriptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeEventSubscriptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeEventSubscriptionsResponse (Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeEventSubscriptions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeEventSubscriptions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeEventSubscriptions where
  type
    AWSResponse DescribeEventSubscriptions =
      DescribeEventSubscriptionsResponse
  request :: (Service -> Service)
-> DescribeEventSubscriptions -> Request DescribeEventSubscriptions
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 DescribeEventSubscriptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEventSubscriptions)))
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]
-> Maybe Text -> Int -> DescribeEventSubscriptionsResponse
DescribeEventSubscriptionsResponse'
            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
"EventSubscriptionsList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Marker")
            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 DescribeEventSubscriptions where
  hashWithSalt :: Int -> DescribeEventSubscriptions -> Int
hashWithSalt Int
_salt DescribeEventSubscriptions' {Maybe Int
Maybe [Filter]
Maybe Text
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:filters:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subscriptionName

instance Prelude.NFData DescribeEventSubscriptions where
  rnf :: DescribeEventSubscriptions -> ()
rnf DescribeEventSubscriptions' {Maybe Int
Maybe [Filter]
Maybe Text
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:filters:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subscriptionName

instance Data.ToHeaders DescribeEventSubscriptions where
  toHeaders :: DescribeEventSubscriptions -> 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.DescribeEventSubscriptions" ::
                          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 DescribeEventSubscriptions where
  toJSON :: DescribeEventSubscriptions -> Value
toJSON DescribeEventSubscriptions' {Maybe Int
Maybe [Filter]
Maybe Text
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:filters:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" 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 [Filter]
filters,
            (Key
"Marker" 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
marker,
            (Key
"MaxRecords" 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 Int
maxRecords,
            (Key
"SubscriptionName" 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
subscriptionName
          ]
      )

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

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

-- |
--
-- /See:/ 'newDescribeEventSubscriptionsResponse' smart constructor.
data DescribeEventSubscriptionsResponse = DescribeEventSubscriptionsResponse'
  { -- | A list of event subscriptions.
    DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
eventSubscriptionsList :: Prelude.Maybe [EventSubscription],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeEventSubscriptionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeEventSubscriptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
$c/= :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
== :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
$c== :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEventSubscriptionsResponse]
ReadPrec DescribeEventSubscriptionsResponse
Int -> ReadS DescribeEventSubscriptionsResponse
ReadS [DescribeEventSubscriptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSubscriptionsResponse]
$creadListPrec :: ReadPrec [DescribeEventSubscriptionsResponse]
readPrec :: ReadPrec DescribeEventSubscriptionsResponse
$creadPrec :: ReadPrec DescribeEventSubscriptionsResponse
readList :: ReadS [DescribeEventSubscriptionsResponse]
$creadList :: ReadS [DescribeEventSubscriptionsResponse]
readsPrec :: Int -> ReadS DescribeEventSubscriptionsResponse
$creadsPrec :: Int -> ReadS DescribeEventSubscriptionsResponse
Prelude.Read, Int -> DescribeEventSubscriptionsResponse -> ShowS
[DescribeEventSubscriptionsResponse] -> ShowS
DescribeEventSubscriptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSubscriptionsResponse] -> ShowS
$cshowList :: [DescribeEventSubscriptionsResponse] -> ShowS
show :: DescribeEventSubscriptionsResponse -> String
$cshow :: DescribeEventSubscriptionsResponse -> String
showsPrec :: Int -> DescribeEventSubscriptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeEventSubscriptionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeEventSubscriptionsResponse x
-> DescribeEventSubscriptionsResponse
forall x.
DescribeEventSubscriptionsResponse
-> Rep DescribeEventSubscriptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventSubscriptionsResponse x
-> DescribeEventSubscriptionsResponse
$cfrom :: forall x.
DescribeEventSubscriptionsResponse
-> Rep DescribeEventSubscriptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSubscriptionsResponse' 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:
--
-- 'eventSubscriptionsList', 'describeEventSubscriptionsResponse_eventSubscriptionsList' - A list of event subscriptions.
--
-- 'marker', 'describeEventSubscriptionsResponse_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'httpStatus', 'describeEventSubscriptionsResponse_httpStatus' - The response's http status code.
newDescribeEventSubscriptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEventSubscriptionsResponse
newDescribeEventSubscriptionsResponse :: Int -> DescribeEventSubscriptionsResponse
newDescribeEventSubscriptionsResponse Int
pHttpStatus_ =
  DescribeEventSubscriptionsResponse'
    { $sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: Maybe [EventSubscription]
eventSubscriptionsList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeEventSubscriptionsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEventSubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of event subscriptions.
describeEventSubscriptionsResponse_eventSubscriptionsList :: Lens.Lens' DescribeEventSubscriptionsResponse (Prelude.Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList :: Lens'
  DescribeEventSubscriptionsResponse (Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptionsResponse' {Maybe [EventSubscription]
eventSubscriptionsList :: Maybe [EventSubscription]
$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
eventSubscriptionsList} -> Maybe [EventSubscription]
eventSubscriptionsList) (\s :: DescribeEventSubscriptionsResponse
s@DescribeEventSubscriptionsResponse' {} Maybe [EventSubscription]
a -> DescribeEventSubscriptionsResponse
s {$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: Maybe [EventSubscription]
eventSubscriptionsList = Maybe [EventSubscription]
a} :: DescribeEventSubscriptionsResponse) 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

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeEventSubscriptionsResponse_marker :: Lens.Lens' DescribeEventSubscriptionsResponse (Prelude.Maybe Prelude.Text)
describeEventSubscriptionsResponse_marker :: Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeEventSubscriptionsResponse
s@DescribeEventSubscriptionsResponse' {} Maybe Text
a -> DescribeEventSubscriptionsResponse
s {$sel:marker:DescribeEventSubscriptionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeEventSubscriptionsResponse)

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

instance
  Prelude.NFData
    DescribeEventSubscriptionsResponse
  where
  rnf :: DescribeEventSubscriptionsResponse -> ()
rnf DescribeEventSubscriptionsResponse' {Int
Maybe [EventSubscription]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
eventSubscriptionsList :: Maybe [EventSubscription]
$sel:httpStatus:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Int
$sel:marker:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe Text
$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [EventSubscription]
eventSubscriptionsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus