{-# 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.DescribeFirewall
-- 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)
--
-- Returns the data objects for the specified firewall.
module Amazonka.NetworkFirewall.DescribeFirewall
  ( -- * Creating a Request
    DescribeFirewall (..),
    newDescribeFirewall,

    -- * Request Lenses
    describeFirewall_firewallArn,
    describeFirewall_firewallName,

    -- * Destructuring the Response
    DescribeFirewallResponse (..),
    newDescribeFirewallResponse,

    -- * Response Lenses
    describeFirewallResponse_firewallStatus,
    describeFirewallResponse_updateToken,
    describeFirewallResponse_firewall,
    describeFirewallResponse_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:/ 'newDescribeFirewall' smart constructor.
data DescribeFirewall = DescribeFirewall'
  { -- | The Amazon Resource Name (ARN) of the firewall.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeFirewall -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
    -- | The descriptive name of the firewall. You can\'t change the name of a
    -- firewall after you create it.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeFirewall -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeFirewall -> DescribeFirewall -> Bool
(DescribeFirewall -> DescribeFirewall -> Bool)
-> (DescribeFirewall -> DescribeFirewall -> Bool)
-> Eq DescribeFirewall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFirewall -> DescribeFirewall -> Bool
$c/= :: DescribeFirewall -> DescribeFirewall -> Bool
== :: DescribeFirewall -> DescribeFirewall -> Bool
$c== :: DescribeFirewall -> DescribeFirewall -> Bool
Prelude.Eq, ReadPrec [DescribeFirewall]
ReadPrec DescribeFirewall
Int -> ReadS DescribeFirewall
ReadS [DescribeFirewall]
(Int -> ReadS DescribeFirewall)
-> ReadS [DescribeFirewall]
-> ReadPrec DescribeFirewall
-> ReadPrec [DescribeFirewall]
-> Read DescribeFirewall
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFirewall]
$creadListPrec :: ReadPrec [DescribeFirewall]
readPrec :: ReadPrec DescribeFirewall
$creadPrec :: ReadPrec DescribeFirewall
readList :: ReadS [DescribeFirewall]
$creadList :: ReadS [DescribeFirewall]
readsPrec :: Int -> ReadS DescribeFirewall
$creadsPrec :: Int -> ReadS DescribeFirewall
Prelude.Read, Int -> DescribeFirewall -> ShowS
[DescribeFirewall] -> ShowS
DescribeFirewall -> String
(Int -> DescribeFirewall -> ShowS)
-> (DescribeFirewall -> String)
-> ([DescribeFirewall] -> ShowS)
-> Show DescribeFirewall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFirewall] -> ShowS
$cshowList :: [DescribeFirewall] -> ShowS
show :: DescribeFirewall -> String
$cshow :: DescribeFirewall -> String
showsPrec :: Int -> DescribeFirewall -> ShowS
$cshowsPrec :: Int -> DescribeFirewall -> ShowS
Prelude.Show, (forall x. DescribeFirewall -> Rep DescribeFirewall x)
-> (forall x. Rep DescribeFirewall x -> DescribeFirewall)
-> Generic DescribeFirewall
forall x. Rep DescribeFirewall x -> DescribeFirewall
forall x. DescribeFirewall -> Rep DescribeFirewall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFirewall x -> DescribeFirewall
$cfrom :: forall x. DescribeFirewall -> Rep DescribeFirewall x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFirewall' 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:
--
-- 'firewallArn', 'describeFirewall_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'firewallName', 'describeFirewall_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
newDescribeFirewall ::
  DescribeFirewall
newDescribeFirewall :: DescribeFirewall
newDescribeFirewall =
  DescribeFirewall' :: Maybe Text -> Maybe Text -> DescribeFirewall
DescribeFirewall'
    { $sel:firewallArn:DescribeFirewall' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:DescribeFirewall' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
describeFirewall_firewallArn :: Lens.Lens' DescribeFirewall (Prelude.Maybe Prelude.Text)
describeFirewall_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DescribeFirewall -> f DescribeFirewall
describeFirewall_firewallArn = (DescribeFirewall -> Maybe Text)
-> (DescribeFirewall -> Maybe Text -> DescribeFirewall)
-> Lens DescribeFirewall DescribeFirewall (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewall' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DescribeFirewall' :: DescribeFirewall -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DescribeFirewall
s@DescribeFirewall' {} Maybe Text
a -> DescribeFirewall
s {$sel:firewallArn:DescribeFirewall' :: Maybe Text
firewallArn = Maybe Text
a} :: DescribeFirewall)

-- | The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
describeFirewall_firewallName :: Lens.Lens' DescribeFirewall (Prelude.Maybe Prelude.Text)
describeFirewall_firewallName :: (Maybe Text -> f (Maybe Text))
-> DescribeFirewall -> f DescribeFirewall
describeFirewall_firewallName = (DescribeFirewall -> Maybe Text)
-> (DescribeFirewall -> Maybe Text -> DescribeFirewall)
-> Lens DescribeFirewall DescribeFirewall (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewall' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:DescribeFirewall' :: DescribeFirewall -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: DescribeFirewall
s@DescribeFirewall' {} Maybe Text
a -> DescribeFirewall
s {$sel:firewallName:DescribeFirewall' :: Maybe Text
firewallName = Maybe Text
a} :: DescribeFirewall)

instance Core.AWSRequest DescribeFirewall where
  type
    AWSResponse DescribeFirewall =
      DescribeFirewallResponse
  request :: DescribeFirewall -> Request DescribeFirewall
request = Service -> DescribeFirewall -> Request DescribeFirewall
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeFirewall
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeFirewall)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeFirewall))
-> Logger
-> Service
-> Proxy DescribeFirewall
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeFirewall)))
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 FirewallStatus
-> Maybe Text -> Maybe Firewall -> Int -> DescribeFirewallResponse
DescribeFirewallResponse'
            (Maybe FirewallStatus
 -> Maybe Text -> Maybe Firewall -> Int -> DescribeFirewallResponse)
-> Either String (Maybe FirewallStatus)
-> Either
     String
     (Maybe Text -> Maybe Firewall -> Int -> DescribeFirewallResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FirewallStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallStatus")
            Either
  String
  (Maybe Text -> Maybe Firewall -> Int -> DescribeFirewallResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Firewall -> Int -> DescribeFirewallResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UpdateToken")
            Either String (Maybe Firewall -> Int -> DescribeFirewallResponse)
-> Either String (Maybe Firewall)
-> Either String (Int -> DescribeFirewallResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Firewall)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Firewall")
            Either String (Int -> DescribeFirewallResponse)
-> Either String Int -> Either String DescribeFirewallResponse
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 DescribeFirewall

instance Prelude.NFData DescribeFirewall

instance Core.ToHeaders DescribeFirewall where
  toHeaders :: DescribeFirewall -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeFirewall -> 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.DescribeFirewall" ::
                          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 DescribeFirewall where
  toJSON :: DescribeFirewall -> Value
toJSON DescribeFirewall' {Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallName:DescribeFirewall' :: DescribeFirewall -> Maybe Text
$sel:firewallArn:DescribeFirewall' :: DescribeFirewall -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FirewallArn" 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
firewallArn,
            (Text
"FirewallName" 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
firewallName
          ]
      )

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

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

-- | /See:/ 'newDescribeFirewallResponse' smart constructor.
data DescribeFirewallResponse = DescribeFirewallResponse'
  { -- | Detailed information about the current status of a Firewall. You can
    -- retrieve this for a firewall by calling DescribeFirewall and providing
    -- the firewall name and ARN.
    DescribeFirewallResponse -> Maybe FirewallStatus
firewallStatus :: Prelude.Maybe FirewallStatus,
    -- | An optional token that you can use for optimistic locking. Network
    -- Firewall returns a token to your requests that access the firewall. The
    -- token marks the state of the firewall resource at the time of the
    -- request.
    --
    -- To make an unconditional change to the firewall, omit the token in your
    -- update request. Without the token, Network Firewall performs your
    -- updates regardless of whether the firewall has changed since you last
    -- retrieved it.
    --
    -- To make a conditional change to the firewall, provide the token in your
    -- update request. Network Firewall uses the token to ensure that the
    -- firewall hasn\'t changed since you last retrieved it. If it has changed,
    -- the operation fails with an @InvalidTokenException@. If this happens,
    -- retrieve the firewall again to get a current copy of it with a new
    -- token. Reapply your changes as needed, then try the operation again
    -- using the new token.
    DescribeFirewallResponse -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | The configuration settings for the firewall. These settings include the
    -- firewall policy and the subnets in your VPC to use for the firewall
    -- endpoints.
    DescribeFirewallResponse -> Maybe Firewall
firewall :: Prelude.Maybe Firewall,
    -- | The response's http status code.
    DescribeFirewallResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFirewallResponse -> DescribeFirewallResponse -> Bool
(DescribeFirewallResponse -> DescribeFirewallResponse -> Bool)
-> (DescribeFirewallResponse -> DescribeFirewallResponse -> Bool)
-> Eq DescribeFirewallResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFirewallResponse -> DescribeFirewallResponse -> Bool
$c/= :: DescribeFirewallResponse -> DescribeFirewallResponse -> Bool
== :: DescribeFirewallResponse -> DescribeFirewallResponse -> Bool
$c== :: DescribeFirewallResponse -> DescribeFirewallResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFirewallResponse]
ReadPrec DescribeFirewallResponse
Int -> ReadS DescribeFirewallResponse
ReadS [DescribeFirewallResponse]
(Int -> ReadS DescribeFirewallResponse)
-> ReadS [DescribeFirewallResponse]
-> ReadPrec DescribeFirewallResponse
-> ReadPrec [DescribeFirewallResponse]
-> Read DescribeFirewallResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFirewallResponse]
$creadListPrec :: ReadPrec [DescribeFirewallResponse]
readPrec :: ReadPrec DescribeFirewallResponse
$creadPrec :: ReadPrec DescribeFirewallResponse
readList :: ReadS [DescribeFirewallResponse]
$creadList :: ReadS [DescribeFirewallResponse]
readsPrec :: Int -> ReadS DescribeFirewallResponse
$creadsPrec :: Int -> ReadS DescribeFirewallResponse
Prelude.Read, Int -> DescribeFirewallResponse -> ShowS
[DescribeFirewallResponse] -> ShowS
DescribeFirewallResponse -> String
(Int -> DescribeFirewallResponse -> ShowS)
-> (DescribeFirewallResponse -> String)
-> ([DescribeFirewallResponse] -> ShowS)
-> Show DescribeFirewallResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFirewallResponse] -> ShowS
$cshowList :: [DescribeFirewallResponse] -> ShowS
show :: DescribeFirewallResponse -> String
$cshow :: DescribeFirewallResponse -> String
showsPrec :: Int -> DescribeFirewallResponse -> ShowS
$cshowsPrec :: Int -> DescribeFirewallResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFirewallResponse -> Rep DescribeFirewallResponse x)
-> (forall x.
    Rep DescribeFirewallResponse x -> DescribeFirewallResponse)
-> Generic DescribeFirewallResponse
forall x.
Rep DescribeFirewallResponse x -> DescribeFirewallResponse
forall x.
DescribeFirewallResponse -> Rep DescribeFirewallResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFirewallResponse x -> DescribeFirewallResponse
$cfrom :: forall x.
DescribeFirewallResponse -> Rep DescribeFirewallResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFirewallResponse' 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:
--
-- 'firewallStatus', 'describeFirewallResponse_firewallStatus' - Detailed information about the current status of a Firewall. You can
-- retrieve this for a firewall by calling DescribeFirewall and providing
-- the firewall name and ARN.
--
-- 'updateToken', 'describeFirewallResponse_updateToken' - An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
--
-- 'firewall', 'describeFirewallResponse_firewall' - The configuration settings for the firewall. These settings include the
-- firewall policy and the subnets in your VPC to use for the firewall
-- endpoints.
--
-- 'httpStatus', 'describeFirewallResponse_httpStatus' - The response's http status code.
newDescribeFirewallResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFirewallResponse
newDescribeFirewallResponse :: Int -> DescribeFirewallResponse
newDescribeFirewallResponse Int
pHttpStatus_ =
  DescribeFirewallResponse' :: Maybe FirewallStatus
-> Maybe Text -> Maybe Firewall -> Int -> DescribeFirewallResponse
DescribeFirewallResponse'
    { $sel:firewallStatus:DescribeFirewallResponse' :: Maybe FirewallStatus
firewallStatus =
        Maybe FirewallStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:updateToken:DescribeFirewallResponse' :: Maybe Text
updateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewall:DescribeFirewallResponse' :: Maybe Firewall
firewall = Maybe Firewall
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeFirewallResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Detailed information about the current status of a Firewall. You can
-- retrieve this for a firewall by calling DescribeFirewall and providing
-- the firewall name and ARN.
describeFirewallResponse_firewallStatus :: Lens.Lens' DescribeFirewallResponse (Prelude.Maybe FirewallStatus)
describeFirewallResponse_firewallStatus :: (Maybe FirewallStatus -> f (Maybe FirewallStatus))
-> DescribeFirewallResponse -> f DescribeFirewallResponse
describeFirewallResponse_firewallStatus = (DescribeFirewallResponse -> Maybe FirewallStatus)
-> (DescribeFirewallResponse
    -> Maybe FirewallStatus -> DescribeFirewallResponse)
-> Lens
     DescribeFirewallResponse
     DescribeFirewallResponse
     (Maybe FirewallStatus)
     (Maybe FirewallStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallResponse' {Maybe FirewallStatus
firewallStatus :: Maybe FirewallStatus
$sel:firewallStatus:DescribeFirewallResponse' :: DescribeFirewallResponse -> Maybe FirewallStatus
firewallStatus} -> Maybe FirewallStatus
firewallStatus) (\s :: DescribeFirewallResponse
s@DescribeFirewallResponse' {} Maybe FirewallStatus
a -> DescribeFirewallResponse
s {$sel:firewallStatus:DescribeFirewallResponse' :: Maybe FirewallStatus
firewallStatus = Maybe FirewallStatus
a} :: DescribeFirewallResponse)

-- | An optional token that you can use for optimistic locking. Network
-- Firewall returns a token to your requests that access the firewall. The
-- token marks the state of the firewall resource at the time of the
-- request.
--
-- To make an unconditional change to the firewall, omit the token in your
-- update request. Without the token, Network Firewall performs your
-- updates regardless of whether the firewall has changed since you last
-- retrieved it.
--
-- To make a conditional change to the firewall, provide the token in your
-- update request. Network Firewall uses the token to ensure that the
-- firewall hasn\'t changed since you last retrieved it. If it has changed,
-- the operation fails with an @InvalidTokenException@. If this happens,
-- retrieve the firewall again to get a current copy of it with a new
-- token. Reapply your changes as needed, then try the operation again
-- using the new token.
describeFirewallResponse_updateToken :: Lens.Lens' DescribeFirewallResponse (Prelude.Maybe Prelude.Text)
describeFirewallResponse_updateToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFirewallResponse -> f DescribeFirewallResponse
describeFirewallResponse_updateToken = (DescribeFirewallResponse -> Maybe Text)
-> (DescribeFirewallResponse
    -> Maybe Text -> DescribeFirewallResponse)
-> Lens
     DescribeFirewallResponse
     DescribeFirewallResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallResponse' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:DescribeFirewallResponse' :: DescribeFirewallResponse -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: DescribeFirewallResponse
s@DescribeFirewallResponse' {} Maybe Text
a -> DescribeFirewallResponse
s {$sel:updateToken:DescribeFirewallResponse' :: Maybe Text
updateToken = Maybe Text
a} :: DescribeFirewallResponse)

-- | The configuration settings for the firewall. These settings include the
-- firewall policy and the subnets in your VPC to use for the firewall
-- endpoints.
describeFirewallResponse_firewall :: Lens.Lens' DescribeFirewallResponse (Prelude.Maybe Firewall)
describeFirewallResponse_firewall :: (Maybe Firewall -> f (Maybe Firewall))
-> DescribeFirewallResponse -> f DescribeFirewallResponse
describeFirewallResponse_firewall = (DescribeFirewallResponse -> Maybe Firewall)
-> (DescribeFirewallResponse
    -> Maybe Firewall -> DescribeFirewallResponse)
-> Lens
     DescribeFirewallResponse
     DescribeFirewallResponse
     (Maybe Firewall)
     (Maybe Firewall)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallResponse' {Maybe Firewall
firewall :: Maybe Firewall
$sel:firewall:DescribeFirewallResponse' :: DescribeFirewallResponse -> Maybe Firewall
firewall} -> Maybe Firewall
firewall) (\s :: DescribeFirewallResponse
s@DescribeFirewallResponse' {} Maybe Firewall
a -> DescribeFirewallResponse
s {$sel:firewall:DescribeFirewallResponse' :: Maybe Firewall
firewall = Maybe Firewall
a} :: DescribeFirewallResponse)

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

instance Prelude.NFData DescribeFirewallResponse