{-# 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.NetworkFirewall.ListRuleGroups
-- 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)
--
-- Retrieves the metadata for the rule groups that you have defined.
-- Depending on your setting for max results and the number of rule groups,
-- a single call might not return the full list.
--
-- This operation returns paginated results.
module Amazonka.NetworkFirewall.ListRuleGroups
  ( -- * Creating a Request
    ListRuleGroups (..),
    newListRuleGroups,

    -- * Request Lenses
    listRuleGroups_nextToken,
    listRuleGroups_maxResults,

    -- * Destructuring the Response
    ListRuleGroupsResponse (..),
    newListRuleGroupsResponse,

    -- * Response Lenses
    listRuleGroupsResponse_nextToken,
    listRuleGroupsResponse_ruleGroups,
    listRuleGroupsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListRuleGroups' smart constructor.
data ListRuleGroups = ListRuleGroups'
  { -- | When you request a list of objects with a @MaxResults@ setting, if the
    -- number of objects that are still available for retrieval exceeds the
    -- maximum you requested, Network Firewall returns a @NextToken@ value in
    -- the response. To retrieve the next batch of objects, use the token
    -- returned from the prior request in your next request.
    ListRuleGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects that you want Network Firewall to return
    -- for this request. If more objects are available, in the response,
    -- Network Firewall provides a @NextToken@ value that you can use in a
    -- subsequent call to get the next batch of objects.
    ListRuleGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListRuleGroups -> ListRuleGroups -> Bool
(ListRuleGroups -> ListRuleGroups -> Bool)
-> (ListRuleGroups -> ListRuleGroups -> Bool) -> Eq ListRuleGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRuleGroups -> ListRuleGroups -> Bool
$c/= :: ListRuleGroups -> ListRuleGroups -> Bool
== :: ListRuleGroups -> ListRuleGroups -> Bool
$c== :: ListRuleGroups -> ListRuleGroups -> Bool
Prelude.Eq, ReadPrec [ListRuleGroups]
ReadPrec ListRuleGroups
Int -> ReadS ListRuleGroups
ReadS [ListRuleGroups]
(Int -> ReadS ListRuleGroups)
-> ReadS [ListRuleGroups]
-> ReadPrec ListRuleGroups
-> ReadPrec [ListRuleGroups]
-> Read ListRuleGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRuleGroups]
$creadListPrec :: ReadPrec [ListRuleGroups]
readPrec :: ReadPrec ListRuleGroups
$creadPrec :: ReadPrec ListRuleGroups
readList :: ReadS [ListRuleGroups]
$creadList :: ReadS [ListRuleGroups]
readsPrec :: Int -> ReadS ListRuleGroups
$creadsPrec :: Int -> ReadS ListRuleGroups
Prelude.Read, Int -> ListRuleGroups -> ShowS
[ListRuleGroups] -> ShowS
ListRuleGroups -> String
(Int -> ListRuleGroups -> ShowS)
-> (ListRuleGroups -> String)
-> ([ListRuleGroups] -> ShowS)
-> Show ListRuleGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRuleGroups] -> ShowS
$cshowList :: [ListRuleGroups] -> ShowS
show :: ListRuleGroups -> String
$cshow :: ListRuleGroups -> String
showsPrec :: Int -> ListRuleGroups -> ShowS
$cshowsPrec :: Int -> ListRuleGroups -> ShowS
Prelude.Show, (forall x. ListRuleGroups -> Rep ListRuleGroups x)
-> (forall x. Rep ListRuleGroups x -> ListRuleGroups)
-> Generic ListRuleGroups
forall x. Rep ListRuleGroups x -> ListRuleGroups
forall x. ListRuleGroups -> Rep ListRuleGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRuleGroups x -> ListRuleGroups
$cfrom :: forall x. ListRuleGroups -> Rep ListRuleGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListRuleGroups' 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', 'listRuleGroups_nextToken' - When you request a list of objects with a @MaxResults@ setting, if the
-- number of objects that are still available for retrieval exceeds the
-- maximum you requested, Network Firewall returns a @NextToken@ value in
-- the response. To retrieve the next batch of objects, use the token
-- returned from the prior request in your next request.
--
-- 'maxResults', 'listRuleGroups_maxResults' - The maximum number of objects that you want Network Firewall to return
-- for this request. If more objects are available, in the response,
-- Network Firewall provides a @NextToken@ value that you can use in a
-- subsequent call to get the next batch of objects.
newListRuleGroups ::
  ListRuleGroups
newListRuleGroups :: ListRuleGroups
newListRuleGroups =
  ListRuleGroups' :: Maybe Text -> Maybe Natural -> ListRuleGroups
ListRuleGroups'
    { $sel:nextToken:ListRuleGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRuleGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | When you request a list of objects with a @MaxResults@ setting, if the
-- number of objects that are still available for retrieval exceeds the
-- maximum you requested, Network Firewall returns a @NextToken@ value in
-- the response. To retrieve the next batch of objects, use the token
-- returned from the prior request in your next request.
listRuleGroups_nextToken :: Lens.Lens' ListRuleGroups (Prelude.Maybe Prelude.Text)
listRuleGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRuleGroups -> f ListRuleGroups
listRuleGroups_nextToken = (ListRuleGroups -> Maybe Text)
-> (ListRuleGroups -> Maybe Text -> ListRuleGroups)
-> Lens ListRuleGroups ListRuleGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRuleGroups' :: ListRuleGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRuleGroups
s@ListRuleGroups' {} Maybe Text
a -> ListRuleGroups
s {$sel:nextToken:ListRuleGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListRuleGroups)

-- | The maximum number of objects that you want Network Firewall to return
-- for this request. If more objects are available, in the response,
-- Network Firewall provides a @NextToken@ value that you can use in a
-- subsequent call to get the next batch of objects.
listRuleGroups_maxResults :: Lens.Lens' ListRuleGroups (Prelude.Maybe Prelude.Natural)
listRuleGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRuleGroups -> f ListRuleGroups
listRuleGroups_maxResults = (ListRuleGroups -> Maybe Natural)
-> (ListRuleGroups -> Maybe Natural -> ListRuleGroups)
-> Lens
     ListRuleGroups ListRuleGroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRuleGroups' :: ListRuleGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRuleGroups
s@ListRuleGroups' {} Maybe Natural
a -> ListRuleGroups
s {$sel:maxResults:ListRuleGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRuleGroups)

instance Core.AWSPager ListRuleGroups where
  page :: ListRuleGroups
-> AWSResponse ListRuleGroups -> Maybe ListRuleGroups
page ListRuleGroups
rq AWSResponse ListRuleGroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRuleGroups
ListRuleGroupsResponse
rs
            ListRuleGroupsResponse
-> Getting (First Text) ListRuleGroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRuleGroupsResponse
-> Const (First Text) ListRuleGroupsResponse
Lens' ListRuleGroupsResponse (Maybe Text)
listRuleGroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRuleGroupsResponse
 -> Const (First Text) ListRuleGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRuleGroupsResponse 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 ListRuleGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [RuleGroupMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRuleGroups
ListRuleGroupsResponse
rs
            ListRuleGroupsResponse
-> Getting
     (First [RuleGroupMetadata])
     ListRuleGroupsResponse
     [RuleGroupMetadata]
-> Maybe [RuleGroupMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [RuleGroupMetadata]
 -> Const (First [RuleGroupMetadata]) (Maybe [RuleGroupMetadata]))
-> ListRuleGroupsResponse
-> Const (First [RuleGroupMetadata]) ListRuleGroupsResponse
Lens' ListRuleGroupsResponse (Maybe [RuleGroupMetadata])
listRuleGroupsResponse_ruleGroups
              ((Maybe [RuleGroupMetadata]
  -> Const (First [RuleGroupMetadata]) (Maybe [RuleGroupMetadata]))
 -> ListRuleGroupsResponse
 -> Const (First [RuleGroupMetadata]) ListRuleGroupsResponse)
-> (([RuleGroupMetadata]
     -> Const (First [RuleGroupMetadata]) [RuleGroupMetadata])
    -> Maybe [RuleGroupMetadata]
    -> Const (First [RuleGroupMetadata]) (Maybe [RuleGroupMetadata]))
-> Getting
     (First [RuleGroupMetadata])
     ListRuleGroupsResponse
     [RuleGroupMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RuleGroupMetadata]
 -> Const (First [RuleGroupMetadata]) [RuleGroupMetadata])
-> Maybe [RuleGroupMetadata]
-> Const (First [RuleGroupMetadata]) (Maybe [RuleGroupMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListRuleGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListRuleGroups -> Maybe ListRuleGroups
forall a. a -> Maybe a
Prelude.Just (ListRuleGroups -> Maybe ListRuleGroups)
-> ListRuleGroups -> Maybe ListRuleGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        ListRuleGroups
rq
          ListRuleGroups
-> (ListRuleGroups -> ListRuleGroups) -> ListRuleGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListRuleGroups -> Identity ListRuleGroups
Lens ListRuleGroups ListRuleGroups (Maybe Text) (Maybe Text)
listRuleGroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListRuleGroups -> Identity ListRuleGroups)
-> Maybe Text -> ListRuleGroups -> ListRuleGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRuleGroups
ListRuleGroupsResponse
rs
          ListRuleGroupsResponse
-> Getting (First Text) ListRuleGroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRuleGroupsResponse
-> Const (First Text) ListRuleGroupsResponse
Lens' ListRuleGroupsResponse (Maybe Text)
listRuleGroupsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRuleGroupsResponse
 -> Const (First Text) ListRuleGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRuleGroupsResponse 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 ListRuleGroups where
  type
    AWSResponse ListRuleGroups =
      ListRuleGroupsResponse
  request :: ListRuleGroups -> Request ListRuleGroups
request = Service -> ListRuleGroups -> Request ListRuleGroups
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListRuleGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRuleGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListRuleGroups))
-> Logger
-> Service
-> Proxy ListRuleGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRuleGroups)))
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 [RuleGroupMetadata] -> Int -> ListRuleGroupsResponse
ListRuleGroupsResponse'
            (Maybe Text
 -> Maybe [RuleGroupMetadata] -> Int -> ListRuleGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [RuleGroupMetadata] -> Int -> ListRuleGroupsResponse)
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 [RuleGroupMetadata] -> Int -> ListRuleGroupsResponse)
-> Either String (Maybe [RuleGroupMetadata])
-> Either String (Int -> ListRuleGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [RuleGroupMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RuleGroups" Either String (Maybe (Maybe [RuleGroupMetadata]))
-> Maybe [RuleGroupMetadata]
-> Either String (Maybe [RuleGroupMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RuleGroupMetadata]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListRuleGroupsResponse)
-> Either String Int -> Either String ListRuleGroupsResponse
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 ListRuleGroups

instance Prelude.NFData ListRuleGroups

instance Core.ToHeaders ListRuleGroups where
  toHeaders :: ListRuleGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRuleGroups -> 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
"NetworkFirewall_20201112.ListRuleGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListRuleGroups where
  toJSON :: ListRuleGroups -> Value
toJSON ListRuleGroups' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListRuleGroups' :: ListRuleGroups -> Maybe Natural
$sel:nextToken:ListRuleGroups' :: ListRuleGroups -> 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 -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListRuleGroupsResponse' smart constructor.
data ListRuleGroupsResponse = ListRuleGroupsResponse'
  { -- | When you request a list of objects with a @MaxResults@ setting, if the
    -- number of objects that are still available for retrieval exceeds the
    -- maximum you requested, Network Firewall returns a @NextToken@ value in
    -- the response. To retrieve the next batch of objects, use the token
    -- returned from the prior request in your next request.
    ListRuleGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The rule group metadata objects that you\'ve defined. Depending on your
    -- setting for max results and the number of rule groups, this might not be
    -- the full list.
    ListRuleGroupsResponse -> Maybe [RuleGroupMetadata]
ruleGroups :: Prelude.Maybe [RuleGroupMetadata],
    -- | The response's http status code.
    ListRuleGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool
(ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool)
-> (ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool)
-> Eq ListRuleGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool
$c/= :: ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool
== :: ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool
$c== :: ListRuleGroupsResponse -> ListRuleGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListRuleGroupsResponse]
ReadPrec ListRuleGroupsResponse
Int -> ReadS ListRuleGroupsResponse
ReadS [ListRuleGroupsResponse]
(Int -> ReadS ListRuleGroupsResponse)
-> ReadS [ListRuleGroupsResponse]
-> ReadPrec ListRuleGroupsResponse
-> ReadPrec [ListRuleGroupsResponse]
-> Read ListRuleGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRuleGroupsResponse]
$creadListPrec :: ReadPrec [ListRuleGroupsResponse]
readPrec :: ReadPrec ListRuleGroupsResponse
$creadPrec :: ReadPrec ListRuleGroupsResponse
readList :: ReadS [ListRuleGroupsResponse]
$creadList :: ReadS [ListRuleGroupsResponse]
readsPrec :: Int -> ReadS ListRuleGroupsResponse
$creadsPrec :: Int -> ReadS ListRuleGroupsResponse
Prelude.Read, Int -> ListRuleGroupsResponse -> ShowS
[ListRuleGroupsResponse] -> ShowS
ListRuleGroupsResponse -> String
(Int -> ListRuleGroupsResponse -> ShowS)
-> (ListRuleGroupsResponse -> String)
-> ([ListRuleGroupsResponse] -> ShowS)
-> Show ListRuleGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRuleGroupsResponse] -> ShowS
$cshowList :: [ListRuleGroupsResponse] -> ShowS
show :: ListRuleGroupsResponse -> String
$cshow :: ListRuleGroupsResponse -> String
showsPrec :: Int -> ListRuleGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListRuleGroupsResponse -> ShowS
Prelude.Show, (forall x. ListRuleGroupsResponse -> Rep ListRuleGroupsResponse x)
-> (forall x.
    Rep ListRuleGroupsResponse x -> ListRuleGroupsResponse)
-> Generic ListRuleGroupsResponse
forall x. Rep ListRuleGroupsResponse x -> ListRuleGroupsResponse
forall x. ListRuleGroupsResponse -> Rep ListRuleGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRuleGroupsResponse x -> ListRuleGroupsResponse
$cfrom :: forall x. ListRuleGroupsResponse -> Rep ListRuleGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRuleGroupsResponse' 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', 'listRuleGroupsResponse_nextToken' - When you request a list of objects with a @MaxResults@ setting, if the
-- number of objects that are still available for retrieval exceeds the
-- maximum you requested, Network Firewall returns a @NextToken@ value in
-- the response. To retrieve the next batch of objects, use the token
-- returned from the prior request in your next request.
--
-- 'ruleGroups', 'listRuleGroupsResponse_ruleGroups' - The rule group metadata objects that you\'ve defined. Depending on your
-- setting for max results and the number of rule groups, this might not be
-- the full list.
--
-- 'httpStatus', 'listRuleGroupsResponse_httpStatus' - The response's http status code.
newListRuleGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRuleGroupsResponse
newListRuleGroupsResponse :: Int -> ListRuleGroupsResponse
newListRuleGroupsResponse Int
pHttpStatus_ =
  ListRuleGroupsResponse' :: Maybe Text
-> Maybe [RuleGroupMetadata] -> Int -> ListRuleGroupsResponse
ListRuleGroupsResponse'
    { $sel:nextToken:ListRuleGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleGroups:ListRuleGroupsResponse' :: Maybe [RuleGroupMetadata]
ruleGroups = Maybe [RuleGroupMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRuleGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When you request a list of objects with a @MaxResults@ setting, if the
-- number of objects that are still available for retrieval exceeds the
-- maximum you requested, Network Firewall returns a @NextToken@ value in
-- the response. To retrieve the next batch of objects, use the token
-- returned from the prior request in your next request.
listRuleGroupsResponse_nextToken :: Lens.Lens' ListRuleGroupsResponse (Prelude.Maybe Prelude.Text)
listRuleGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRuleGroupsResponse -> f ListRuleGroupsResponse
listRuleGroupsResponse_nextToken = (ListRuleGroupsResponse -> Maybe Text)
-> (ListRuleGroupsResponse -> Maybe Text -> ListRuleGroupsResponse)
-> Lens' ListRuleGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRuleGroupsResponse' :: ListRuleGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRuleGroupsResponse
s@ListRuleGroupsResponse' {} Maybe Text
a -> ListRuleGroupsResponse
s {$sel:nextToken:ListRuleGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRuleGroupsResponse)

-- | The rule group metadata objects that you\'ve defined. Depending on your
-- setting for max results and the number of rule groups, this might not be
-- the full list.
listRuleGroupsResponse_ruleGroups :: Lens.Lens' ListRuleGroupsResponse (Prelude.Maybe [RuleGroupMetadata])
listRuleGroupsResponse_ruleGroups :: (Maybe [RuleGroupMetadata] -> f (Maybe [RuleGroupMetadata]))
-> ListRuleGroupsResponse -> f ListRuleGroupsResponse
listRuleGroupsResponse_ruleGroups = (ListRuleGroupsResponse -> Maybe [RuleGroupMetadata])
-> (ListRuleGroupsResponse
    -> Maybe [RuleGroupMetadata] -> ListRuleGroupsResponse)
-> Lens' ListRuleGroupsResponse (Maybe [RuleGroupMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroupsResponse' {Maybe [RuleGroupMetadata]
ruleGroups :: Maybe [RuleGroupMetadata]
$sel:ruleGroups:ListRuleGroupsResponse' :: ListRuleGroupsResponse -> Maybe [RuleGroupMetadata]
ruleGroups} -> Maybe [RuleGroupMetadata]
ruleGroups) (\s :: ListRuleGroupsResponse
s@ListRuleGroupsResponse' {} Maybe [RuleGroupMetadata]
a -> ListRuleGroupsResponse
s {$sel:ruleGroups:ListRuleGroupsResponse' :: Maybe [RuleGroupMetadata]
ruleGroups = Maybe [RuleGroupMetadata]
a} :: ListRuleGroupsResponse) ((Maybe [RuleGroupMetadata] -> f (Maybe [RuleGroupMetadata]))
 -> ListRuleGroupsResponse -> f ListRuleGroupsResponse)
-> ((Maybe [RuleGroupMetadata] -> f (Maybe [RuleGroupMetadata]))
    -> Maybe [RuleGroupMetadata] -> f (Maybe [RuleGroupMetadata]))
-> (Maybe [RuleGroupMetadata] -> f (Maybe [RuleGroupMetadata]))
-> ListRuleGroupsResponse
-> f ListRuleGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RuleGroupMetadata]
  [RuleGroupMetadata]
  [RuleGroupMetadata]
  [RuleGroupMetadata]
-> Iso
     (Maybe [RuleGroupMetadata])
     (Maybe [RuleGroupMetadata])
     (Maybe [RuleGroupMetadata])
     (Maybe [RuleGroupMetadata])
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
  [RuleGroupMetadata]
  [RuleGroupMetadata]
  [RuleGroupMetadata]
  [RuleGroupMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListRuleGroupsResponse