{-# 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.ListRulesPackages
-- 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 available Amazon Inspector rules packages.
--
-- This operation returns paginated results.
module Amazonka.Inspector.ListRulesPackages
  ( -- * Creating a Request
    ListRulesPackages (..),
    newListRulesPackages,

    -- * Request Lenses
    listRulesPackages_nextToken,
    listRulesPackages_maxResults,

    -- * Destructuring the Response
    ListRulesPackagesResponse (..),
    newListRulesPackagesResponse,

    -- * Response Lenses
    listRulesPackagesResponse_nextToken,
    listRulesPackagesResponse_httpStatus,
    listRulesPackagesResponse_rulesPackageArns,
  )
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:/ 'newListRulesPackages' smart constructor.
data ListRulesPackages = ListRulesPackages'
  { -- | You can use this parameter when paginating results. Set the value of
    -- this parameter to null on your first call to the __ListRulesPackages__
    -- action. Subsequent calls to the action fill __nextToken__ in the request
    -- with the value of __NextToken__ from the previous response to continue
    -- listing data.
    ListRulesPackages -> Maybe Text
nextToken :: 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.
    ListRulesPackages -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListRulesPackages -> ListRulesPackages -> Bool
(ListRulesPackages -> ListRulesPackages -> Bool)
-> (ListRulesPackages -> ListRulesPackages -> Bool)
-> Eq ListRulesPackages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRulesPackages -> ListRulesPackages -> Bool
$c/= :: ListRulesPackages -> ListRulesPackages -> Bool
== :: ListRulesPackages -> ListRulesPackages -> Bool
$c== :: ListRulesPackages -> ListRulesPackages -> Bool
Prelude.Eq, ReadPrec [ListRulesPackages]
ReadPrec ListRulesPackages
Int -> ReadS ListRulesPackages
ReadS [ListRulesPackages]
(Int -> ReadS ListRulesPackages)
-> ReadS [ListRulesPackages]
-> ReadPrec ListRulesPackages
-> ReadPrec [ListRulesPackages]
-> Read ListRulesPackages
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRulesPackages]
$creadListPrec :: ReadPrec [ListRulesPackages]
readPrec :: ReadPrec ListRulesPackages
$creadPrec :: ReadPrec ListRulesPackages
readList :: ReadS [ListRulesPackages]
$creadList :: ReadS [ListRulesPackages]
readsPrec :: Int -> ReadS ListRulesPackages
$creadsPrec :: Int -> ReadS ListRulesPackages
Prelude.Read, Int -> ListRulesPackages -> ShowS
[ListRulesPackages] -> ShowS
ListRulesPackages -> String
(Int -> ListRulesPackages -> ShowS)
-> (ListRulesPackages -> String)
-> ([ListRulesPackages] -> ShowS)
-> Show ListRulesPackages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRulesPackages] -> ShowS
$cshowList :: [ListRulesPackages] -> ShowS
show :: ListRulesPackages -> String
$cshow :: ListRulesPackages -> String
showsPrec :: Int -> ListRulesPackages -> ShowS
$cshowsPrec :: Int -> ListRulesPackages -> ShowS
Prelude.Show, (forall x. ListRulesPackages -> Rep ListRulesPackages x)
-> (forall x. Rep ListRulesPackages x -> ListRulesPackages)
-> Generic ListRulesPackages
forall x. Rep ListRulesPackages x -> ListRulesPackages
forall x. ListRulesPackages -> Rep ListRulesPackages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRulesPackages x -> ListRulesPackages
$cfrom :: forall x. ListRulesPackages -> Rep ListRulesPackages x
Prelude.Generic)

-- |
-- Create a value of 'ListRulesPackages' 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', 'listRulesPackages_nextToken' - You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the __ListRulesPackages__
-- action. Subsequent calls to the action fill __nextToken__ in the request
-- with the value of __NextToken__ from the previous response to continue
-- listing data.
--
-- 'maxResults', 'listRulesPackages_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.
newListRulesPackages ::
  ListRulesPackages
newListRulesPackages :: ListRulesPackages
newListRulesPackages =
  ListRulesPackages' :: Maybe Text -> Maybe Int -> ListRulesPackages
ListRulesPackages'
    { $sel:nextToken:ListRulesPackages' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRulesPackages' :: 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 __ListRulesPackages__
-- action. Subsequent calls to the action fill __nextToken__ in the request
-- with the value of __NextToken__ from the previous response to continue
-- listing data.
listRulesPackages_nextToken :: Lens.Lens' ListRulesPackages (Prelude.Maybe Prelude.Text)
listRulesPackages_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRulesPackages -> f ListRulesPackages
listRulesPackages_nextToken = (ListRulesPackages -> Maybe Text)
-> (ListRulesPackages -> Maybe Text -> ListRulesPackages)
-> Lens
     ListRulesPackages ListRulesPackages (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesPackages' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRulesPackages' :: ListRulesPackages -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRulesPackages
s@ListRulesPackages' {} Maybe Text
a -> ListRulesPackages
s {$sel:nextToken:ListRulesPackages' :: Maybe Text
nextToken = Maybe Text
a} :: ListRulesPackages)

-- | 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.
listRulesPackages_maxResults :: Lens.Lens' ListRulesPackages (Prelude.Maybe Prelude.Int)
listRulesPackages_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListRulesPackages -> f ListRulesPackages
listRulesPackages_maxResults = (ListRulesPackages -> Maybe Int)
-> (ListRulesPackages -> Maybe Int -> ListRulesPackages)
-> Lens ListRulesPackages ListRulesPackages (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesPackages' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListRulesPackages' :: ListRulesPackages -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListRulesPackages
s@ListRulesPackages' {} Maybe Int
a -> ListRulesPackages
s {$sel:maxResults:ListRulesPackages' :: Maybe Int
maxResults = Maybe Int
a} :: ListRulesPackages)

instance Core.AWSPager ListRulesPackages where
  page :: ListRulesPackages
-> AWSResponse ListRulesPackages -> Maybe ListRulesPackages
page ListRulesPackages
rq AWSResponse ListRulesPackages
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRulesPackages
ListRulesPackagesResponse
rs
            ListRulesPackagesResponse
-> Getting (First Text) ListRulesPackagesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRulesPackagesResponse
-> Const (First Text) ListRulesPackagesResponse
Lens' ListRulesPackagesResponse (Maybe Text)
listRulesPackagesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRulesPackagesResponse
 -> Const (First Text) ListRulesPackagesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRulesPackagesResponse 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 ListRulesPackages
forall a. Maybe a
Prelude.Nothing
    | [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRulesPackages
ListRulesPackagesResponse
rs
            ListRulesPackagesResponse
-> Getting [Text] ListRulesPackagesResponse [Text] -> [Text]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Text] ListRulesPackagesResponse [Text]
Lens' ListRulesPackagesResponse [Text]
listRulesPackagesResponse_rulesPackageArns
        ) =
      Maybe ListRulesPackages
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListRulesPackages -> Maybe ListRulesPackages
forall a. a -> Maybe a
Prelude.Just (ListRulesPackages -> Maybe ListRulesPackages)
-> ListRulesPackages -> Maybe ListRulesPackages
forall a b. (a -> b) -> a -> b
Prelude.$
        ListRulesPackages
rq
          ListRulesPackages
-> (ListRulesPackages -> ListRulesPackages) -> ListRulesPackages
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListRulesPackages -> Identity ListRulesPackages
Lens ListRulesPackages ListRulesPackages (Maybe Text) (Maybe Text)
listRulesPackages_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListRulesPackages -> Identity ListRulesPackages)
-> Maybe Text -> ListRulesPackages -> ListRulesPackages
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRulesPackages
ListRulesPackagesResponse
rs
          ListRulesPackagesResponse
-> Getting (First Text) ListRulesPackagesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRulesPackagesResponse
-> Const (First Text) ListRulesPackagesResponse
Lens' ListRulesPackagesResponse (Maybe Text)
listRulesPackagesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRulesPackagesResponse
 -> Const (First Text) ListRulesPackagesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRulesPackagesResponse 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 ListRulesPackages where
  type
    AWSResponse ListRulesPackages =
      ListRulesPackagesResponse
  request :: ListRulesPackages -> Request ListRulesPackages
request = Service -> ListRulesPackages -> Request ListRulesPackages
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListRulesPackages
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRulesPackages)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListRulesPackages))
-> Logger
-> Service
-> Proxy ListRulesPackages
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRulesPackages)))
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] -> ListRulesPackagesResponse
ListRulesPackagesResponse'
            (Maybe Text -> Int -> [Text] -> ListRulesPackagesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [Text] -> ListRulesPackagesResponse)
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] -> ListRulesPackagesResponse)
-> Either String Int
-> Either String ([Text] -> ListRulesPackagesResponse)
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] -> ListRulesPackagesResponse)
-> Either String [Text] -> Either String ListRulesPackagesResponse
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
"rulesPackageArns"
                            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 ListRulesPackages

instance Prelude.NFData ListRulesPackages

instance Core.ToHeaders ListRulesPackages where
  toHeaders :: ListRulesPackages -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRulesPackages -> 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.ListRulesPackages" ::
                          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 ListRulesPackages where
  toJSON :: ListRulesPackages -> Value
toJSON ListRulesPackages' {Maybe Int
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:maxResults:ListRulesPackages' :: ListRulesPackages -> Maybe Int
$sel:nextToken:ListRulesPackages' :: ListRulesPackages -> 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
"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 ListRulesPackages where
  toPath :: ListRulesPackages -> ByteString
toPath = ByteString -> ListRulesPackages -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListRulesPackagesResponse' smart constructor.
data ListRulesPackagesResponse = ListRulesPackagesResponse'
  { -- | 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.
    ListRulesPackagesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRulesPackagesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of ARNs that specifies the rules packages returned by the
    -- action.
    ListRulesPackagesResponse -> [Text]
rulesPackageArns :: [Prelude.Text]
  }
  deriving (ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool
(ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool)
-> (ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool)
-> Eq ListRulesPackagesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool
$c/= :: ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool
== :: ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool
$c== :: ListRulesPackagesResponse -> ListRulesPackagesResponse -> Bool
Prelude.Eq, ReadPrec [ListRulesPackagesResponse]
ReadPrec ListRulesPackagesResponse
Int -> ReadS ListRulesPackagesResponse
ReadS [ListRulesPackagesResponse]
(Int -> ReadS ListRulesPackagesResponse)
-> ReadS [ListRulesPackagesResponse]
-> ReadPrec ListRulesPackagesResponse
-> ReadPrec [ListRulesPackagesResponse]
-> Read ListRulesPackagesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRulesPackagesResponse]
$creadListPrec :: ReadPrec [ListRulesPackagesResponse]
readPrec :: ReadPrec ListRulesPackagesResponse
$creadPrec :: ReadPrec ListRulesPackagesResponse
readList :: ReadS [ListRulesPackagesResponse]
$creadList :: ReadS [ListRulesPackagesResponse]
readsPrec :: Int -> ReadS ListRulesPackagesResponse
$creadsPrec :: Int -> ReadS ListRulesPackagesResponse
Prelude.Read, Int -> ListRulesPackagesResponse -> ShowS
[ListRulesPackagesResponse] -> ShowS
ListRulesPackagesResponse -> String
(Int -> ListRulesPackagesResponse -> ShowS)
-> (ListRulesPackagesResponse -> String)
-> ([ListRulesPackagesResponse] -> ShowS)
-> Show ListRulesPackagesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRulesPackagesResponse] -> ShowS
$cshowList :: [ListRulesPackagesResponse] -> ShowS
show :: ListRulesPackagesResponse -> String
$cshow :: ListRulesPackagesResponse -> String
showsPrec :: Int -> ListRulesPackagesResponse -> ShowS
$cshowsPrec :: Int -> ListRulesPackagesResponse -> ShowS
Prelude.Show, (forall x.
 ListRulesPackagesResponse -> Rep ListRulesPackagesResponse x)
-> (forall x.
    Rep ListRulesPackagesResponse x -> ListRulesPackagesResponse)
-> Generic ListRulesPackagesResponse
forall x.
Rep ListRulesPackagesResponse x -> ListRulesPackagesResponse
forall x.
ListRulesPackagesResponse -> Rep ListRulesPackagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRulesPackagesResponse x -> ListRulesPackagesResponse
$cfrom :: forall x.
ListRulesPackagesResponse -> Rep ListRulesPackagesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRulesPackagesResponse' 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', 'listRulesPackagesResponse_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', 'listRulesPackagesResponse_httpStatus' - The response's http status code.
--
-- 'rulesPackageArns', 'listRulesPackagesResponse_rulesPackageArns' - The list of ARNs that specifies the rules packages returned by the
-- action.
newListRulesPackagesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRulesPackagesResponse
newListRulesPackagesResponse :: Int -> ListRulesPackagesResponse
newListRulesPackagesResponse Int
pHttpStatus_ =
  ListRulesPackagesResponse' :: Maybe Text -> Int -> [Text] -> ListRulesPackagesResponse
ListRulesPackagesResponse'
    { $sel:nextToken:ListRulesPackagesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRulesPackagesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:rulesPackageArns:ListRulesPackagesResponse' :: [Text]
rulesPackageArns = [Text]
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.
listRulesPackagesResponse_nextToken :: Lens.Lens' ListRulesPackagesResponse (Prelude.Maybe Prelude.Text)
listRulesPackagesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRulesPackagesResponse -> f ListRulesPackagesResponse
listRulesPackagesResponse_nextToken = (ListRulesPackagesResponse -> Maybe Text)
-> (ListRulesPackagesResponse
    -> Maybe Text -> ListRulesPackagesResponse)
-> Lens' ListRulesPackagesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesPackagesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRulesPackagesResponse' :: ListRulesPackagesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRulesPackagesResponse
s@ListRulesPackagesResponse' {} Maybe Text
a -> ListRulesPackagesResponse
s {$sel:nextToken:ListRulesPackagesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRulesPackagesResponse)

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

-- | The list of ARNs that specifies the rules packages returned by the
-- action.
listRulesPackagesResponse_rulesPackageArns :: Lens.Lens' ListRulesPackagesResponse [Prelude.Text]
listRulesPackagesResponse_rulesPackageArns :: ([Text] -> f [Text])
-> ListRulesPackagesResponse -> f ListRulesPackagesResponse
listRulesPackagesResponse_rulesPackageArns = (ListRulesPackagesResponse -> [Text])
-> (ListRulesPackagesResponse
    -> [Text] -> ListRulesPackagesResponse)
-> Lens' ListRulesPackagesResponse [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesPackagesResponse' {[Text]
rulesPackageArns :: [Text]
$sel:rulesPackageArns:ListRulesPackagesResponse' :: ListRulesPackagesResponse -> [Text]
rulesPackageArns} -> [Text]
rulesPackageArns) (\s :: ListRulesPackagesResponse
s@ListRulesPackagesResponse' {} [Text]
a -> ListRulesPackagesResponse
s {$sel:rulesPackageArns:ListRulesPackagesResponse' :: [Text]
rulesPackageArns = [Text]
a} :: ListRulesPackagesResponse) (([Text] -> f [Text])
 -> ListRulesPackagesResponse -> f ListRulesPackagesResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListRulesPackagesResponse
-> f ListRulesPackagesResponse
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 ListRulesPackagesResponse