{-# 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.SecurityHub.ListFindingAggregators
-- 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)
--
-- If finding aggregation is enabled, then @ListFindingAggregators@ returns
-- the ARN of the finding aggregator. You can run this operation from any
-- Region.
--
-- This operation returns paginated results.
module Amazonka.SecurityHub.ListFindingAggregators
  ( -- * Creating a Request
    ListFindingAggregators (..),
    newListFindingAggregators,

    -- * Request Lenses
    listFindingAggregators_nextToken,
    listFindingAggregators_maxResults,

    -- * Destructuring the Response
    ListFindingAggregatorsResponse (..),
    newListFindingAggregatorsResponse,

    -- * Response Lenses
    listFindingAggregatorsResponse_nextToken,
    listFindingAggregatorsResponse_findingAggregators,
    listFindingAggregatorsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListFindingAggregators' smart constructor.
data ListFindingAggregators = ListFindingAggregators'
  { -- | The token returned with the previous set of results. Identifies the next
    -- set of results to return.
    ListFindingAggregators -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return. This operation currently only
    -- returns a single result.
    ListFindingAggregators -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFindingAggregators -> ListFindingAggregators -> Bool
(ListFindingAggregators -> ListFindingAggregators -> Bool)
-> (ListFindingAggregators -> ListFindingAggregators -> Bool)
-> Eq ListFindingAggregators
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFindingAggregators -> ListFindingAggregators -> Bool
$c/= :: ListFindingAggregators -> ListFindingAggregators -> Bool
== :: ListFindingAggregators -> ListFindingAggregators -> Bool
$c== :: ListFindingAggregators -> ListFindingAggregators -> Bool
Prelude.Eq, ReadPrec [ListFindingAggregators]
ReadPrec ListFindingAggregators
Int -> ReadS ListFindingAggregators
ReadS [ListFindingAggregators]
(Int -> ReadS ListFindingAggregators)
-> ReadS [ListFindingAggregators]
-> ReadPrec ListFindingAggregators
-> ReadPrec [ListFindingAggregators]
-> Read ListFindingAggregators
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFindingAggregators]
$creadListPrec :: ReadPrec [ListFindingAggregators]
readPrec :: ReadPrec ListFindingAggregators
$creadPrec :: ReadPrec ListFindingAggregators
readList :: ReadS [ListFindingAggregators]
$creadList :: ReadS [ListFindingAggregators]
readsPrec :: Int -> ReadS ListFindingAggregators
$creadsPrec :: Int -> ReadS ListFindingAggregators
Prelude.Read, Int -> ListFindingAggregators -> ShowS
[ListFindingAggregators] -> ShowS
ListFindingAggregators -> String
(Int -> ListFindingAggregators -> ShowS)
-> (ListFindingAggregators -> String)
-> ([ListFindingAggregators] -> ShowS)
-> Show ListFindingAggregators
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFindingAggregators] -> ShowS
$cshowList :: [ListFindingAggregators] -> ShowS
show :: ListFindingAggregators -> String
$cshow :: ListFindingAggregators -> String
showsPrec :: Int -> ListFindingAggregators -> ShowS
$cshowsPrec :: Int -> ListFindingAggregators -> ShowS
Prelude.Show, (forall x. ListFindingAggregators -> Rep ListFindingAggregators x)
-> (forall x.
    Rep ListFindingAggregators x -> ListFindingAggregators)
-> Generic ListFindingAggregators
forall x. Rep ListFindingAggregators x -> ListFindingAggregators
forall x. ListFindingAggregators -> Rep ListFindingAggregators x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFindingAggregators x -> ListFindingAggregators
$cfrom :: forall x. ListFindingAggregators -> Rep ListFindingAggregators x
Prelude.Generic)

-- |
-- Create a value of 'ListFindingAggregators' 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', 'listFindingAggregators_nextToken' - The token returned with the previous set of results. Identifies the next
-- set of results to return.
--
-- 'maxResults', 'listFindingAggregators_maxResults' - The maximum number of results to return. This operation currently only
-- returns a single result.
newListFindingAggregators ::
  ListFindingAggregators
newListFindingAggregators :: ListFindingAggregators
newListFindingAggregators =
  ListFindingAggregators' :: Maybe Text -> Maybe Natural -> ListFindingAggregators
ListFindingAggregators'
    { $sel:nextToken:ListFindingAggregators' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFindingAggregators' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token returned with the previous set of results. Identifies the next
-- set of results to return.
listFindingAggregators_nextToken :: Lens.Lens' ListFindingAggregators (Prelude.Maybe Prelude.Text)
listFindingAggregators_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFindingAggregators -> f ListFindingAggregators
listFindingAggregators_nextToken = (ListFindingAggregators -> Maybe Text)
-> (ListFindingAggregators -> Maybe Text -> ListFindingAggregators)
-> Lens
     ListFindingAggregators
     ListFindingAggregators
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingAggregators' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFindingAggregators' :: ListFindingAggregators -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFindingAggregators
s@ListFindingAggregators' {} Maybe Text
a -> ListFindingAggregators
s {$sel:nextToken:ListFindingAggregators' :: Maybe Text
nextToken = Maybe Text
a} :: ListFindingAggregators)

-- | The maximum number of results to return. This operation currently only
-- returns a single result.
listFindingAggregators_maxResults :: Lens.Lens' ListFindingAggregators (Prelude.Maybe Prelude.Natural)
listFindingAggregators_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListFindingAggregators -> f ListFindingAggregators
listFindingAggregators_maxResults = (ListFindingAggregators -> Maybe Natural)
-> (ListFindingAggregators
    -> Maybe Natural -> ListFindingAggregators)
-> Lens
     ListFindingAggregators
     ListFindingAggregators
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingAggregators' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFindingAggregators' :: ListFindingAggregators -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFindingAggregators
s@ListFindingAggregators' {} Maybe Natural
a -> ListFindingAggregators
s {$sel:maxResults:ListFindingAggregators' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFindingAggregators)

instance Core.AWSPager ListFindingAggregators where
  page :: ListFindingAggregators
-> AWSResponse ListFindingAggregators
-> Maybe ListFindingAggregators
page ListFindingAggregators
rq AWSResponse ListFindingAggregators
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFindingAggregators
ListFindingAggregatorsResponse
rs
            ListFindingAggregatorsResponse
-> Getting (First Text) ListFindingAggregatorsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFindingAggregatorsResponse
-> Const (First Text) ListFindingAggregatorsResponse
Lens' ListFindingAggregatorsResponse (Maybe Text)
listFindingAggregatorsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFindingAggregatorsResponse
 -> Const (First Text) ListFindingAggregatorsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFindingAggregatorsResponse 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 ListFindingAggregators
forall a. Maybe a
Prelude.Nothing
    | Maybe [FindingAggregator] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFindingAggregators
ListFindingAggregatorsResponse
rs
            ListFindingAggregatorsResponse
-> Getting
     (First [FindingAggregator])
     ListFindingAggregatorsResponse
     [FindingAggregator]
-> Maybe [FindingAggregator]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FindingAggregator]
 -> Const (First [FindingAggregator]) (Maybe [FindingAggregator]))
-> ListFindingAggregatorsResponse
-> Const (First [FindingAggregator]) ListFindingAggregatorsResponse
Lens' ListFindingAggregatorsResponse (Maybe [FindingAggregator])
listFindingAggregatorsResponse_findingAggregators
              ((Maybe [FindingAggregator]
  -> Const (First [FindingAggregator]) (Maybe [FindingAggregator]))
 -> ListFindingAggregatorsResponse
 -> Const
      (First [FindingAggregator]) ListFindingAggregatorsResponse)
-> (([FindingAggregator]
     -> Const (First [FindingAggregator]) [FindingAggregator])
    -> Maybe [FindingAggregator]
    -> Const (First [FindingAggregator]) (Maybe [FindingAggregator]))
-> Getting
     (First [FindingAggregator])
     ListFindingAggregatorsResponse
     [FindingAggregator]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FindingAggregator]
 -> Const (First [FindingAggregator]) [FindingAggregator])
-> Maybe [FindingAggregator]
-> Const (First [FindingAggregator]) (Maybe [FindingAggregator])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListFindingAggregators
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListFindingAggregators -> Maybe ListFindingAggregators
forall a. a -> Maybe a
Prelude.Just (ListFindingAggregators -> Maybe ListFindingAggregators)
-> ListFindingAggregators -> Maybe ListFindingAggregators
forall a b. (a -> b) -> a -> b
Prelude.$
        ListFindingAggregators
rq
          ListFindingAggregators
-> (ListFindingAggregators -> ListFindingAggregators)
-> ListFindingAggregators
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListFindingAggregators -> Identity ListFindingAggregators
Lens
  ListFindingAggregators
  ListFindingAggregators
  (Maybe Text)
  (Maybe Text)
listFindingAggregators_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListFindingAggregators -> Identity ListFindingAggregators)
-> Maybe Text -> ListFindingAggregators -> ListFindingAggregators
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFindingAggregators
ListFindingAggregatorsResponse
rs
          ListFindingAggregatorsResponse
-> Getting (First Text) ListFindingAggregatorsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFindingAggregatorsResponse
-> Const (First Text) ListFindingAggregatorsResponse
Lens' ListFindingAggregatorsResponse (Maybe Text)
listFindingAggregatorsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFindingAggregatorsResponse
 -> Const (First Text) ListFindingAggregatorsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFindingAggregatorsResponse 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 ListFindingAggregators where
  type
    AWSResponse ListFindingAggregators =
      ListFindingAggregatorsResponse
  request :: ListFindingAggregators -> Request ListFindingAggregators
request = Service -> ListFindingAggregators -> Request ListFindingAggregators
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFindingAggregators
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFindingAggregators)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFindingAggregators))
-> Logger
-> Service
-> Proxy ListFindingAggregators
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFindingAggregators)))
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
-> Maybe [FindingAggregator]
-> Int
-> ListFindingAggregatorsResponse
ListFindingAggregatorsResponse'
            (Maybe Text
 -> Maybe [FindingAggregator]
 -> Int
 -> ListFindingAggregatorsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [FindingAggregator]
      -> Int -> ListFindingAggregatorsResponse)
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
  (Maybe [FindingAggregator]
   -> Int -> ListFindingAggregatorsResponse)
-> Either String (Maybe [FindingAggregator])
-> Either String (Int -> ListFindingAggregatorsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [FindingAggregator]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FindingAggregators"
                            Either String (Maybe (Maybe [FindingAggregator]))
-> Maybe [FindingAggregator]
-> Either String (Maybe [FindingAggregator])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FindingAggregator]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListFindingAggregatorsResponse)
-> Either String Int
-> Either String ListFindingAggregatorsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListFindingAggregators

instance Prelude.NFData ListFindingAggregators

instance Core.ToHeaders ListFindingAggregators where
  toHeaders :: ListFindingAggregators -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFindingAggregators -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListFindingAggregators where
  toPath :: ListFindingAggregators -> ByteString
toPath = ByteString -> ListFindingAggregators -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/findingAggregator/list"

instance Core.ToQuery ListFindingAggregators where
  toQuery :: ListFindingAggregators -> QueryString
toQuery ListFindingAggregators' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListFindingAggregators' :: ListFindingAggregators -> Maybe Natural
$sel:nextToken:ListFindingAggregators' :: ListFindingAggregators -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListFindingAggregatorsResponse' smart constructor.
data ListFindingAggregatorsResponse = ListFindingAggregatorsResponse'
  { -- | If there are more results, this is the token to provide in the next call
    -- to @ListFindingAggregators@.
    --
    -- This operation currently only returns a single result.
    ListFindingAggregatorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of finding aggregators. This operation currently only returns a
    -- single result.
    ListFindingAggregatorsResponse -> Maybe [FindingAggregator]
findingAggregators :: Prelude.Maybe [FindingAggregator],
    -- | The response's http status code.
    ListFindingAggregatorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFindingAggregatorsResponse
-> ListFindingAggregatorsResponse -> Bool
(ListFindingAggregatorsResponse
 -> ListFindingAggregatorsResponse -> Bool)
-> (ListFindingAggregatorsResponse
    -> ListFindingAggregatorsResponse -> Bool)
-> Eq ListFindingAggregatorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFindingAggregatorsResponse
-> ListFindingAggregatorsResponse -> Bool
$c/= :: ListFindingAggregatorsResponse
-> ListFindingAggregatorsResponse -> Bool
== :: ListFindingAggregatorsResponse
-> ListFindingAggregatorsResponse -> Bool
$c== :: ListFindingAggregatorsResponse
-> ListFindingAggregatorsResponse -> Bool
Prelude.Eq, ReadPrec [ListFindingAggregatorsResponse]
ReadPrec ListFindingAggregatorsResponse
Int -> ReadS ListFindingAggregatorsResponse
ReadS [ListFindingAggregatorsResponse]
(Int -> ReadS ListFindingAggregatorsResponse)
-> ReadS [ListFindingAggregatorsResponse]
-> ReadPrec ListFindingAggregatorsResponse
-> ReadPrec [ListFindingAggregatorsResponse]
-> Read ListFindingAggregatorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFindingAggregatorsResponse]
$creadListPrec :: ReadPrec [ListFindingAggregatorsResponse]
readPrec :: ReadPrec ListFindingAggregatorsResponse
$creadPrec :: ReadPrec ListFindingAggregatorsResponse
readList :: ReadS [ListFindingAggregatorsResponse]
$creadList :: ReadS [ListFindingAggregatorsResponse]
readsPrec :: Int -> ReadS ListFindingAggregatorsResponse
$creadsPrec :: Int -> ReadS ListFindingAggregatorsResponse
Prelude.Read, Int -> ListFindingAggregatorsResponse -> ShowS
[ListFindingAggregatorsResponse] -> ShowS
ListFindingAggregatorsResponse -> String
(Int -> ListFindingAggregatorsResponse -> ShowS)
-> (ListFindingAggregatorsResponse -> String)
-> ([ListFindingAggregatorsResponse] -> ShowS)
-> Show ListFindingAggregatorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFindingAggregatorsResponse] -> ShowS
$cshowList :: [ListFindingAggregatorsResponse] -> ShowS
show :: ListFindingAggregatorsResponse -> String
$cshow :: ListFindingAggregatorsResponse -> String
showsPrec :: Int -> ListFindingAggregatorsResponse -> ShowS
$cshowsPrec :: Int -> ListFindingAggregatorsResponse -> ShowS
Prelude.Show, (forall x.
 ListFindingAggregatorsResponse
 -> Rep ListFindingAggregatorsResponse x)
-> (forall x.
    Rep ListFindingAggregatorsResponse x
    -> ListFindingAggregatorsResponse)
-> Generic ListFindingAggregatorsResponse
forall x.
Rep ListFindingAggregatorsResponse x
-> ListFindingAggregatorsResponse
forall x.
ListFindingAggregatorsResponse
-> Rep ListFindingAggregatorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFindingAggregatorsResponse x
-> ListFindingAggregatorsResponse
$cfrom :: forall x.
ListFindingAggregatorsResponse
-> Rep ListFindingAggregatorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFindingAggregatorsResponse' 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', 'listFindingAggregatorsResponse_nextToken' - If there are more results, this is the token to provide in the next call
-- to @ListFindingAggregators@.
--
-- This operation currently only returns a single result.
--
-- 'findingAggregators', 'listFindingAggregatorsResponse_findingAggregators' - The list of finding aggregators. This operation currently only returns a
-- single result.
--
-- 'httpStatus', 'listFindingAggregatorsResponse_httpStatus' - The response's http status code.
newListFindingAggregatorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFindingAggregatorsResponse
newListFindingAggregatorsResponse :: Int -> ListFindingAggregatorsResponse
newListFindingAggregatorsResponse Int
pHttpStatus_ =
  ListFindingAggregatorsResponse' :: Maybe Text
-> Maybe [FindingAggregator]
-> Int
-> ListFindingAggregatorsResponse
ListFindingAggregatorsResponse'
    { $sel:nextToken:ListFindingAggregatorsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:findingAggregators:ListFindingAggregatorsResponse' :: Maybe [FindingAggregator]
findingAggregators = Maybe [FindingAggregator]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFindingAggregatorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If there are more results, this is the token to provide in the next call
-- to @ListFindingAggregators@.
--
-- This operation currently only returns a single result.
listFindingAggregatorsResponse_nextToken :: Lens.Lens' ListFindingAggregatorsResponse (Prelude.Maybe Prelude.Text)
listFindingAggregatorsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFindingAggregatorsResponse
-> f ListFindingAggregatorsResponse
listFindingAggregatorsResponse_nextToken = (ListFindingAggregatorsResponse -> Maybe Text)
-> (ListFindingAggregatorsResponse
    -> Maybe Text -> ListFindingAggregatorsResponse)
-> Lens' ListFindingAggregatorsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingAggregatorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFindingAggregatorsResponse' :: ListFindingAggregatorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFindingAggregatorsResponse
s@ListFindingAggregatorsResponse' {} Maybe Text
a -> ListFindingAggregatorsResponse
s {$sel:nextToken:ListFindingAggregatorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFindingAggregatorsResponse)

-- | The list of finding aggregators. This operation currently only returns a
-- single result.
listFindingAggregatorsResponse_findingAggregators :: Lens.Lens' ListFindingAggregatorsResponse (Prelude.Maybe [FindingAggregator])
listFindingAggregatorsResponse_findingAggregators :: (Maybe [FindingAggregator] -> f (Maybe [FindingAggregator]))
-> ListFindingAggregatorsResponse
-> f ListFindingAggregatorsResponse
listFindingAggregatorsResponse_findingAggregators = (ListFindingAggregatorsResponse -> Maybe [FindingAggregator])
-> (ListFindingAggregatorsResponse
    -> Maybe [FindingAggregator] -> ListFindingAggregatorsResponse)
-> Lens' ListFindingAggregatorsResponse (Maybe [FindingAggregator])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingAggregatorsResponse' {Maybe [FindingAggregator]
findingAggregators :: Maybe [FindingAggregator]
$sel:findingAggregators:ListFindingAggregatorsResponse' :: ListFindingAggregatorsResponse -> Maybe [FindingAggregator]
findingAggregators} -> Maybe [FindingAggregator]
findingAggregators) (\s :: ListFindingAggregatorsResponse
s@ListFindingAggregatorsResponse' {} Maybe [FindingAggregator]
a -> ListFindingAggregatorsResponse
s {$sel:findingAggregators:ListFindingAggregatorsResponse' :: Maybe [FindingAggregator]
findingAggregators = Maybe [FindingAggregator]
a} :: ListFindingAggregatorsResponse) ((Maybe [FindingAggregator] -> f (Maybe [FindingAggregator]))
 -> ListFindingAggregatorsResponse
 -> f ListFindingAggregatorsResponse)
-> ((Maybe [FindingAggregator] -> f (Maybe [FindingAggregator]))
    -> Maybe [FindingAggregator] -> f (Maybe [FindingAggregator]))
-> (Maybe [FindingAggregator] -> f (Maybe [FindingAggregator]))
-> ListFindingAggregatorsResponse
-> f ListFindingAggregatorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FindingAggregator]
  [FindingAggregator]
  [FindingAggregator]
  [FindingAggregator]
-> Iso
     (Maybe [FindingAggregator])
     (Maybe [FindingAggregator])
     (Maybe [FindingAggregator])
     (Maybe [FindingAggregator])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [FindingAggregator]
  [FindingAggregator]
  [FindingAggregator]
  [FindingAggregator]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListFindingAggregatorsResponse