{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_managedType,
    listRuleGroups_maxResults,
    listRuleGroups_nextToken,
    listRuleGroups_scope,
    listRuleGroups_type,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | Indicates the general category of the Amazon Web Services managed rule
    -- group.
    ListRuleGroups -> Maybe ResourceManagedType
managedType :: Prelude.Maybe ResourceManagedType,
    -- | 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,
    -- | 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 scope of the request. The default setting of @ACCOUNT@ or a setting
    -- of @NULL@ returns all of the rule groups in your account. A setting of
    -- @MANAGED@ returns all available managed rule groups.
    ListRuleGroups -> Maybe ResourceManagedStatus
scope :: Prelude.Maybe ResourceManagedStatus,
    -- | Indicates whether the rule group is stateless or stateful. If the rule
    -- group is stateless, it contains stateless rules. If it is stateful, it
    -- contains stateful rules.
    ListRuleGroups -> Maybe RuleGroupType
type' :: Prelude.Maybe RuleGroupType
  }
  deriving (ListRuleGroups -> ListRuleGroups -> Bool
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]
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
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. 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:
--
-- 'managedType', 'listRuleGroups_managedType' - Indicates the general category of the Amazon Web Services managed rule
-- group.
--
-- '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.
--
-- '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.
--
-- 'scope', 'listRuleGroups_scope' - The scope of the request. The default setting of @ACCOUNT@ or a setting
-- of @NULL@ returns all of the rule groups in your account. A setting of
-- @MANAGED@ returns all available managed rule groups.
--
-- 'type'', 'listRuleGroups_type' - Indicates whether the rule group is stateless or stateful. If the rule
-- group is stateless, it contains stateless rules. If it is stateful, it
-- contains stateful rules.
newListRuleGroups ::
  ListRuleGroups
newListRuleGroups :: ListRuleGroups
newListRuleGroups =
  ListRuleGroups'
    { $sel:managedType:ListRuleGroups' :: Maybe ResourceManagedType
managedType = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRuleGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRuleGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:scope:ListRuleGroups' :: Maybe ResourceManagedStatus
scope = forall a. Maybe a
Prelude.Nothing,
      $sel:type':ListRuleGroups' :: Maybe RuleGroupType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the general category of the Amazon Web Services managed rule
-- group.
listRuleGroups_managedType :: Lens.Lens' ListRuleGroups (Prelude.Maybe ResourceManagedType)
listRuleGroups_managedType :: Lens' ListRuleGroups (Maybe ResourceManagedType)
listRuleGroups_managedType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroups' {Maybe ResourceManagedType
managedType :: Maybe ResourceManagedType
$sel:managedType:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedType
managedType} -> Maybe ResourceManagedType
managedType) (\s :: ListRuleGroups
s@ListRuleGroups' {} Maybe ResourceManagedType
a -> ListRuleGroups
s {$sel:managedType:ListRuleGroups' :: Maybe ResourceManagedType
managedType = Maybe ResourceManagedType
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 :: Lens' ListRuleGroups (Maybe Natural)
listRuleGroups_maxResults = 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)

-- | 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 :: Lens' ListRuleGroups (Maybe Text)
listRuleGroups_nextToken = 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 scope of the request. The default setting of @ACCOUNT@ or a setting
-- of @NULL@ returns all of the rule groups in your account. A setting of
-- @MANAGED@ returns all available managed rule groups.
listRuleGroups_scope :: Lens.Lens' ListRuleGroups (Prelude.Maybe ResourceManagedStatus)
listRuleGroups_scope :: Lens' ListRuleGroups (Maybe ResourceManagedStatus)
listRuleGroups_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroups' {Maybe ResourceManagedStatus
scope :: Maybe ResourceManagedStatus
$sel:scope:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedStatus
scope} -> Maybe ResourceManagedStatus
scope) (\s :: ListRuleGroups
s@ListRuleGroups' {} Maybe ResourceManagedStatus
a -> ListRuleGroups
s {$sel:scope:ListRuleGroups' :: Maybe ResourceManagedStatus
scope = Maybe ResourceManagedStatus
a} :: ListRuleGroups)

-- | Indicates whether the rule group is stateless or stateful. If the rule
-- group is stateless, it contains stateless rules. If it is stateful, it
-- contains stateful rules.
listRuleGroups_type :: Lens.Lens' ListRuleGroups (Prelude.Maybe RuleGroupType)
listRuleGroups_type :: Lens' ListRuleGroups (Maybe RuleGroupType)
listRuleGroups_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRuleGroups' {Maybe RuleGroupType
type' :: Maybe RuleGroupType
$sel:type':ListRuleGroups' :: ListRuleGroups -> Maybe RuleGroupType
type'} -> Maybe RuleGroupType
type') (\s :: ListRuleGroups
s@ListRuleGroups' {} Maybe RuleGroupType
a -> ListRuleGroups
s {$sel:type':ListRuleGroups' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
a} :: ListRuleGroups)

instance Core.AWSPager ListRuleGroups where
  page :: ListRuleGroups
-> AWSResponse ListRuleGroups -> Maybe ListRuleGroups
page ListRuleGroups
rq AWSResponse ListRuleGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRuleGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRuleGroupsResponse (Maybe Text)
listRuleGroupsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRuleGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRuleGroupsResponse (Maybe [RuleGroupMetadata])
listRuleGroupsResponse_ruleGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListRuleGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRuleGroups (Maybe Text)
listRuleGroups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRuleGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRuleGroupsResponse (Maybe Text)
listRuleGroupsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListRuleGroups where
  type
    AWSResponse ListRuleGroups =
      ListRuleGroupsResponse
  request :: (Service -> Service) -> ListRuleGroups -> Request ListRuleGroups
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRuleGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRuleGroups)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RuleGroups" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListRuleGroups where
  hashWithSalt :: Int -> ListRuleGroups -> Int
hashWithSalt Int
_salt ListRuleGroups' {Maybe Natural
Maybe Text
Maybe ResourceManagedStatus
Maybe ResourceManagedType
Maybe RuleGroupType
type' :: Maybe RuleGroupType
scope :: Maybe ResourceManagedStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
managedType :: Maybe ResourceManagedType
$sel:type':ListRuleGroups' :: ListRuleGroups -> Maybe RuleGroupType
$sel:scope:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedStatus
$sel:nextToken:ListRuleGroups' :: ListRuleGroups -> Maybe Text
$sel:maxResults:ListRuleGroups' :: ListRuleGroups -> Maybe Natural
$sel:managedType:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceManagedType
managedType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceManagedStatus
scope
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuleGroupType
type'

instance Prelude.NFData ListRuleGroups where
  rnf :: ListRuleGroups -> ()
rnf ListRuleGroups' {Maybe Natural
Maybe Text
Maybe ResourceManagedStatus
Maybe ResourceManagedType
Maybe RuleGroupType
type' :: Maybe RuleGroupType
scope :: Maybe ResourceManagedStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
managedType :: Maybe ResourceManagedType
$sel:type':ListRuleGroups' :: ListRuleGroups -> Maybe RuleGroupType
$sel:scope:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedStatus
$sel:nextToken:ListRuleGroups' :: ListRuleGroups -> Maybe Text
$sel:maxResults:ListRuleGroups' :: ListRuleGroups -> Maybe Natural
$sel:managedType:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceManagedType
managedType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceManagedStatus
scope
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleGroupType
type'

instance Data.ToHeaders ListRuleGroups where
  toHeaders :: ListRuleGroups -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"NetworkFirewall_20201112.ListRuleGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListRuleGroups where
  toJSON :: ListRuleGroups -> Value
toJSON ListRuleGroups' {Maybe Natural
Maybe Text
Maybe ResourceManagedStatus
Maybe ResourceManagedType
Maybe RuleGroupType
type' :: Maybe RuleGroupType
scope :: Maybe ResourceManagedStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
managedType :: Maybe ResourceManagedType
$sel:type':ListRuleGroups' :: ListRuleGroups -> Maybe RuleGroupType
$sel:scope:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedStatus
$sel:nextToken:ListRuleGroups' :: ListRuleGroups -> Maybe Text
$sel:maxResults:ListRuleGroups' :: ListRuleGroups -> Maybe Natural
$sel:managedType:ListRuleGroups' :: ListRuleGroups -> Maybe ResourceManagedType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ManagedType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceManagedType
managedType,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceManagedStatus
scope,
            (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RuleGroupType
type'
          ]
      )

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

instance Data.ToQuery ListRuleGroups where
  toQuery :: ListRuleGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
    { $sel:nextToken:ListRuleGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ruleGroups:ListRuleGroupsResponse' :: Maybe [RuleGroupMetadata]
ruleGroups = 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 :: Lens' ListRuleGroupsResponse (Maybe Text)
listRuleGroupsResponse_nextToken = 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 :: Lens' ListRuleGroupsResponse (Maybe [RuleGroupMetadata])
listRuleGroupsResponse_ruleGroups = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' ListRuleGroupsResponse Int
listRuleGroupsResponse_httpStatus = 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 where
  rnf :: ListRuleGroupsResponse -> ()
rnf ListRuleGroupsResponse' {Int
Maybe [RuleGroupMetadata]
Maybe Text
httpStatus :: Int
ruleGroups :: Maybe [RuleGroupMetadata]
nextToken :: Maybe Text
$sel:httpStatus:ListRuleGroupsResponse' :: ListRuleGroupsResponse -> Int
$sel:ruleGroups:ListRuleGroupsResponse' :: ListRuleGroupsResponse -> Maybe [RuleGroupMetadata]
$sel:nextToken:ListRuleGroupsResponse' :: ListRuleGroupsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RuleGroupMetadata]
ruleGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus