{-# 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-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)
--
-- 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_nextToken,
    listEventSubscriptions_resourceArn,
    listEventSubscriptions_maxResults,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Inspector.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:/ 'newListEventSubscriptions' smart constructor.
data ListEventSubscriptions = 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 -> 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,
    -- | 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
  }
  deriving (ListEventSubscriptions -> ListEventSubscriptions -> Bool
(ListEventSubscriptions -> ListEventSubscriptions -> Bool)
-> (ListEventSubscriptions -> ListEventSubscriptions -> Bool)
-> Eq ListEventSubscriptions
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]
(Int -> ReadS ListEventSubscriptions)
-> ReadS [ListEventSubscriptions]
-> ReadPrec ListEventSubscriptions
-> ReadPrec [ListEventSubscriptions]
-> Read 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
(Int -> ListEventSubscriptions -> ShowS)
-> (ListEventSubscriptions -> String)
-> ([ListEventSubscriptions] -> ShowS)
-> Show ListEventSubscriptions
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. ListEventSubscriptions -> Rep ListEventSubscriptions x)
-> (forall x.
    Rep ListEventSubscriptions x -> ListEventSubscriptions)
-> Generic ListEventSubscriptions
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:
--
-- '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.
--
-- '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.
newListEventSubscriptions ::
  ListEventSubscriptions
newListEventSubscriptions :: ListEventSubscriptions
newListEventSubscriptions =
  ListEventSubscriptions' :: Maybe Text -> Maybe Text -> Maybe Int -> ListEventSubscriptions
ListEventSubscriptions'
    { $sel:nextToken:ListEventSubscriptions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:ListEventSubscriptions' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEventSubscriptions' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListEventSubscriptions -> f ListEventSubscriptions
listEventSubscriptions_nextToken = (ListEventSubscriptions -> Maybe Text)
-> (ListEventSubscriptions -> Maybe Text -> ListEventSubscriptions)
-> Lens
     ListEventSubscriptions
     ListEventSubscriptions
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ListEventSubscriptions -> f ListEventSubscriptions
listEventSubscriptions_resourceArn = (ListEventSubscriptions -> Maybe Text)
-> (ListEventSubscriptions -> Maybe Text -> ListEventSubscriptions)
-> Lens
     ListEventSubscriptions
     ListEventSubscriptions
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Int -> f (Maybe Int))
-> ListEventSubscriptions -> f ListEventSubscriptions
listEventSubscriptions_maxResults = (ListEventSubscriptions -> Maybe Int)
-> (ListEventSubscriptions -> Maybe Int -> ListEventSubscriptions)
-> Lens
     ListEventSubscriptions
     ListEventSubscriptions
     (Maybe Int)
     (Maybe Int)
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)

instance Core.AWSPager ListEventSubscriptions where
  page :: ListEventSubscriptions
-> AWSResponse ListEventSubscriptions
-> Maybe ListEventSubscriptions
page ListEventSubscriptions
rq AWSResponse ListEventSubscriptions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEventSubscriptions
ListEventSubscriptionsResponse
rs
            ListEventSubscriptionsResponse
-> Getting (First Text) ListEventSubscriptionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEventSubscriptionsResponse
-> Const (First Text) ListEventSubscriptionsResponse
Lens' ListEventSubscriptionsResponse (Maybe Text)
listEventSubscriptionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEventSubscriptionsResponse
 -> Const (First Text) ListEventSubscriptionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEventSubscriptionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEventSubscriptions
forall a. Maybe a
Prelude.Nothing
    | [Subscription] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEventSubscriptions
ListEventSubscriptionsResponse
rs
            ListEventSubscriptionsResponse
-> Getting
     [Subscription] ListEventSubscriptionsResponse [Subscription]
-> [Subscription]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [Subscription] ListEventSubscriptionsResponse [Subscription]
Lens' ListEventSubscriptionsResponse [Subscription]
listEventSubscriptionsResponse_subscriptions
        ) =
      Maybe ListEventSubscriptions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListEventSubscriptions -> Maybe ListEventSubscriptions
forall a. a -> Maybe a
Prelude.Just (ListEventSubscriptions -> Maybe ListEventSubscriptions)
-> ListEventSubscriptions -> Maybe ListEventSubscriptions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListEventSubscriptions
rq
          ListEventSubscriptions
-> (ListEventSubscriptions -> ListEventSubscriptions)
-> ListEventSubscriptions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListEventSubscriptions -> Identity ListEventSubscriptions
Lens
  ListEventSubscriptions
  ListEventSubscriptions
  (Maybe Text)
  (Maybe Text)
listEventSubscriptions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListEventSubscriptions -> Identity ListEventSubscriptions)
-> Maybe Text -> ListEventSubscriptions -> ListEventSubscriptions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEventSubscriptions
ListEventSubscriptionsResponse
rs
          ListEventSubscriptionsResponse
-> Getting (First Text) ListEventSubscriptionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEventSubscriptionsResponse
-> Const (First Text) ListEventSubscriptionsResponse
Lens' ListEventSubscriptionsResponse (Maybe Text)
listEventSubscriptionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEventSubscriptionsResponse
 -> Const (First Text) ListEventSubscriptionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEventSubscriptionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListEventSubscriptions where
  type
    AWSResponse ListEventSubscriptions =
      ListEventSubscriptionsResponse
  request :: ListEventSubscriptions -> Request ListEventSubscriptions
request = Service -> ListEventSubscriptions -> Request ListEventSubscriptions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEventSubscriptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEventSubscriptions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListEventSubscriptions))
-> Logger
-> Service
-> Proxy ListEventSubscriptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEventSubscriptions)))
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 Text
-> Int -> [Subscription] -> ListEventSubscriptionsResponse
ListEventSubscriptionsResponse'
            (Maybe Text
 -> Int -> [Subscription] -> ListEventSubscriptionsResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [Subscription] -> ListEventSubscriptionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String (Int -> [Subscription] -> ListEventSubscriptionsResponse)
-> Either String Int
-> Either String ([Subscription] -> ListEventSubscriptionsResponse)
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))
            Either String ([Subscription] -> ListEventSubscriptionsResponse)
-> Either String [Subscription]
-> Either String ListEventSubscriptionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [Subscription])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"subscriptions" Either String (Maybe [Subscription])
-> [Subscription] -> Either String [Subscription]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Subscription]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListEventSubscriptions

instance Prelude.NFData ListEventSubscriptions

instance Core.ToHeaders ListEventSubscriptions where
  toHeaders :: ListEventSubscriptions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEventSubscriptions -> 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
"InspectorService.ListEventSubscriptions" ::
                          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 ListEventSubscriptions where
  toJSON :: ListEventSubscriptions -> Value
toJSON ListEventSubscriptions' {Maybe Int
Maybe Text
maxResults :: Maybe Int
resourceArn :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Int
$sel:resourceArn:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
$sel:nextToken:ListEventSubscriptions' :: ListEventSubscriptions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" 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
nextToken,
            (Text
"resourceArn" 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
resourceArn,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

instance Core.ToQuery ListEventSubscriptions where
  toQuery :: ListEventSubscriptions -> QueryString
toQuery = QueryString -> ListEventSubscriptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(ListEventSubscriptionsResponse
 -> ListEventSubscriptionsResponse -> Bool)
-> (ListEventSubscriptionsResponse
    -> ListEventSubscriptionsResponse -> Bool)
-> Eq ListEventSubscriptionsResponse
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]
(Int -> ReadS ListEventSubscriptionsResponse)
-> ReadS [ListEventSubscriptionsResponse]
-> ReadPrec ListEventSubscriptionsResponse
-> ReadPrec [ListEventSubscriptionsResponse]
-> Read 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
(Int -> ListEventSubscriptionsResponse -> ShowS)
-> (ListEventSubscriptionsResponse -> String)
-> ([ListEventSubscriptionsResponse] -> ShowS)
-> Show ListEventSubscriptionsResponse
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.
 ListEventSubscriptionsResponse
 -> Rep ListEventSubscriptionsResponse x)
-> (forall x.
    Rep ListEventSubscriptionsResponse x
    -> ListEventSubscriptionsResponse)
-> Generic ListEventSubscriptionsResponse
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' :: Maybe Text
-> Int -> [Subscription] -> ListEventSubscriptionsResponse
ListEventSubscriptionsResponse'
    { $sel:nextToken:ListEventSubscriptionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEventSubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:subscriptions:ListEventSubscriptionsResponse' :: [Subscription]
subscriptions = [Subscription]
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 :: (Maybe Text -> f (Maybe Text))
-> ListEventSubscriptionsResponse
-> f ListEventSubscriptionsResponse
listEventSubscriptionsResponse_nextToken = (ListEventSubscriptionsResponse -> Maybe Text)
-> (ListEventSubscriptionsResponse
    -> Maybe Text -> ListEventSubscriptionsResponse)
-> Lens' ListEventSubscriptionsResponse (Maybe Text)
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 :: (Int -> f Int)
-> ListEventSubscriptionsResponse
-> f ListEventSubscriptionsResponse
listEventSubscriptionsResponse_httpStatus = (ListEventSubscriptionsResponse -> Int)
-> (ListEventSubscriptionsResponse
    -> Int -> ListEventSubscriptionsResponse)
-> Lens
     ListEventSubscriptionsResponse
     ListEventSubscriptionsResponse
     Int
     Int
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 :: ([Subscription] -> f [Subscription])
-> ListEventSubscriptionsResponse
-> f ListEventSubscriptionsResponse
listEventSubscriptionsResponse_subscriptions = (ListEventSubscriptionsResponse -> [Subscription])
-> (ListEventSubscriptionsResponse
    -> [Subscription] -> ListEventSubscriptionsResponse)
-> Lens' ListEventSubscriptionsResponse [Subscription]
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) (([Subscription] -> f [Subscription])
 -> ListEventSubscriptionsResponse
 -> f ListEventSubscriptionsResponse)
-> (([Subscription] -> f [Subscription])
    -> [Subscription] -> f [Subscription])
-> ([Subscription] -> f [Subscription])
-> ListEventSubscriptionsResponse
-> f ListEventSubscriptionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Subscription] -> f [Subscription])
-> [Subscription] -> f [Subscription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListEventSubscriptionsResponse