{-# 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.DescribeFirewallPolicy
-- 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 policy.
module Amazonka.NetworkFirewall.DescribeFirewallPolicy
  ( -- * Creating a Request
    DescribeFirewallPolicy (..),
    newDescribeFirewallPolicy,

    -- * Request Lenses
    describeFirewallPolicy_firewallPolicyName,
    describeFirewallPolicy_firewallPolicyArn,

    -- * Destructuring the Response
    DescribeFirewallPolicyResponse (..),
    newDescribeFirewallPolicyResponse,

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

-- |
-- Create a value of 'DescribeFirewallPolicy' 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:
--
-- 'firewallPolicyName', 'describeFirewallPolicy_firewallPolicyName' - The descriptive name of the firewall policy. You can\'t change the name
-- of a firewall policy after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'firewallPolicyArn', 'describeFirewallPolicy_firewallPolicyArn' - The Amazon Resource Name (ARN) of the firewall policy.
--
-- You must specify the ARN or the name, and you can specify both.
newDescribeFirewallPolicy ::
  DescribeFirewallPolicy
newDescribeFirewallPolicy :: DescribeFirewallPolicy
newDescribeFirewallPolicy =
  DescribeFirewallPolicy' :: Maybe Text -> Maybe Text -> DescribeFirewallPolicy
DescribeFirewallPolicy'
    { $sel:firewallPolicyName:DescribeFirewallPolicy' :: Maybe Text
firewallPolicyName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallPolicyArn:DescribeFirewallPolicy' :: Maybe Text
firewallPolicyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance Prelude.Hashable DescribeFirewallPolicy

instance Prelude.NFData DescribeFirewallPolicy

instance Core.ToHeaders DescribeFirewallPolicy where
  toHeaders :: DescribeFirewallPolicy -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeFirewallPolicy -> 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.DescribeFirewallPolicy" ::
                          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 DescribeFirewallPolicy where
  toJSON :: DescribeFirewallPolicy -> Value
toJSON DescribeFirewallPolicy' {Maybe Text
firewallPolicyArn :: Maybe Text
firewallPolicyName :: Maybe Text
$sel:firewallPolicyArn:DescribeFirewallPolicy' :: DescribeFirewallPolicy -> Maybe Text
$sel:firewallPolicyName:DescribeFirewallPolicy' :: DescribeFirewallPolicy -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FirewallPolicyName" 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
firewallPolicyName,
            (Text
"FirewallPolicyArn" 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
firewallPolicyArn
          ]
      )

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

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

-- | /See:/ 'newDescribeFirewallPolicyResponse' smart constructor.
data DescribeFirewallPolicyResponse = DescribeFirewallPolicyResponse'
  { -- | The policy for the specified firewall policy.
    DescribeFirewallPolicyResponse -> Maybe FirewallPolicy
firewallPolicy :: Prelude.Maybe FirewallPolicy,
    -- | The response's http status code.
    DescribeFirewallPolicyResponse -> Int
httpStatus :: Prelude.Int,
    -- | A token used for optimistic locking. Network Firewall returns a token to
    -- your requests that access the firewall policy. The token marks the state
    -- of the policy resource at the time of the request.
    --
    -- To make changes to the policy, you provide the token in your request.
    -- Network Firewall uses the token to ensure that the policy hasn\'t
    -- changed since you last retrieved it. If it has changed, the operation
    -- fails with an @InvalidTokenException@. If this happens, retrieve the
    -- firewall policy again to get a current copy of it with current token.
    -- Reapply your changes as needed, then try the operation again using the
    -- new token.
    DescribeFirewallPolicyResponse -> Text
updateToken :: Prelude.Text,
    -- | The high-level properties of a firewall policy. This, along with the
    -- FirewallPolicy, define the policy. You can retrieve all objects for a
    -- firewall policy by calling DescribeFirewallPolicy.
    DescribeFirewallPolicyResponse -> FirewallPolicyResponse
firewallPolicyResponse :: FirewallPolicyResponse
  }
  deriving (DescribeFirewallPolicyResponse
-> DescribeFirewallPolicyResponse -> Bool
(DescribeFirewallPolicyResponse
 -> DescribeFirewallPolicyResponse -> Bool)
-> (DescribeFirewallPolicyResponse
    -> DescribeFirewallPolicyResponse -> Bool)
-> Eq DescribeFirewallPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFirewallPolicyResponse
-> DescribeFirewallPolicyResponse -> Bool
$c/= :: DescribeFirewallPolicyResponse
-> DescribeFirewallPolicyResponse -> Bool
== :: DescribeFirewallPolicyResponse
-> DescribeFirewallPolicyResponse -> Bool
$c== :: DescribeFirewallPolicyResponse
-> DescribeFirewallPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFirewallPolicyResponse]
ReadPrec DescribeFirewallPolicyResponse
Int -> ReadS DescribeFirewallPolicyResponse
ReadS [DescribeFirewallPolicyResponse]
(Int -> ReadS DescribeFirewallPolicyResponse)
-> ReadS [DescribeFirewallPolicyResponse]
-> ReadPrec DescribeFirewallPolicyResponse
-> ReadPrec [DescribeFirewallPolicyResponse]
-> Read DescribeFirewallPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFirewallPolicyResponse]
$creadListPrec :: ReadPrec [DescribeFirewallPolicyResponse]
readPrec :: ReadPrec DescribeFirewallPolicyResponse
$creadPrec :: ReadPrec DescribeFirewallPolicyResponse
readList :: ReadS [DescribeFirewallPolicyResponse]
$creadList :: ReadS [DescribeFirewallPolicyResponse]
readsPrec :: Int -> ReadS DescribeFirewallPolicyResponse
$creadsPrec :: Int -> ReadS DescribeFirewallPolicyResponse
Prelude.Read, Int -> DescribeFirewallPolicyResponse -> ShowS
[DescribeFirewallPolicyResponse] -> ShowS
DescribeFirewallPolicyResponse -> String
(Int -> DescribeFirewallPolicyResponse -> ShowS)
-> (DescribeFirewallPolicyResponse -> String)
-> ([DescribeFirewallPolicyResponse] -> ShowS)
-> Show DescribeFirewallPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFirewallPolicyResponse] -> ShowS
$cshowList :: [DescribeFirewallPolicyResponse] -> ShowS
show :: DescribeFirewallPolicyResponse -> String
$cshow :: DescribeFirewallPolicyResponse -> String
showsPrec :: Int -> DescribeFirewallPolicyResponse -> ShowS
$cshowsPrec :: Int -> DescribeFirewallPolicyResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFirewallPolicyResponse
 -> Rep DescribeFirewallPolicyResponse x)
-> (forall x.
    Rep DescribeFirewallPolicyResponse x
    -> DescribeFirewallPolicyResponse)
-> Generic DescribeFirewallPolicyResponse
forall x.
Rep DescribeFirewallPolicyResponse x
-> DescribeFirewallPolicyResponse
forall x.
DescribeFirewallPolicyResponse
-> Rep DescribeFirewallPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFirewallPolicyResponse x
-> DescribeFirewallPolicyResponse
$cfrom :: forall x.
DescribeFirewallPolicyResponse
-> Rep DescribeFirewallPolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFirewallPolicyResponse' 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:
--
-- 'firewallPolicy', 'describeFirewallPolicyResponse_firewallPolicy' - The policy for the specified firewall policy.
--
-- 'httpStatus', 'describeFirewallPolicyResponse_httpStatus' - The response's http status code.
--
-- 'updateToken', 'describeFirewallPolicyResponse_updateToken' - A token used for optimistic locking. Network Firewall returns a token to
-- your requests that access the firewall policy. The token marks the state
-- of the policy resource at the time of the request.
--
-- To make changes to the policy, you provide the token in your request.
-- Network Firewall uses the token to ensure that the policy hasn\'t
-- changed since you last retrieved it. If it has changed, the operation
-- fails with an @InvalidTokenException@. If this happens, retrieve the
-- firewall policy again to get a current copy of it with current token.
-- Reapply your changes as needed, then try the operation again using the
-- new token.
--
-- 'firewallPolicyResponse', 'describeFirewallPolicyResponse_firewallPolicyResponse' - The high-level properties of a firewall policy. This, along with the
-- FirewallPolicy, define the policy. You can retrieve all objects for a
-- firewall policy by calling DescribeFirewallPolicy.
newDescribeFirewallPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'updateToken'
  Prelude.Text ->
  -- | 'firewallPolicyResponse'
  FirewallPolicyResponse ->
  DescribeFirewallPolicyResponse
newDescribeFirewallPolicyResponse :: Int
-> Text -> FirewallPolicyResponse -> DescribeFirewallPolicyResponse
newDescribeFirewallPolicyResponse
  Int
pHttpStatus_
  Text
pUpdateToken_
  FirewallPolicyResponse
pFirewallPolicyResponse_ =
    DescribeFirewallPolicyResponse' :: Maybe FirewallPolicy
-> Int
-> Text
-> FirewallPolicyResponse
-> DescribeFirewallPolicyResponse
DescribeFirewallPolicyResponse'
      { $sel:firewallPolicy:DescribeFirewallPolicyResponse' :: Maybe FirewallPolicy
firewallPolicy =
          Maybe FirewallPolicy
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeFirewallPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:updateToken:DescribeFirewallPolicyResponse' :: Text
updateToken = Text
pUpdateToken_,
        $sel:firewallPolicyResponse:DescribeFirewallPolicyResponse' :: FirewallPolicyResponse
firewallPolicyResponse =
          FirewallPolicyResponse
pFirewallPolicyResponse_
      }

-- | The policy for the specified firewall policy.
describeFirewallPolicyResponse_firewallPolicy :: Lens.Lens' DescribeFirewallPolicyResponse (Prelude.Maybe FirewallPolicy)
describeFirewallPolicyResponse_firewallPolicy :: (Maybe FirewallPolicy -> f (Maybe FirewallPolicy))
-> DescribeFirewallPolicyResponse
-> f DescribeFirewallPolicyResponse
describeFirewallPolicyResponse_firewallPolicy = (DescribeFirewallPolicyResponse -> Maybe FirewallPolicy)
-> (DescribeFirewallPolicyResponse
    -> Maybe FirewallPolicy -> DescribeFirewallPolicyResponse)
-> Lens
     DescribeFirewallPolicyResponse
     DescribeFirewallPolicyResponse
     (Maybe FirewallPolicy)
     (Maybe FirewallPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallPolicyResponse' {Maybe FirewallPolicy
firewallPolicy :: Maybe FirewallPolicy
$sel:firewallPolicy:DescribeFirewallPolicyResponse' :: DescribeFirewallPolicyResponse -> Maybe FirewallPolicy
firewallPolicy} -> Maybe FirewallPolicy
firewallPolicy) (\s :: DescribeFirewallPolicyResponse
s@DescribeFirewallPolicyResponse' {} Maybe FirewallPolicy
a -> DescribeFirewallPolicyResponse
s {$sel:firewallPolicy:DescribeFirewallPolicyResponse' :: Maybe FirewallPolicy
firewallPolicy = Maybe FirewallPolicy
a} :: DescribeFirewallPolicyResponse)

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

-- | A token used for optimistic locking. Network Firewall returns a token to
-- your requests that access the firewall policy. The token marks the state
-- of the policy resource at the time of the request.
--
-- To make changes to the policy, you provide the token in your request.
-- Network Firewall uses the token to ensure that the policy hasn\'t
-- changed since you last retrieved it. If it has changed, the operation
-- fails with an @InvalidTokenException@. If this happens, retrieve the
-- firewall policy again to get a current copy of it with current token.
-- Reapply your changes as needed, then try the operation again using the
-- new token.
describeFirewallPolicyResponse_updateToken :: Lens.Lens' DescribeFirewallPolicyResponse Prelude.Text
describeFirewallPolicyResponse_updateToken :: (Text -> f Text)
-> DescribeFirewallPolicyResponse
-> f DescribeFirewallPolicyResponse
describeFirewallPolicyResponse_updateToken = (DescribeFirewallPolicyResponse -> Text)
-> (DescribeFirewallPolicyResponse
    -> Text -> DescribeFirewallPolicyResponse)
-> Lens
     DescribeFirewallPolicyResponse
     DescribeFirewallPolicyResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallPolicyResponse' {Text
updateToken :: Text
$sel:updateToken:DescribeFirewallPolicyResponse' :: DescribeFirewallPolicyResponse -> Text
updateToken} -> Text
updateToken) (\s :: DescribeFirewallPolicyResponse
s@DescribeFirewallPolicyResponse' {} Text
a -> DescribeFirewallPolicyResponse
s {$sel:updateToken:DescribeFirewallPolicyResponse' :: Text
updateToken = Text
a} :: DescribeFirewallPolicyResponse)

-- | The high-level properties of a firewall policy. This, along with the
-- FirewallPolicy, define the policy. You can retrieve all objects for a
-- firewall policy by calling DescribeFirewallPolicy.
describeFirewallPolicyResponse_firewallPolicyResponse :: Lens.Lens' DescribeFirewallPolicyResponse FirewallPolicyResponse
describeFirewallPolicyResponse_firewallPolicyResponse :: (FirewallPolicyResponse -> f FirewallPolicyResponse)
-> DescribeFirewallPolicyResponse
-> f DescribeFirewallPolicyResponse
describeFirewallPolicyResponse_firewallPolicyResponse = (DescribeFirewallPolicyResponse -> FirewallPolicyResponse)
-> (DescribeFirewallPolicyResponse
    -> FirewallPolicyResponse -> DescribeFirewallPolicyResponse)
-> Lens
     DescribeFirewallPolicyResponse
     DescribeFirewallPolicyResponse
     FirewallPolicyResponse
     FirewallPolicyResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFirewallPolicyResponse' {FirewallPolicyResponse
firewallPolicyResponse :: FirewallPolicyResponse
$sel:firewallPolicyResponse:DescribeFirewallPolicyResponse' :: DescribeFirewallPolicyResponse -> FirewallPolicyResponse
firewallPolicyResponse} -> FirewallPolicyResponse
firewallPolicyResponse) (\s :: DescribeFirewallPolicyResponse
s@DescribeFirewallPolicyResponse' {} FirewallPolicyResponse
a -> DescribeFirewallPolicyResponse
s {$sel:firewallPolicyResponse:DescribeFirewallPolicyResponse' :: FirewallPolicyResponse
firewallPolicyResponse = FirewallPolicyResponse
a} :: DescribeFirewallPolicyResponse)

instance
  Prelude.NFData
    DescribeFirewallPolicyResponse