{-# 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.GuardDuty.ListThreatIntelSets
-- 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 the ThreatIntelSets of the GuardDuty service specified by the
-- detector ID. If you use this operation from a member account, the
-- ThreatIntelSets associated with the administrator account are returned.
--
-- This operation returns paginated results.
module Amazonka.GuardDuty.ListThreatIntelSets
  ( -- * Creating a Request
    ListThreatIntelSets (..),
    newListThreatIntelSets,

    -- * Request Lenses
    listThreatIntelSets_nextToken,
    listThreatIntelSets_maxResults,
    listThreatIntelSets_detectorId,

    -- * Destructuring the Response
    ListThreatIntelSetsResponse (..),
    newListThreatIntelSetsResponse,

    -- * Response Lenses
    listThreatIntelSetsResponse_nextToken,
    listThreatIntelSetsResponse_httpStatus,
    listThreatIntelSetsResponse_threatIntelSetIds,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.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:/ 'newListThreatIntelSets' smart constructor.
data ListThreatIntelSets = ListThreatIntelSets'
  { -- | You can use this parameter to paginate results in the response. Set the
    -- value of this parameter to null on your first call to the list action.
    -- For subsequent calls to the action, fill nextToken in the request with
    -- the value of NextToken from the previous response to continue listing
    -- data.
    ListThreatIntelSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | You can use this parameter to indicate the maximum number of items that
    -- you want in the response. The default value is 50. The maximum value is
    -- 50.
    ListThreatIntelSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique ID of the detector that the threatIntelSet is associated
    -- with.
    ListThreatIntelSets -> Text
detectorId :: Prelude.Text
  }
  deriving (ListThreatIntelSets -> ListThreatIntelSets -> Bool
(ListThreatIntelSets -> ListThreatIntelSets -> Bool)
-> (ListThreatIntelSets -> ListThreatIntelSets -> Bool)
-> Eq ListThreatIntelSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThreatIntelSets -> ListThreatIntelSets -> Bool
$c/= :: ListThreatIntelSets -> ListThreatIntelSets -> Bool
== :: ListThreatIntelSets -> ListThreatIntelSets -> Bool
$c== :: ListThreatIntelSets -> ListThreatIntelSets -> Bool
Prelude.Eq, ReadPrec [ListThreatIntelSets]
ReadPrec ListThreatIntelSets
Int -> ReadS ListThreatIntelSets
ReadS [ListThreatIntelSets]
(Int -> ReadS ListThreatIntelSets)
-> ReadS [ListThreatIntelSets]
-> ReadPrec ListThreatIntelSets
-> ReadPrec [ListThreatIntelSets]
-> Read ListThreatIntelSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThreatIntelSets]
$creadListPrec :: ReadPrec [ListThreatIntelSets]
readPrec :: ReadPrec ListThreatIntelSets
$creadPrec :: ReadPrec ListThreatIntelSets
readList :: ReadS [ListThreatIntelSets]
$creadList :: ReadS [ListThreatIntelSets]
readsPrec :: Int -> ReadS ListThreatIntelSets
$creadsPrec :: Int -> ReadS ListThreatIntelSets
Prelude.Read, Int -> ListThreatIntelSets -> ShowS
[ListThreatIntelSets] -> ShowS
ListThreatIntelSets -> String
(Int -> ListThreatIntelSets -> ShowS)
-> (ListThreatIntelSets -> String)
-> ([ListThreatIntelSets] -> ShowS)
-> Show ListThreatIntelSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThreatIntelSets] -> ShowS
$cshowList :: [ListThreatIntelSets] -> ShowS
show :: ListThreatIntelSets -> String
$cshow :: ListThreatIntelSets -> String
showsPrec :: Int -> ListThreatIntelSets -> ShowS
$cshowsPrec :: Int -> ListThreatIntelSets -> ShowS
Prelude.Show, (forall x. ListThreatIntelSets -> Rep ListThreatIntelSets x)
-> (forall x. Rep ListThreatIntelSets x -> ListThreatIntelSets)
-> Generic ListThreatIntelSets
forall x. Rep ListThreatIntelSets x -> ListThreatIntelSets
forall x. ListThreatIntelSets -> Rep ListThreatIntelSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThreatIntelSets x -> ListThreatIntelSets
$cfrom :: forall x. ListThreatIntelSets -> Rep ListThreatIntelSets x
Prelude.Generic)

-- |
-- Create a value of 'ListThreatIntelSets' 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', 'listThreatIntelSets_nextToken' - You can use this parameter to paginate results in the response. Set the
-- value of this parameter to null on your first call to the list action.
-- For subsequent calls to the action, fill nextToken in the request with
-- the value of NextToken from the previous response to continue listing
-- data.
--
-- 'maxResults', 'listThreatIntelSets_maxResults' - You can use this parameter to indicate the maximum number of items that
-- you want in the response. The default value is 50. The maximum value is
-- 50.
--
-- 'detectorId', 'listThreatIntelSets_detectorId' - The unique ID of the detector that the threatIntelSet is associated
-- with.
newListThreatIntelSets ::
  -- | 'detectorId'
  Prelude.Text ->
  ListThreatIntelSets
newListThreatIntelSets :: Text -> ListThreatIntelSets
newListThreatIntelSets Text
pDetectorId_ =
  ListThreatIntelSets' :: Maybe Text -> Maybe Natural -> Text -> ListThreatIntelSets
ListThreatIntelSets'
    { $sel:nextToken:ListThreatIntelSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListThreatIntelSets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:detectorId:ListThreatIntelSets' :: Text
detectorId = Text
pDetectorId_
    }

-- | You can use this parameter to paginate results in the response. Set the
-- value of this parameter to null on your first call to the list action.
-- For subsequent calls to the action, fill nextToken in the request with
-- the value of NextToken from the previous response to continue listing
-- data.
listThreatIntelSets_nextToken :: Lens.Lens' ListThreatIntelSets (Prelude.Maybe Prelude.Text)
listThreatIntelSets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThreatIntelSets -> f ListThreatIntelSets
listThreatIntelSets_nextToken = (ListThreatIntelSets -> Maybe Text)
-> (ListThreatIntelSets -> Maybe Text -> ListThreatIntelSets)
-> Lens
     ListThreatIntelSets ListThreatIntelSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThreatIntelSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThreatIntelSets' :: ListThreatIntelSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThreatIntelSets
s@ListThreatIntelSets' {} Maybe Text
a -> ListThreatIntelSets
s {$sel:nextToken:ListThreatIntelSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListThreatIntelSets)

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

-- | The unique ID of the detector that the threatIntelSet is associated
-- with.
listThreatIntelSets_detectorId :: Lens.Lens' ListThreatIntelSets Prelude.Text
listThreatIntelSets_detectorId :: (Text -> f Text) -> ListThreatIntelSets -> f ListThreatIntelSets
listThreatIntelSets_detectorId = (ListThreatIntelSets -> Text)
-> (ListThreatIntelSets -> Text -> ListThreatIntelSets)
-> Lens ListThreatIntelSets ListThreatIntelSets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThreatIntelSets' {Text
detectorId :: Text
$sel:detectorId:ListThreatIntelSets' :: ListThreatIntelSets -> Text
detectorId} -> Text
detectorId) (\s :: ListThreatIntelSets
s@ListThreatIntelSets' {} Text
a -> ListThreatIntelSets
s {$sel:detectorId:ListThreatIntelSets' :: Text
detectorId = Text
a} :: ListThreatIntelSets)

instance Core.AWSPager ListThreatIntelSets where
  page :: ListThreatIntelSets
-> AWSResponse ListThreatIntelSets -> Maybe ListThreatIntelSets
page ListThreatIntelSets
rq AWSResponse ListThreatIntelSets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThreatIntelSets
ListThreatIntelSetsResponse
rs
            ListThreatIntelSetsResponse
-> Getting (First Text) ListThreatIntelSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThreatIntelSetsResponse
-> Const (First Text) ListThreatIntelSetsResponse
Lens' ListThreatIntelSetsResponse (Maybe Text)
listThreatIntelSetsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListThreatIntelSetsResponse
 -> Const (First Text) ListThreatIntelSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThreatIntelSetsResponse 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 ListThreatIntelSets
forall a. Maybe a
Prelude.Nothing
    | [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThreatIntelSets
ListThreatIntelSetsResponse
rs
            ListThreatIntelSetsResponse
-> Getting [Text] ListThreatIntelSetsResponse [Text] -> [Text]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Text] ListThreatIntelSetsResponse [Text]
Lens' ListThreatIntelSetsResponse [Text]
listThreatIntelSetsResponse_threatIntelSetIds
        ) =
      Maybe ListThreatIntelSets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListThreatIntelSets -> Maybe ListThreatIntelSets
forall a. a -> Maybe a
Prelude.Just (ListThreatIntelSets -> Maybe ListThreatIntelSets)
-> ListThreatIntelSets -> Maybe ListThreatIntelSets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListThreatIntelSets
rq
          ListThreatIntelSets
-> (ListThreatIntelSets -> ListThreatIntelSets)
-> ListThreatIntelSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListThreatIntelSets -> Identity ListThreatIntelSets
Lens
  ListThreatIntelSets ListThreatIntelSets (Maybe Text) (Maybe Text)
listThreatIntelSets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListThreatIntelSets -> Identity ListThreatIntelSets)
-> Maybe Text -> ListThreatIntelSets -> ListThreatIntelSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThreatIntelSets
ListThreatIntelSetsResponse
rs
          ListThreatIntelSetsResponse
-> Getting (First Text) ListThreatIntelSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThreatIntelSetsResponse
-> Const (First Text) ListThreatIntelSetsResponse
Lens' ListThreatIntelSetsResponse (Maybe Text)
listThreatIntelSetsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListThreatIntelSetsResponse
 -> Const (First Text) ListThreatIntelSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThreatIntelSetsResponse 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 ListThreatIntelSets where
  type
    AWSResponse ListThreatIntelSets =
      ListThreatIntelSetsResponse
  request :: ListThreatIntelSets -> Request ListThreatIntelSets
request = Service -> ListThreatIntelSets -> Request ListThreatIntelSets
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListThreatIntelSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListThreatIntelSets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListThreatIntelSets))
-> Logger
-> Service
-> Proxy ListThreatIntelSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListThreatIntelSets)))
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 -> [Text] -> ListThreatIntelSetsResponse
ListThreatIntelSetsResponse'
            (Maybe Text -> Int -> [Text] -> ListThreatIntelSetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [Text] -> ListThreatIntelSetsResponse)
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 -> [Text] -> ListThreatIntelSetsResponse)
-> Either String Int
-> Either String ([Text] -> ListThreatIntelSetsResponse)
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 ([Text] -> ListThreatIntelSetsResponse)
-> Either String [Text]
-> Either String ListThreatIntelSetsResponse
forall (f :: * -> *) a b. Applicative f => 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
"threatIntelSetIds"
                            Either String (Maybe [Text]) -> [Text] -> Either String [Text]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListThreatIntelSets

instance Prelude.NFData ListThreatIntelSets

instance Core.ToHeaders ListThreatIntelSets where
  toHeaders :: ListThreatIntelSets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListThreatIntelSets -> 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 ListThreatIntelSets where
  toPath :: ListThreatIntelSets -> ByteString
toPath ListThreatIntelSets' {Maybe Natural
Maybe Text
Text
detectorId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:detectorId:ListThreatIntelSets' :: ListThreatIntelSets -> Text
$sel:maxResults:ListThreatIntelSets' :: ListThreatIntelSets -> Maybe Natural
$sel:nextToken:ListThreatIntelSets' :: ListThreatIntelSets -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/detector/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId,
        ByteString
"/threatintelset"
      ]

instance Core.ToQuery ListThreatIntelSets where
  toQuery :: ListThreatIntelSets -> QueryString
toQuery ListThreatIntelSets' {Maybe Natural
Maybe Text
Text
detectorId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:detectorId:ListThreatIntelSets' :: ListThreatIntelSets -> Text
$sel:maxResults:ListThreatIntelSets' :: ListThreatIntelSets -> Maybe Natural
$sel:nextToken:ListThreatIntelSets' :: ListThreatIntelSets -> 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:/ 'newListThreatIntelSetsResponse' smart constructor.
data ListThreatIntelSetsResponse = ListThreatIntelSetsResponse'
  { -- | The pagination parameter to be used on the next list operation to
    -- retrieve more items.
    ListThreatIntelSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListThreatIntelSetsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The IDs of the ThreatIntelSet resources.
    ListThreatIntelSetsResponse -> [Text]
threatIntelSetIds :: [Prelude.Text]
  }
  deriving (ListThreatIntelSetsResponse -> ListThreatIntelSetsResponse -> Bool
(ListThreatIntelSetsResponse
 -> ListThreatIntelSetsResponse -> Bool)
-> (ListThreatIntelSetsResponse
    -> ListThreatIntelSetsResponse -> Bool)
-> Eq ListThreatIntelSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThreatIntelSetsResponse -> ListThreatIntelSetsResponse -> Bool
$c/= :: ListThreatIntelSetsResponse -> ListThreatIntelSetsResponse -> Bool
== :: ListThreatIntelSetsResponse -> ListThreatIntelSetsResponse -> Bool
$c== :: ListThreatIntelSetsResponse -> ListThreatIntelSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListThreatIntelSetsResponse]
ReadPrec ListThreatIntelSetsResponse
Int -> ReadS ListThreatIntelSetsResponse
ReadS [ListThreatIntelSetsResponse]
(Int -> ReadS ListThreatIntelSetsResponse)
-> ReadS [ListThreatIntelSetsResponse]
-> ReadPrec ListThreatIntelSetsResponse
-> ReadPrec [ListThreatIntelSetsResponse]
-> Read ListThreatIntelSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThreatIntelSetsResponse]
$creadListPrec :: ReadPrec [ListThreatIntelSetsResponse]
readPrec :: ReadPrec ListThreatIntelSetsResponse
$creadPrec :: ReadPrec ListThreatIntelSetsResponse
readList :: ReadS [ListThreatIntelSetsResponse]
$creadList :: ReadS [ListThreatIntelSetsResponse]
readsPrec :: Int -> ReadS ListThreatIntelSetsResponse
$creadsPrec :: Int -> ReadS ListThreatIntelSetsResponse
Prelude.Read, Int -> ListThreatIntelSetsResponse -> ShowS
[ListThreatIntelSetsResponse] -> ShowS
ListThreatIntelSetsResponse -> String
(Int -> ListThreatIntelSetsResponse -> ShowS)
-> (ListThreatIntelSetsResponse -> String)
-> ([ListThreatIntelSetsResponse] -> ShowS)
-> Show ListThreatIntelSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThreatIntelSetsResponse] -> ShowS
$cshowList :: [ListThreatIntelSetsResponse] -> ShowS
show :: ListThreatIntelSetsResponse -> String
$cshow :: ListThreatIntelSetsResponse -> String
showsPrec :: Int -> ListThreatIntelSetsResponse -> ShowS
$cshowsPrec :: Int -> ListThreatIntelSetsResponse -> ShowS
Prelude.Show, (forall x.
 ListThreatIntelSetsResponse -> Rep ListThreatIntelSetsResponse x)
-> (forall x.
    Rep ListThreatIntelSetsResponse x -> ListThreatIntelSetsResponse)
-> Generic ListThreatIntelSetsResponse
forall x.
Rep ListThreatIntelSetsResponse x -> ListThreatIntelSetsResponse
forall x.
ListThreatIntelSetsResponse -> Rep ListThreatIntelSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThreatIntelSetsResponse x -> ListThreatIntelSetsResponse
$cfrom :: forall x.
ListThreatIntelSetsResponse -> Rep ListThreatIntelSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThreatIntelSetsResponse' 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', 'listThreatIntelSetsResponse_nextToken' - The pagination parameter to be used on the next list operation to
-- retrieve more items.
--
-- 'httpStatus', 'listThreatIntelSetsResponse_httpStatus' - The response's http status code.
--
-- 'threatIntelSetIds', 'listThreatIntelSetsResponse_threatIntelSetIds' - The IDs of the ThreatIntelSet resources.
newListThreatIntelSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThreatIntelSetsResponse
newListThreatIntelSetsResponse :: Int -> ListThreatIntelSetsResponse
newListThreatIntelSetsResponse Int
pHttpStatus_ =
  ListThreatIntelSetsResponse' :: Maybe Text -> Int -> [Text] -> ListThreatIntelSetsResponse
ListThreatIntelSetsResponse'
    { $sel:nextToken:ListThreatIntelSetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThreatIntelSetsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:threatIntelSetIds:ListThreatIntelSetsResponse' :: [Text]
threatIntelSetIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination parameter to be used on the next list operation to
-- retrieve more items.
listThreatIntelSetsResponse_nextToken :: Lens.Lens' ListThreatIntelSetsResponse (Prelude.Maybe Prelude.Text)
listThreatIntelSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThreatIntelSetsResponse -> f ListThreatIntelSetsResponse
listThreatIntelSetsResponse_nextToken = (ListThreatIntelSetsResponse -> Maybe Text)
-> (ListThreatIntelSetsResponse
    -> Maybe Text -> ListThreatIntelSetsResponse)
-> Lens' ListThreatIntelSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThreatIntelSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThreatIntelSetsResponse' :: ListThreatIntelSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThreatIntelSetsResponse
s@ListThreatIntelSetsResponse' {} Maybe Text
a -> ListThreatIntelSetsResponse
s {$sel:nextToken:ListThreatIntelSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThreatIntelSetsResponse)

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

-- | The IDs of the ThreatIntelSet resources.
listThreatIntelSetsResponse_threatIntelSetIds :: Lens.Lens' ListThreatIntelSetsResponse [Prelude.Text]
listThreatIntelSetsResponse_threatIntelSetIds :: ([Text] -> f [Text])
-> ListThreatIntelSetsResponse -> f ListThreatIntelSetsResponse
listThreatIntelSetsResponse_threatIntelSetIds = (ListThreatIntelSetsResponse -> [Text])
-> (ListThreatIntelSetsResponse
    -> [Text] -> ListThreatIntelSetsResponse)
-> Lens' ListThreatIntelSetsResponse [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThreatIntelSetsResponse' {[Text]
threatIntelSetIds :: [Text]
$sel:threatIntelSetIds:ListThreatIntelSetsResponse' :: ListThreatIntelSetsResponse -> [Text]
threatIntelSetIds} -> [Text]
threatIntelSetIds) (\s :: ListThreatIntelSetsResponse
s@ListThreatIntelSetsResponse' {} [Text]
a -> ListThreatIntelSetsResponse
s {$sel:threatIntelSetIds:ListThreatIntelSetsResponse' :: [Text]
threatIntelSetIds = [Text]
a} :: ListThreatIntelSetsResponse) (([Text] -> f [Text])
 -> ListThreatIntelSetsResponse -> f ListThreatIntelSetsResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListThreatIntelSetsResponse
-> f ListThreatIntelSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListThreatIntelSetsResponse