{-# 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.Inspector.ListEventSubscriptions
-- 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 the assessment template that is
-- specified by the ARN of the assessment template. For more information,
-- see SubscribeToEvent and UnsubscribeFromEvent.
--
-- This operation returns paginated results.
module Amazonka.Inspector.ListEventSubscriptions
  ( -- * Creating a Request
    ListEventSubscriptions (..),
    newListEventSubscriptions,

    -- * Request Lenses
    listEventSubscriptions_maxResults,
    listEventSubscriptions_nextToken,
    listEventSubscriptions_resourceArn,

    -- * Destructuring the Response
    ListEventSubscriptionsResponse (..),
    newListEventSubscriptionsResponse,

    -- * Response Lenses
    listEventSubscriptionsResponse_nextToken,
    listEventSubscriptionsResponse_httpStatus,
    listEventSubscriptionsResponse_subscriptions,
  )
where

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

-- | /See:/ 'newListEventSubscriptions' smart constructor.
data ListEventSubscriptions = ListEventSubscriptions'
  { -- | You can use this parameter to indicate the maximum number of items you
    -- want in the response. The default value is 10. The maximum value is 500.
    ListEventSubscriptions -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | You can use this parameter when paginating results. Set the value of
    -- this parameter to null on your first call to the
    -- __ListEventSubscriptions__ action. Subsequent calls to the action fill
    -- __nextToken__ in the request with the value of __NextToken__ from the
    -- previous response to continue listing data.
    ListEventSubscriptions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the assessment template for which you want to list the
    -- existing event subscriptions.
    ListEventSubscriptions -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ListEventSubscriptions -> ListEventSubscriptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEventSubscriptions -> ListEventSubscriptions -> Bool
$c/= :: ListEventSubscriptions -> ListEventSubscriptions -> Bool
== :: ListEventSubscriptions -> ListEventSubscriptions -> Bool
$c== :: ListEventSubscriptions -> ListEventSubscriptions -> Bool
Prelude.Eq, ReadPrec [ListEventSubscriptions]
ReadPrec ListEventSubscriptions
Int -> ReadS ListEventSubscriptions
ReadS [ListEventSubscriptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEventSubscriptions]
$creadListPrec :: ReadPrec [ListEventSubscriptions]
readPrec :: ReadPrec ListEventSubscriptions
$creadPrec :: ReadPrec ListEventSubscriptions
readList :: ReadS [ListEventSubscriptions]
$creadList :: ReadS [ListEventSubscriptions]
readsPrec :: Int -> ReadS ListEventSubscriptions
$creadsPrec :: Int -> ReadS ListEventSubscriptions
Prelude.Read, Int -> ListEventSubscriptions -> ShowS
[ListEventSubscriptions] -> ShowS
ListEventSubscriptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEventSubscriptions] -> ShowS
$cshowList :: [ListEventSubscriptions] -> ShowS
show :: ListEventSubscriptions -> String
$cshow :: ListEventSubscriptions -> String
showsPrec :: Int -> ListEventSubscriptions -> ShowS
$cshowsPrec :: Int -> ListEventSubscriptions -> ShowS
Prelude.Show, forall x. Rep ListEventSubscriptions x -> ListEventSubscriptions
forall x. ListEventSubscriptions -> Rep ListEventSubscriptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEventSubscriptions x -> ListEventSubscriptions
$cfrom :: forall x. ListEventSubscriptions -> Rep ListEventSubscriptions x
Prelude.Generic)

-- |
-- Create a value of 'ListEventSubscriptions' 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:
--
-- 'maxResults', 'listEventSubscriptions_maxResults' - You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 10. The maximum value is 500.
--
-- 'nextToken', 'listEventSubscriptions_nextToken' - You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- __ListEventSubscriptions__ action. Subsequent calls to the action fill
-- __nextToken__ in the request with the value of __NextToken__ from the
-- previous response to continue listing data.
--
-- 'resourceArn', 'listEventSubscriptions_resourceArn' - The ARN of the assessment template for which you want to list the
-- existing event subscriptions.
newListEventSubscriptions ::
  ListEventSubscriptions
newListEventSubscriptions :: ListEventSubscriptions
newListEventSubscriptions =
  ListEventSubscriptions'
    { $sel:maxResults:ListEventSubscriptions' :: Maybe Int
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListEventSubscriptions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:ListEventSubscriptions' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing
    }

-- | You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 10. The maximum value is 500.
listEventSubscriptions_maxResults :: Lens.Lens' ListEventSubscriptions (Prelude.Maybe Prelude.Int)
listEventSubscriptions_maxResults :: Lens' ListEventSubscriptions (Maybe Int)
listEventSubscriptions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventSubscriptions' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListEventSubscriptions
s@ListEventSubscriptions' {} Maybe Int
a -> ListEventSubscriptions
s {$sel:maxResults:ListEventSubscriptions' :: Maybe Int
maxResults = Maybe Int
a} :: ListEventSubscriptions)

-- | You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- __ListEventSubscriptions__ action. Subsequent calls to the action fill
-- __nextToken__ in the request with the value of __NextToken__ from the
-- previous response to continue listing data.
listEventSubscriptions_nextToken :: Lens.Lens' ListEventSubscriptions (Prelude.Maybe Prelude.Text)
listEventSubscriptions_nextToken :: Lens' ListEventSubscriptions (Maybe Text)
listEventSubscriptions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventSubscriptions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEventSubscriptions
s@ListEventSubscriptions' {} Maybe Text
a -> ListEventSubscriptions
s {$sel:nextToken:ListEventSubscriptions' :: Maybe Text
nextToken = Maybe Text
a} :: ListEventSubscriptions)

-- | The ARN of the assessment template for which you want to list the
-- existing event subscriptions.
listEventSubscriptions_resourceArn :: Lens.Lens' ListEventSubscriptions (Prelude.Maybe Prelude.Text)
listEventSubscriptions_resourceArn :: Lens' ListEventSubscriptions (Maybe Text)
listEventSubscriptions_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventSubscriptions' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: ListEventSubscriptions
s@ListEventSubscriptions' {} Maybe Text
a -> ListEventSubscriptions
s {$sel:resourceArn:ListEventSubscriptions' :: Maybe Text
resourceArn = Maybe Text
a} :: ListEventSubscriptions)

instance Core.AWSPager ListEventSubscriptions where
  page :: ListEventSubscriptions
-> AWSResponse ListEventSubscriptions
-> Maybe ListEventSubscriptions
page ListEventSubscriptions
rq AWSResponse ListEventSubscriptions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEventSubscriptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListEventSubscriptionsResponse (Maybe Text)
listEventSubscriptionsResponse_nextToken
            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 ListEventSubscriptions
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListEventSubscriptionsResponse [Subscription]
listEventSubscriptionsResponse_subscriptions
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListEventSubscriptions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListEventSubscriptions (Maybe Text)
listEventSubscriptions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEventSubscriptions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListEventSubscriptionsResponse (Maybe Text)
listEventSubscriptionsResponse_nextToken
          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 ListEventSubscriptions where
  type
    AWSResponse ListEventSubscriptions =
      ListEventSubscriptionsResponse
  request :: (Service -> Service)
-> ListEventSubscriptions -> Request ListEventSubscriptions
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 ListEventSubscriptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEventSubscriptions)))
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 Text
-> Int -> [Subscription] -> ListEventSubscriptionsResponse
ListEventSubscriptionsResponse'
            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
"nextToken")
            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))
            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
"subscriptions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListEventSubscriptions where
  hashWithSalt :: Int -> ListEventSubscriptions -> Int
hashWithSalt Int
_salt ListEventSubscriptions' {Maybe Int
Maybe Text
resourceArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:resourceArn:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:nextToken:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:maxResults:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn

instance Prelude.NFData ListEventSubscriptions where
  rnf :: ListEventSubscriptions -> ()
rnf ListEventSubscriptions' {Maybe Int
Maybe Text
resourceArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:resourceArn:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:nextToken:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:maxResults:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn

instance Data.ToHeaders ListEventSubscriptions where
  toHeaders :: ListEventSubscriptions -> 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
"InspectorService.ListEventSubscriptions" ::
                          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 ListEventSubscriptions where
  toJSON :: ListEventSubscriptions -> Value
toJSON ListEventSubscriptions' {Maybe Int
Maybe Text
resourceArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:resourceArn:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:nextToken:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:maxResults:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maxResults" 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
maxResults,
            (Key
"nextToken" 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
nextToken,
            (Key
"resourceArn" 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
resourceArn
          ]
      )

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

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

-- | /See:/ 'newListEventSubscriptionsResponse' smart constructor.
data ListEventSubscriptionsResponse = ListEventSubscriptionsResponse'
  { -- | When a response is generated, if there is more data to be listed, this
    -- parameter is present in the response and contains the value to use for
    -- the __nextToken__ parameter in a subsequent pagination request. If there
    -- is no more data to be listed, this parameter is set to null.
    ListEventSubscriptionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListEventSubscriptionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Details of the returned event subscriptions.
    ListEventSubscriptionsResponse -> [Subscription]
subscriptions :: [Subscription]
  }
  deriving (ListEventSubscriptionsResponse
-> ListEventSubscriptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEventSubscriptionsResponse
-> ListEventSubscriptionsResponse -> Bool
$c/= :: ListEventSubscriptionsResponse
-> ListEventSubscriptionsResponse -> Bool
== :: ListEventSubscriptionsResponse
-> ListEventSubscriptionsResponse -> Bool
$c== :: ListEventSubscriptionsResponse
-> ListEventSubscriptionsResponse -> Bool
Prelude.Eq, ReadPrec [ListEventSubscriptionsResponse]
ReadPrec ListEventSubscriptionsResponse
Int -> ReadS ListEventSubscriptionsResponse
ReadS [ListEventSubscriptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEventSubscriptionsResponse]
$creadListPrec :: ReadPrec [ListEventSubscriptionsResponse]
readPrec :: ReadPrec ListEventSubscriptionsResponse
$creadPrec :: ReadPrec ListEventSubscriptionsResponse
readList :: ReadS [ListEventSubscriptionsResponse]
$creadList :: ReadS [ListEventSubscriptionsResponse]
readsPrec :: Int -> ReadS ListEventSubscriptionsResponse
$creadsPrec :: Int -> ReadS ListEventSubscriptionsResponse
Prelude.Read, Int -> ListEventSubscriptionsResponse -> ShowS
[ListEventSubscriptionsResponse] -> ShowS
ListEventSubscriptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEventSubscriptionsResponse] -> ShowS
$cshowList :: [ListEventSubscriptionsResponse] -> ShowS
show :: ListEventSubscriptionsResponse -> String
$cshow :: ListEventSubscriptionsResponse -> String
showsPrec :: Int -> ListEventSubscriptionsResponse -> ShowS
$cshowsPrec :: Int -> ListEventSubscriptionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListEventSubscriptionsResponse x
-> ListEventSubscriptionsResponse
forall x.
ListEventSubscriptionsResponse
-> Rep ListEventSubscriptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEventSubscriptionsResponse x
-> ListEventSubscriptionsResponse
$cfrom :: forall x.
ListEventSubscriptionsResponse
-> Rep ListEventSubscriptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEventSubscriptionsResponse' 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:
--
-- 'nextToken', 'listEventSubscriptionsResponse_nextToken' - When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the __nextToken__ parameter in a subsequent pagination request. If there
-- is no more data to be listed, this parameter is set to null.
--
-- 'httpStatus', 'listEventSubscriptionsResponse_httpStatus' - The response's http status code.
--
-- 'subscriptions', 'listEventSubscriptionsResponse_subscriptions' - Details of the returned event subscriptions.
newListEventSubscriptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEventSubscriptionsResponse
newListEventSubscriptionsResponse :: Int -> ListEventSubscriptionsResponse
newListEventSubscriptionsResponse Int
pHttpStatus_ =
  ListEventSubscriptionsResponse'
    { $sel:nextToken:ListEventSubscriptionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEventSubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:subscriptions:ListEventSubscriptionsResponse' :: [Subscription]
subscriptions = forall a. Monoid a => a
Prelude.mempty
    }

-- | When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the __nextToken__ parameter in a subsequent pagination request. If there
-- is no more data to be listed, this parameter is set to null.
listEventSubscriptionsResponse_nextToken :: Lens.Lens' ListEventSubscriptionsResponse (Prelude.Maybe Prelude.Text)
listEventSubscriptionsResponse_nextToken :: Lens' ListEventSubscriptionsResponse (Maybe Text)
listEventSubscriptionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventSubscriptionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEventSubscriptionsResponse' :: ListEventSubscriptionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEventSubscriptionsResponse
s@ListEventSubscriptionsResponse' {} Maybe Text
a -> ListEventSubscriptionsResponse
s {$sel:nextToken:ListEventSubscriptionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEventSubscriptionsResponse)

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

-- | Details of the returned event subscriptions.
listEventSubscriptionsResponse_subscriptions :: Lens.Lens' ListEventSubscriptionsResponse [Subscription]
listEventSubscriptionsResponse_subscriptions :: Lens' ListEventSubscriptionsResponse [Subscription]
listEventSubscriptionsResponse_subscriptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEventSubscriptionsResponse' {[Subscription]
subscriptions :: [Subscription]
$sel:subscriptions:ListEventSubscriptionsResponse' :: ListEventSubscriptionsResponse -> [Subscription]
subscriptions} -> [Subscription]
subscriptions) (\s :: ListEventSubscriptionsResponse
s@ListEventSubscriptionsResponse' {} [Subscription]
a -> ListEventSubscriptionsResponse
s {$sel:subscriptions:ListEventSubscriptionsResponse' :: [Subscription]
subscriptions = [Subscription]
a} :: ListEventSubscriptionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListEventSubscriptionsResponse
  where
  rnf :: ListEventSubscriptionsResponse -> ()
rnf ListEventSubscriptionsResponse' {Int
[Subscription]
Maybe Text
subscriptions :: [Subscription]
httpStatus :: Int
nextToken :: Maybe Text
$sel:subscriptions:ListEventSubscriptionsResponse' :: ListEventSubscriptionsResponse -> [Subscription]
$sel:httpStatus:ListEventSubscriptionsResponse' :: ListEventSubscriptionsResponse -> Int
$sel:nextToken:ListEventSubscriptionsResponse' :: ListEventSubscriptionsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Subscription]
subscriptions