{-# 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.Route53Resolver.ListFirewallRuleGroups
-- 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 minimal high-level information for the rule groups that
-- you have defined.
--
-- A single call might return only a partial list of the rule groups. For
-- information, see @MaxResults@.
--
-- This operation returns paginated results.
module Amazonka.Route53Resolver.ListFirewallRuleGroups
  ( -- * Creating a Request
    ListFirewallRuleGroups (..),
    newListFirewallRuleGroups,

    -- * Request Lenses
    listFirewallRuleGroups_nextToken,
    listFirewallRuleGroups_maxResults,

    -- * Destructuring the Response
    ListFirewallRuleGroupsResponse (..),
    newListFirewallRuleGroupsResponse,

    -- * Response Lenses
    listFirewallRuleGroupsResponse_nextToken,
    listFirewallRuleGroupsResponse_firewallRuleGroups,
    listFirewallRuleGroupsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListFirewallRuleGroups' smart constructor.
data ListFirewallRuleGroups = ListFirewallRuleGroups'
  { -- | For the first call to this list request, omit this value.
    --
    -- When you request a list of objects, Resolver returns at most the number
    -- of objects specified in @MaxResults@. If more objects are available for
    -- retrieval, Resolver returns a @NextToken@ value in the response. To
    -- retrieve the next batch of objects, use the token that was returned for
    -- the prior request in your next request.
    ListFirewallRuleGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects that you want Resolver to return for this
    -- request. If more objects are available, in the response, Resolver
    -- provides a @NextToken@ value that you can use in a subsequent call to
    -- get the next batch of objects.
    --
    -- If you don\'t specify a value for @MaxResults@, Resolver returns up to
    -- 100 objects.
    ListFirewallRuleGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
(ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool)
-> (ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool)
-> Eq ListFirewallRuleGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
$c/= :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
== :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
$c== :: ListFirewallRuleGroups -> ListFirewallRuleGroups -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroups]
ReadPrec ListFirewallRuleGroups
Int -> ReadS ListFirewallRuleGroups
ReadS [ListFirewallRuleGroups]
(Int -> ReadS ListFirewallRuleGroups)
-> ReadS [ListFirewallRuleGroups]
-> ReadPrec ListFirewallRuleGroups
-> ReadPrec [ListFirewallRuleGroups]
-> Read ListFirewallRuleGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroups]
$creadListPrec :: ReadPrec [ListFirewallRuleGroups]
readPrec :: ReadPrec ListFirewallRuleGroups
$creadPrec :: ReadPrec ListFirewallRuleGroups
readList :: ReadS [ListFirewallRuleGroups]
$creadList :: ReadS [ListFirewallRuleGroups]
readsPrec :: Int -> ReadS ListFirewallRuleGroups
$creadsPrec :: Int -> ReadS ListFirewallRuleGroups
Prelude.Read, Int -> ListFirewallRuleGroups -> ShowS
[ListFirewallRuleGroups] -> ShowS
ListFirewallRuleGroups -> String
(Int -> ListFirewallRuleGroups -> ShowS)
-> (ListFirewallRuleGroups -> String)
-> ([ListFirewallRuleGroups] -> ShowS)
-> Show ListFirewallRuleGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroups] -> ShowS
$cshowList :: [ListFirewallRuleGroups] -> ShowS
show :: ListFirewallRuleGroups -> String
$cshow :: ListFirewallRuleGroups -> String
showsPrec :: Int -> ListFirewallRuleGroups -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroups -> ShowS
Prelude.Show, (forall x. ListFirewallRuleGroups -> Rep ListFirewallRuleGroups x)
-> (forall x.
    Rep ListFirewallRuleGroups x -> ListFirewallRuleGroups)
-> Generic ListFirewallRuleGroups
forall x. Rep ListFirewallRuleGroups x -> ListFirewallRuleGroups
forall x. ListFirewallRuleGroups -> Rep ListFirewallRuleGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallRuleGroups x -> ListFirewallRuleGroups
$cfrom :: forall x. ListFirewallRuleGroups -> Rep ListFirewallRuleGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallRuleGroups' 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', 'listFirewallRuleGroups_nextToken' - For the first call to this list request, omit this value.
--
-- When you request a list of objects, Resolver returns at most the number
-- of objects specified in @MaxResults@. If more objects are available for
-- retrieval, Resolver returns a @NextToken@ value in the response. To
-- retrieve the next batch of objects, use the token that was returned for
-- the prior request in your next request.
--
-- 'maxResults', 'listFirewallRuleGroups_maxResults' - The maximum number of objects that you want Resolver to return for this
-- request. If more objects are available, in the response, Resolver
-- provides a @NextToken@ value that you can use in a subsequent call to
-- get the next batch of objects.
--
-- If you don\'t specify a value for @MaxResults@, Resolver returns up to
-- 100 objects.
newListFirewallRuleGroups ::
  ListFirewallRuleGroups
newListFirewallRuleGroups :: ListFirewallRuleGroups
newListFirewallRuleGroups =
  ListFirewallRuleGroups' :: Maybe Text -> Maybe Natural -> ListFirewallRuleGroups
ListFirewallRuleGroups'
    { $sel:nextToken:ListFirewallRuleGroups' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFirewallRuleGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | For the first call to this list request, omit this value.
--
-- When you request a list of objects, Resolver returns at most the number
-- of objects specified in @MaxResults@. If more objects are available for
-- retrieval, Resolver returns a @NextToken@ value in the response. To
-- retrieve the next batch of objects, use the token that was returned for
-- the prior request in your next request.
listFirewallRuleGroups_nextToken :: Lens.Lens' ListFirewallRuleGroups (Prelude.Maybe Prelude.Text)
listFirewallRuleGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFirewallRuleGroups -> f ListFirewallRuleGroups
listFirewallRuleGroups_nextToken = (ListFirewallRuleGroups -> Maybe Text)
-> (ListFirewallRuleGroups -> Maybe Text -> ListFirewallRuleGroups)
-> Lens
     ListFirewallRuleGroups
     ListFirewallRuleGroups
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroups' :: ListFirewallRuleGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroups
s@ListFirewallRuleGroups' {} Maybe Text
a -> ListFirewallRuleGroups
s {$sel:nextToken:ListFirewallRuleGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroups)

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

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

instance Prelude.NFData ListFirewallRuleGroups

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

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

-- | /See:/ 'newListFirewallRuleGroupsResponse' smart constructor.
data ListFirewallRuleGroupsResponse = ListFirewallRuleGroupsResponse'
  { -- | If objects are still available for retrieval, Resolver returns this
    -- token in the response. To retrieve the next batch of objects, provide
    -- this token in your next request.
    ListFirewallRuleGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of your firewall rule groups.
    --
    -- This might be a partial list of the rule groups that you have defined.
    -- For information, see @MaxResults@.
    ListFirewallRuleGroupsResponse -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups :: Prelude.Maybe [FirewallRuleGroupMetadata],
    -- | The response's http status code.
    ListFirewallRuleGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
(ListFirewallRuleGroupsResponse
 -> ListFirewallRuleGroupsResponse -> Bool)
-> (ListFirewallRuleGroupsResponse
    -> ListFirewallRuleGroupsResponse -> Bool)
-> Eq ListFirewallRuleGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
$c/= :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
== :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
$c== :: ListFirewallRuleGroupsResponse
-> ListFirewallRuleGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallRuleGroupsResponse]
ReadPrec ListFirewallRuleGroupsResponse
Int -> ReadS ListFirewallRuleGroupsResponse
ReadS [ListFirewallRuleGroupsResponse]
(Int -> ReadS ListFirewallRuleGroupsResponse)
-> ReadS [ListFirewallRuleGroupsResponse]
-> ReadPrec ListFirewallRuleGroupsResponse
-> ReadPrec [ListFirewallRuleGroupsResponse]
-> Read ListFirewallRuleGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallRuleGroupsResponse]
$creadListPrec :: ReadPrec [ListFirewallRuleGroupsResponse]
readPrec :: ReadPrec ListFirewallRuleGroupsResponse
$creadPrec :: ReadPrec ListFirewallRuleGroupsResponse
readList :: ReadS [ListFirewallRuleGroupsResponse]
$creadList :: ReadS [ListFirewallRuleGroupsResponse]
readsPrec :: Int -> ReadS ListFirewallRuleGroupsResponse
$creadsPrec :: Int -> ReadS ListFirewallRuleGroupsResponse
Prelude.Read, Int -> ListFirewallRuleGroupsResponse -> ShowS
[ListFirewallRuleGroupsResponse] -> ShowS
ListFirewallRuleGroupsResponse -> String
(Int -> ListFirewallRuleGroupsResponse -> ShowS)
-> (ListFirewallRuleGroupsResponse -> String)
-> ([ListFirewallRuleGroupsResponse] -> ShowS)
-> Show ListFirewallRuleGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallRuleGroupsResponse] -> ShowS
$cshowList :: [ListFirewallRuleGroupsResponse] -> ShowS
show :: ListFirewallRuleGroupsResponse -> String
$cshow :: ListFirewallRuleGroupsResponse -> String
showsPrec :: Int -> ListFirewallRuleGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallRuleGroupsResponse -> ShowS
Prelude.Show, (forall x.
 ListFirewallRuleGroupsResponse
 -> Rep ListFirewallRuleGroupsResponse x)
-> (forall x.
    Rep ListFirewallRuleGroupsResponse x
    -> ListFirewallRuleGroupsResponse)
-> Generic ListFirewallRuleGroupsResponse
forall x.
Rep ListFirewallRuleGroupsResponse x
-> ListFirewallRuleGroupsResponse
forall x.
ListFirewallRuleGroupsResponse
-> Rep ListFirewallRuleGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFirewallRuleGroupsResponse x
-> ListFirewallRuleGroupsResponse
$cfrom :: forall x.
ListFirewallRuleGroupsResponse
-> Rep ListFirewallRuleGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallRuleGroupsResponse' 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', 'listFirewallRuleGroupsResponse_nextToken' - If objects are still available for retrieval, Resolver returns this
-- token in the response. To retrieve the next batch of objects, provide
-- this token in your next request.
--
-- 'firewallRuleGroups', 'listFirewallRuleGroupsResponse_firewallRuleGroups' - A list of your firewall rule groups.
--
-- This might be a partial list of the rule groups that you have defined.
-- For information, see @MaxResults@.
--
-- 'httpStatus', 'listFirewallRuleGroupsResponse_httpStatus' - The response's http status code.
newListFirewallRuleGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFirewallRuleGroupsResponse
newListFirewallRuleGroupsResponse :: Int -> ListFirewallRuleGroupsResponse
newListFirewallRuleGroupsResponse Int
pHttpStatus_ =
  ListFirewallRuleGroupsResponse' :: Maybe Text
-> Maybe [FirewallRuleGroupMetadata]
-> Int
-> ListFirewallRuleGroupsResponse
ListFirewallRuleGroupsResponse'
    { $sel:nextToken:ListFirewallRuleGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups = Maybe [FirewallRuleGroupMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFirewallRuleGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If objects are still available for retrieval, Resolver returns this
-- token in the response. To retrieve the next batch of objects, provide
-- this token in your next request.
listFirewallRuleGroupsResponse_nextToken :: Lens.Lens' ListFirewallRuleGroupsResponse (Prelude.Maybe Prelude.Text)
listFirewallRuleGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFirewallRuleGroupsResponse
-> f ListFirewallRuleGroupsResponse
listFirewallRuleGroupsResponse_nextToken = (ListFirewallRuleGroupsResponse -> Maybe Text)
-> (ListFirewallRuleGroupsResponse
    -> Maybe Text -> ListFirewallRuleGroupsResponse)
-> Lens' ListFirewallRuleGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallRuleGroupsResponse
s@ListFirewallRuleGroupsResponse' {} Maybe Text
a -> ListFirewallRuleGroupsResponse
s {$sel:nextToken:ListFirewallRuleGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallRuleGroupsResponse)

-- | A list of your firewall rule groups.
--
-- This might be a partial list of the rule groups that you have defined.
-- For information, see @MaxResults@.
listFirewallRuleGroupsResponse_firewallRuleGroups :: Lens.Lens' ListFirewallRuleGroupsResponse (Prelude.Maybe [FirewallRuleGroupMetadata])
listFirewallRuleGroupsResponse_firewallRuleGroups :: (Maybe [FirewallRuleGroupMetadata]
 -> f (Maybe [FirewallRuleGroupMetadata]))
-> ListFirewallRuleGroupsResponse
-> f ListFirewallRuleGroupsResponse
listFirewallRuleGroupsResponse_firewallRuleGroups = (ListFirewallRuleGroupsResponse
 -> Maybe [FirewallRuleGroupMetadata])
-> (ListFirewallRuleGroupsResponse
    -> Maybe [FirewallRuleGroupMetadata]
    -> ListFirewallRuleGroupsResponse)
-> Lens'
     ListFirewallRuleGroupsResponse (Maybe [FirewallRuleGroupMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallRuleGroupsResponse' {Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups :: Maybe [FirewallRuleGroupMetadata]
$sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: ListFirewallRuleGroupsResponse -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups} -> Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups) (\s :: ListFirewallRuleGroupsResponse
s@ListFirewallRuleGroupsResponse' {} Maybe [FirewallRuleGroupMetadata]
a -> ListFirewallRuleGroupsResponse
s {$sel:firewallRuleGroups:ListFirewallRuleGroupsResponse' :: Maybe [FirewallRuleGroupMetadata]
firewallRuleGroups = Maybe [FirewallRuleGroupMetadata]
a} :: ListFirewallRuleGroupsResponse) ((Maybe [FirewallRuleGroupMetadata]
  -> f (Maybe [FirewallRuleGroupMetadata]))
 -> ListFirewallRuleGroupsResponse
 -> f ListFirewallRuleGroupsResponse)
-> ((Maybe [FirewallRuleGroupMetadata]
     -> f (Maybe [FirewallRuleGroupMetadata]))
    -> Maybe [FirewallRuleGroupMetadata]
    -> f (Maybe [FirewallRuleGroupMetadata]))
-> (Maybe [FirewallRuleGroupMetadata]
    -> f (Maybe [FirewallRuleGroupMetadata]))
-> ListFirewallRuleGroupsResponse
-> f ListFirewallRuleGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
-> Iso
     (Maybe [FirewallRuleGroupMetadata])
     (Maybe [FirewallRuleGroupMetadata])
     (Maybe [FirewallRuleGroupMetadata])
     (Maybe [FirewallRuleGroupMetadata])
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
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
  [FirewallRuleGroupMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListFirewallRuleGroupsResponse