{-# 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.ListFirewalls
-- 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 firewalls that you have defined. If you
-- provide VPC identifiers in your request, this returns only the firewalls
-- for those VPCs.
--
-- Depending on your setting for max results and the number of firewalls, a
-- single call might not return the full list.
--
-- This operation returns paginated results.
module Amazonka.NetworkFirewall.ListFirewalls
  ( -- * Creating a Request
    ListFirewalls (..),
    newListFirewalls,

    -- * Request Lenses
    listFirewalls_nextToken,
    listFirewalls_vpcIds,
    listFirewalls_maxResults,

    -- * Destructuring the Response
    ListFirewallsResponse (..),
    newListFirewallsResponse,

    -- * Response Lenses
    listFirewallsResponse_nextToken,
    listFirewallsResponse_firewalls,
    listFirewallsResponse_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:/ 'newListFirewalls' smart constructor.
data ListFirewalls = ListFirewalls'
  { -- | 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.
    ListFirewalls -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The unique identifiers of the VPCs that you want Network Firewall to
    -- retrieve the firewalls for. Leave this blank to retrieve all firewalls
    -- that you have defined.
    ListFirewalls -> Maybe [Text]
vpcIds :: 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.
    ListFirewalls -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFirewalls -> ListFirewalls -> Bool
(ListFirewalls -> ListFirewalls -> Bool)
-> (ListFirewalls -> ListFirewalls -> Bool) -> Eq ListFirewalls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewalls -> ListFirewalls -> Bool
$c/= :: ListFirewalls -> ListFirewalls -> Bool
== :: ListFirewalls -> ListFirewalls -> Bool
$c== :: ListFirewalls -> ListFirewalls -> Bool
Prelude.Eq, ReadPrec [ListFirewalls]
ReadPrec ListFirewalls
Int -> ReadS ListFirewalls
ReadS [ListFirewalls]
(Int -> ReadS ListFirewalls)
-> ReadS [ListFirewalls]
-> ReadPrec ListFirewalls
-> ReadPrec [ListFirewalls]
-> Read ListFirewalls
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewalls]
$creadListPrec :: ReadPrec [ListFirewalls]
readPrec :: ReadPrec ListFirewalls
$creadPrec :: ReadPrec ListFirewalls
readList :: ReadS [ListFirewalls]
$creadList :: ReadS [ListFirewalls]
readsPrec :: Int -> ReadS ListFirewalls
$creadsPrec :: Int -> ReadS ListFirewalls
Prelude.Read, Int -> ListFirewalls -> ShowS
[ListFirewalls] -> ShowS
ListFirewalls -> String
(Int -> ListFirewalls -> ShowS)
-> (ListFirewalls -> String)
-> ([ListFirewalls] -> ShowS)
-> Show ListFirewalls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewalls] -> ShowS
$cshowList :: [ListFirewalls] -> ShowS
show :: ListFirewalls -> String
$cshow :: ListFirewalls -> String
showsPrec :: Int -> ListFirewalls -> ShowS
$cshowsPrec :: Int -> ListFirewalls -> ShowS
Prelude.Show, (forall x. ListFirewalls -> Rep ListFirewalls x)
-> (forall x. Rep ListFirewalls x -> ListFirewalls)
-> Generic ListFirewalls
forall x. Rep ListFirewalls x -> ListFirewalls
forall x. ListFirewalls -> Rep ListFirewalls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewalls x -> ListFirewalls
$cfrom :: forall x. ListFirewalls -> Rep ListFirewalls x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewalls' 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', 'listFirewalls_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.
--
-- 'vpcIds', 'listFirewalls_vpcIds' - The unique identifiers of the VPCs that you want Network Firewall to
-- retrieve the firewalls for. Leave this blank to retrieve all firewalls
-- that you have defined.
--
-- 'maxResults', 'listFirewalls_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.
newListFirewalls ::
  ListFirewalls
newListFirewalls :: ListFirewalls
newListFirewalls =
  ListFirewalls' :: Maybe Text -> Maybe [Text] -> Maybe Natural -> ListFirewalls
ListFirewalls'
    { $sel:nextToken:ListFirewalls' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcIds:ListFirewalls' :: Maybe [Text]
vpcIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFirewalls' :: 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.
listFirewalls_nextToken :: Lens.Lens' ListFirewalls (Prelude.Maybe Prelude.Text)
listFirewalls_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListFirewalls -> f ListFirewalls
listFirewalls_nextToken = (ListFirewalls -> Maybe Text)
-> (ListFirewalls -> Maybe Text -> ListFirewalls)
-> Lens ListFirewalls ListFirewalls (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewalls' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewalls' :: ListFirewalls -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewalls
s@ListFirewalls' {} Maybe Text
a -> ListFirewalls
s {$sel:nextToken:ListFirewalls' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewalls)

-- | The unique identifiers of the VPCs that you want Network Firewall to
-- retrieve the firewalls for. Leave this blank to retrieve all firewalls
-- that you have defined.
listFirewalls_vpcIds :: Lens.Lens' ListFirewalls (Prelude.Maybe [Prelude.Text])
listFirewalls_vpcIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListFirewalls -> f ListFirewalls
listFirewalls_vpcIds = (ListFirewalls -> Maybe [Text])
-> (ListFirewalls -> Maybe [Text] -> ListFirewalls)
-> Lens ListFirewalls ListFirewalls (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewalls' {Maybe [Text]
vpcIds :: Maybe [Text]
$sel:vpcIds:ListFirewalls' :: ListFirewalls -> Maybe [Text]
vpcIds} -> Maybe [Text]
vpcIds) (\s :: ListFirewalls
s@ListFirewalls' {} Maybe [Text]
a -> ListFirewalls
s {$sel:vpcIds:ListFirewalls' :: Maybe [Text]
vpcIds = Maybe [Text]
a} :: ListFirewalls) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListFirewalls -> f ListFirewalls)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListFirewalls
-> f ListFirewalls
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListFirewalls

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

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

-- | /See:/ 'newListFirewallsResponse' smart constructor.
data ListFirewallsResponse = ListFirewallsResponse'
  { -- | 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.
    ListFirewallsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The firewall metadata objects for the VPCs that you specified. Depending
    -- on your setting for max results and the number of firewalls you have, a
    -- single call might not be the full list.
    ListFirewallsResponse -> Maybe [FirewallMetadata]
firewalls :: Prelude.Maybe [FirewallMetadata],
    -- | The response's http status code.
    ListFirewallsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFirewallsResponse -> ListFirewallsResponse -> Bool
(ListFirewallsResponse -> ListFirewallsResponse -> Bool)
-> (ListFirewallsResponse -> ListFirewallsResponse -> Bool)
-> Eq ListFirewallsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFirewallsResponse -> ListFirewallsResponse -> Bool
$c/= :: ListFirewallsResponse -> ListFirewallsResponse -> Bool
== :: ListFirewallsResponse -> ListFirewallsResponse -> Bool
$c== :: ListFirewallsResponse -> ListFirewallsResponse -> Bool
Prelude.Eq, ReadPrec [ListFirewallsResponse]
ReadPrec ListFirewallsResponse
Int -> ReadS ListFirewallsResponse
ReadS [ListFirewallsResponse]
(Int -> ReadS ListFirewallsResponse)
-> ReadS [ListFirewallsResponse]
-> ReadPrec ListFirewallsResponse
-> ReadPrec [ListFirewallsResponse]
-> Read ListFirewallsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFirewallsResponse]
$creadListPrec :: ReadPrec [ListFirewallsResponse]
readPrec :: ReadPrec ListFirewallsResponse
$creadPrec :: ReadPrec ListFirewallsResponse
readList :: ReadS [ListFirewallsResponse]
$creadList :: ReadS [ListFirewallsResponse]
readsPrec :: Int -> ReadS ListFirewallsResponse
$creadsPrec :: Int -> ReadS ListFirewallsResponse
Prelude.Read, Int -> ListFirewallsResponse -> ShowS
[ListFirewallsResponse] -> ShowS
ListFirewallsResponse -> String
(Int -> ListFirewallsResponse -> ShowS)
-> (ListFirewallsResponse -> String)
-> ([ListFirewallsResponse] -> ShowS)
-> Show ListFirewallsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFirewallsResponse] -> ShowS
$cshowList :: [ListFirewallsResponse] -> ShowS
show :: ListFirewallsResponse -> String
$cshow :: ListFirewallsResponse -> String
showsPrec :: Int -> ListFirewallsResponse -> ShowS
$cshowsPrec :: Int -> ListFirewallsResponse -> ShowS
Prelude.Show, (forall x. ListFirewallsResponse -> Rep ListFirewallsResponse x)
-> (forall x. Rep ListFirewallsResponse x -> ListFirewallsResponse)
-> Generic ListFirewallsResponse
forall x. Rep ListFirewallsResponse x -> ListFirewallsResponse
forall x. ListFirewallsResponse -> Rep ListFirewallsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFirewallsResponse x -> ListFirewallsResponse
$cfrom :: forall x. ListFirewallsResponse -> Rep ListFirewallsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFirewallsResponse' 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', 'listFirewallsResponse_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.
--
-- 'firewalls', 'listFirewallsResponse_firewalls' - The firewall metadata objects for the VPCs that you specified. Depending
-- on your setting for max results and the number of firewalls you have, a
-- single call might not be the full list.
--
-- 'httpStatus', 'listFirewallsResponse_httpStatus' - The response's http status code.
newListFirewallsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFirewallsResponse
newListFirewallsResponse :: Int -> ListFirewallsResponse
newListFirewallsResponse Int
pHttpStatus_ =
  ListFirewallsResponse' :: Maybe Text
-> Maybe [FirewallMetadata] -> Int -> ListFirewallsResponse
ListFirewallsResponse'
    { $sel:nextToken:ListFirewallsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewalls:ListFirewallsResponse' :: Maybe [FirewallMetadata]
firewalls = Maybe [FirewallMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFirewallsResponse' :: 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.
listFirewallsResponse_nextToken :: Lens.Lens' ListFirewallsResponse (Prelude.Maybe Prelude.Text)
listFirewallsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFirewallsResponse -> f ListFirewallsResponse
listFirewallsResponse_nextToken = (ListFirewallsResponse -> Maybe Text)
-> (ListFirewallsResponse -> Maybe Text -> ListFirewallsResponse)
-> Lens' ListFirewallsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFirewallsResponse' :: ListFirewallsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFirewallsResponse
s@ListFirewallsResponse' {} Maybe Text
a -> ListFirewallsResponse
s {$sel:nextToken:ListFirewallsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFirewallsResponse)

-- | The firewall metadata objects for the VPCs that you specified. Depending
-- on your setting for max results and the number of firewalls you have, a
-- single call might not be the full list.
listFirewallsResponse_firewalls :: Lens.Lens' ListFirewallsResponse (Prelude.Maybe [FirewallMetadata])
listFirewallsResponse_firewalls :: (Maybe [FirewallMetadata] -> f (Maybe [FirewallMetadata]))
-> ListFirewallsResponse -> f ListFirewallsResponse
listFirewallsResponse_firewalls = (ListFirewallsResponse -> Maybe [FirewallMetadata])
-> (ListFirewallsResponse
    -> Maybe [FirewallMetadata] -> ListFirewallsResponse)
-> Lens' ListFirewallsResponse (Maybe [FirewallMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFirewallsResponse' {Maybe [FirewallMetadata]
firewalls :: Maybe [FirewallMetadata]
$sel:firewalls:ListFirewallsResponse' :: ListFirewallsResponse -> Maybe [FirewallMetadata]
firewalls} -> Maybe [FirewallMetadata]
firewalls) (\s :: ListFirewallsResponse
s@ListFirewallsResponse' {} Maybe [FirewallMetadata]
a -> ListFirewallsResponse
s {$sel:firewalls:ListFirewallsResponse' :: Maybe [FirewallMetadata]
firewalls = Maybe [FirewallMetadata]
a} :: ListFirewallsResponse) ((Maybe [FirewallMetadata] -> f (Maybe [FirewallMetadata]))
 -> ListFirewallsResponse -> f ListFirewallsResponse)
-> ((Maybe [FirewallMetadata] -> f (Maybe [FirewallMetadata]))
    -> Maybe [FirewallMetadata] -> f (Maybe [FirewallMetadata]))
-> (Maybe [FirewallMetadata] -> f (Maybe [FirewallMetadata]))
-> ListFirewallsResponse
-> f ListFirewallsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FirewallMetadata]
  [FirewallMetadata]
  [FirewallMetadata]
  [FirewallMetadata]
-> Iso
     (Maybe [FirewallMetadata])
     (Maybe [FirewallMetadata])
     (Maybe [FirewallMetadata])
     (Maybe [FirewallMetadata])
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
  [FirewallMetadata]
  [FirewallMetadata]
  [FirewallMetadata]
  [FirewallMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListFirewallsResponse