{-# 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.UpdateFirewallDeleteProtection
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the flag, @DeleteProtection@, which indicates whether it is
-- possible to delete the firewall. If the flag is set to @TRUE@, the
-- firewall is protected against deletion. This setting helps protect
-- against accidentally deleting a firewall that\'s in use.
module Amazonka.NetworkFirewall.UpdateFirewallDeleteProtection
  ( -- * Creating a Request
    UpdateFirewallDeleteProtection (..),
    newUpdateFirewallDeleteProtection,

    -- * Request Lenses
    updateFirewallDeleteProtection_firewallArn,
    updateFirewallDeleteProtection_firewallName,
    updateFirewallDeleteProtection_updateToken,
    updateFirewallDeleteProtection_deleteProtection,

    -- * Destructuring the Response
    UpdateFirewallDeleteProtectionResponse (..),
    newUpdateFirewallDeleteProtectionResponse,

    -- * Response Lenses
    updateFirewallDeleteProtectionResponse_deleteProtection,
    updateFirewallDeleteProtectionResponse_firewallArn,
    updateFirewallDeleteProtectionResponse_firewallName,
    updateFirewallDeleteProtectionResponse_updateToken,
    updateFirewallDeleteProtectionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkFirewall.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateFirewallDeleteProtection' smart constructor.
data UpdateFirewallDeleteProtection = UpdateFirewallDeleteProtection'
  { -- | The Amazon Resource Name (ARN) of the firewall.
    --
    -- You must specify the ARN or the name, and you can specify both.
    UpdateFirewallDeleteProtection -> 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.
    UpdateFirewallDeleteProtection -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UpdateFirewallDeleteProtection -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | A flag indicating whether it is possible to delete the firewall. A
    -- setting of @TRUE@ indicates that the firewall is protected against
    -- deletion. Use this setting to protect against accidentally deleting a
    -- firewall that is in use. When you create a firewall, the operation
    -- initializes this flag to @TRUE@.
    UpdateFirewallDeleteProtection -> Bool
deleteProtection :: Prelude.Bool
  }
  deriving (UpdateFirewallDeleteProtection
-> UpdateFirewallDeleteProtection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFirewallDeleteProtection
-> UpdateFirewallDeleteProtection -> Bool
$c/= :: UpdateFirewallDeleteProtection
-> UpdateFirewallDeleteProtection -> Bool
== :: UpdateFirewallDeleteProtection
-> UpdateFirewallDeleteProtection -> Bool
$c== :: UpdateFirewallDeleteProtection
-> UpdateFirewallDeleteProtection -> Bool
Prelude.Eq, ReadPrec [UpdateFirewallDeleteProtection]
ReadPrec UpdateFirewallDeleteProtection
Int -> ReadS UpdateFirewallDeleteProtection
ReadS [UpdateFirewallDeleteProtection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFirewallDeleteProtection]
$creadListPrec :: ReadPrec [UpdateFirewallDeleteProtection]
readPrec :: ReadPrec UpdateFirewallDeleteProtection
$creadPrec :: ReadPrec UpdateFirewallDeleteProtection
readList :: ReadS [UpdateFirewallDeleteProtection]
$creadList :: ReadS [UpdateFirewallDeleteProtection]
readsPrec :: Int -> ReadS UpdateFirewallDeleteProtection
$creadsPrec :: Int -> ReadS UpdateFirewallDeleteProtection
Prelude.Read, Int -> UpdateFirewallDeleteProtection -> ShowS
[UpdateFirewallDeleteProtection] -> ShowS
UpdateFirewallDeleteProtection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFirewallDeleteProtection] -> ShowS
$cshowList :: [UpdateFirewallDeleteProtection] -> ShowS
show :: UpdateFirewallDeleteProtection -> String
$cshow :: UpdateFirewallDeleteProtection -> String
showsPrec :: Int -> UpdateFirewallDeleteProtection -> ShowS
$cshowsPrec :: Int -> UpdateFirewallDeleteProtection -> ShowS
Prelude.Show, forall x.
Rep UpdateFirewallDeleteProtection x
-> UpdateFirewallDeleteProtection
forall x.
UpdateFirewallDeleteProtection
-> Rep UpdateFirewallDeleteProtection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFirewallDeleteProtection x
-> UpdateFirewallDeleteProtection
$cfrom :: forall x.
UpdateFirewallDeleteProtection
-> Rep UpdateFirewallDeleteProtection x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFirewallDeleteProtection' 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', 'updateFirewallDeleteProtection_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'firewallName', 'updateFirewallDeleteProtection_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.
--
-- 'updateToken', 'updateFirewallDeleteProtection_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.
--
-- 'deleteProtection', 'updateFirewallDeleteProtection_deleteProtection' - A flag indicating whether it is possible to delete the firewall. A
-- setting of @TRUE@ indicates that the firewall is protected against
-- deletion. Use this setting to protect against accidentally deleting a
-- firewall that is in use. When you create a firewall, the operation
-- initializes this flag to @TRUE@.
newUpdateFirewallDeleteProtection ::
  -- | 'deleteProtection'
  Prelude.Bool ->
  UpdateFirewallDeleteProtection
newUpdateFirewallDeleteProtection :: Bool -> UpdateFirewallDeleteProtection
newUpdateFirewallDeleteProtection Bool
pDeleteProtection_ =
  UpdateFirewallDeleteProtection'
    { $sel:firewallArn:UpdateFirewallDeleteProtection' :: Maybe Text
firewallArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:UpdateFirewallDeleteProtection' :: Maybe Text
firewallName = forall a. Maybe a
Prelude.Nothing,
      $sel:updateToken:UpdateFirewallDeleteProtection' :: Maybe Text
updateToken = forall a. Maybe a
Prelude.Nothing,
      $sel:deleteProtection:UpdateFirewallDeleteProtection' :: Bool
deleteProtection = Bool
pDeleteProtection_
    }

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

-- | 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.
updateFirewallDeleteProtection_firewallName :: Lens.Lens' UpdateFirewallDeleteProtection (Prelude.Maybe Prelude.Text)
updateFirewallDeleteProtection_firewallName :: Lens' UpdateFirewallDeleteProtection (Maybe Text)
updateFirewallDeleteProtection_firewallName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtection' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: UpdateFirewallDeleteProtection
s@UpdateFirewallDeleteProtection' {} Maybe Text
a -> UpdateFirewallDeleteProtection
s {$sel:firewallName:UpdateFirewallDeleteProtection' :: Maybe Text
firewallName = Maybe Text
a} :: UpdateFirewallDeleteProtection)

-- | 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.
updateFirewallDeleteProtection_updateToken :: Lens.Lens' UpdateFirewallDeleteProtection (Prelude.Maybe Prelude.Text)
updateFirewallDeleteProtection_updateToken :: Lens' UpdateFirewallDeleteProtection (Maybe Text)
updateFirewallDeleteProtection_updateToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtection' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: UpdateFirewallDeleteProtection
s@UpdateFirewallDeleteProtection' {} Maybe Text
a -> UpdateFirewallDeleteProtection
s {$sel:updateToken:UpdateFirewallDeleteProtection' :: Maybe Text
updateToken = Maybe Text
a} :: UpdateFirewallDeleteProtection)

-- | A flag indicating whether it is possible to delete the firewall. A
-- setting of @TRUE@ indicates that the firewall is protected against
-- deletion. Use this setting to protect against accidentally deleting a
-- firewall that is in use. When you create a firewall, the operation
-- initializes this flag to @TRUE@.
updateFirewallDeleteProtection_deleteProtection :: Lens.Lens' UpdateFirewallDeleteProtection Prelude.Bool
updateFirewallDeleteProtection_deleteProtection :: Lens' UpdateFirewallDeleteProtection Bool
updateFirewallDeleteProtection_deleteProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtection' {Bool
deleteProtection :: Bool
$sel:deleteProtection:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Bool
deleteProtection} -> Bool
deleteProtection) (\s :: UpdateFirewallDeleteProtection
s@UpdateFirewallDeleteProtection' {} Bool
a -> UpdateFirewallDeleteProtection
s {$sel:deleteProtection:UpdateFirewallDeleteProtection' :: Bool
deleteProtection = Bool
a} :: UpdateFirewallDeleteProtection)

instance
  Core.AWSRequest
    UpdateFirewallDeleteProtection
  where
  type
    AWSResponse UpdateFirewallDeleteProtection =
      UpdateFirewallDeleteProtectionResponse
  request :: (Service -> Service)
-> UpdateFirewallDeleteProtection
-> Request UpdateFirewallDeleteProtection
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateFirewallDeleteProtection
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateFirewallDeleteProtection)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateFirewallDeleteProtectionResponse
UpdateFirewallDeleteProtectionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DeleteProtection")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FirewallArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FirewallName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UpdateToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateFirewallDeleteProtection
  where
  hashWithSalt :: Int -> UpdateFirewallDeleteProtection -> Int
hashWithSalt
    Int
_salt
    UpdateFirewallDeleteProtection' {Bool
Maybe Text
deleteProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:deleteProtection:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Bool
$sel:updateToken:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firewallArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firewallName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
updateToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
deleteProtection

instance
  Prelude.NFData
    UpdateFirewallDeleteProtection
  where
  rnf :: UpdateFirewallDeleteProtection -> ()
rnf UpdateFirewallDeleteProtection' {Bool
Maybe Text
deleteProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:deleteProtection:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Bool
$sel:updateToken:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
updateToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
deleteProtection

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

instance Data.ToJSON UpdateFirewallDeleteProtection where
  toJSON :: UpdateFirewallDeleteProtection -> Value
toJSON UpdateFirewallDeleteProtection' {Bool
Maybe Text
deleteProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:deleteProtection:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Bool
$sel:updateToken:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallDeleteProtection' :: UpdateFirewallDeleteProtection -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FirewallArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallArn,
            (Key
"FirewallName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firewallName,
            (Key
"UpdateToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
updateToken,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"DeleteProtection" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
deleteProtection)
          ]
      )

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

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

-- | /See:/ 'newUpdateFirewallDeleteProtectionResponse' smart constructor.
data UpdateFirewallDeleteProtectionResponse = UpdateFirewallDeleteProtectionResponse'
  { -- | A flag indicating whether it is possible to delete the firewall. A
    -- setting of @TRUE@ indicates that the firewall is protected against
    -- deletion. Use this setting to protect against accidentally deleting a
    -- firewall that is in use. When you create a firewall, the operation
    -- initializes this flag to @TRUE@.
    UpdateFirewallDeleteProtectionResponse -> Maybe Bool
deleteProtection :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of the firewall.
    UpdateFirewallDeleteProtectionResponse -> 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.
    UpdateFirewallDeleteProtectionResponse -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UpdateFirewallDeleteProtectionResponse -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateFirewallDeleteProtectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFirewallDeleteProtectionResponse
-> UpdateFirewallDeleteProtectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFirewallDeleteProtectionResponse
-> UpdateFirewallDeleteProtectionResponse -> Bool
$c/= :: UpdateFirewallDeleteProtectionResponse
-> UpdateFirewallDeleteProtectionResponse -> Bool
== :: UpdateFirewallDeleteProtectionResponse
-> UpdateFirewallDeleteProtectionResponse -> Bool
$c== :: UpdateFirewallDeleteProtectionResponse
-> UpdateFirewallDeleteProtectionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFirewallDeleteProtectionResponse]
ReadPrec UpdateFirewallDeleteProtectionResponse
Int -> ReadS UpdateFirewallDeleteProtectionResponse
ReadS [UpdateFirewallDeleteProtectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFirewallDeleteProtectionResponse]
$creadListPrec :: ReadPrec [UpdateFirewallDeleteProtectionResponse]
readPrec :: ReadPrec UpdateFirewallDeleteProtectionResponse
$creadPrec :: ReadPrec UpdateFirewallDeleteProtectionResponse
readList :: ReadS [UpdateFirewallDeleteProtectionResponse]
$creadList :: ReadS [UpdateFirewallDeleteProtectionResponse]
readsPrec :: Int -> ReadS UpdateFirewallDeleteProtectionResponse
$creadsPrec :: Int -> ReadS UpdateFirewallDeleteProtectionResponse
Prelude.Read, Int -> UpdateFirewallDeleteProtectionResponse -> ShowS
[UpdateFirewallDeleteProtectionResponse] -> ShowS
UpdateFirewallDeleteProtectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFirewallDeleteProtectionResponse] -> ShowS
$cshowList :: [UpdateFirewallDeleteProtectionResponse] -> ShowS
show :: UpdateFirewallDeleteProtectionResponse -> String
$cshow :: UpdateFirewallDeleteProtectionResponse -> String
showsPrec :: Int -> UpdateFirewallDeleteProtectionResponse -> ShowS
$cshowsPrec :: Int -> UpdateFirewallDeleteProtectionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateFirewallDeleteProtectionResponse x
-> UpdateFirewallDeleteProtectionResponse
forall x.
UpdateFirewallDeleteProtectionResponse
-> Rep UpdateFirewallDeleteProtectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFirewallDeleteProtectionResponse x
-> UpdateFirewallDeleteProtectionResponse
$cfrom :: forall x.
UpdateFirewallDeleteProtectionResponse
-> Rep UpdateFirewallDeleteProtectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFirewallDeleteProtectionResponse' 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:
--
-- 'deleteProtection', 'updateFirewallDeleteProtectionResponse_deleteProtection' - A flag indicating whether it is possible to delete the firewall. A
-- setting of @TRUE@ indicates that the firewall is protected against
-- deletion. Use this setting to protect against accidentally deleting a
-- firewall that is in use. When you create a firewall, the operation
-- initializes this flag to @TRUE@.
--
-- 'firewallArn', 'updateFirewallDeleteProtectionResponse_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'updateFirewallDeleteProtectionResponse_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'updateToken', 'updateFirewallDeleteProtectionResponse_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.
--
-- 'httpStatus', 'updateFirewallDeleteProtectionResponse_httpStatus' - The response's http status code.
newUpdateFirewallDeleteProtectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFirewallDeleteProtectionResponse
newUpdateFirewallDeleteProtectionResponse :: Int -> UpdateFirewallDeleteProtectionResponse
newUpdateFirewallDeleteProtectionResponse
  Int
pHttpStatus_ =
    UpdateFirewallDeleteProtectionResponse'
      { $sel:deleteProtection:UpdateFirewallDeleteProtectionResponse' :: Maybe Bool
deleteProtection =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallArn:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
firewallArn = forall a. Maybe a
Prelude.Nothing,
        $sel:firewallName:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
firewallName = forall a. Maybe a
Prelude.Nothing,
        $sel:updateToken:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
updateToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateFirewallDeleteProtectionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A flag indicating whether it is possible to delete the firewall. A
-- setting of @TRUE@ indicates that the firewall is protected against
-- deletion. Use this setting to protect against accidentally deleting a
-- firewall that is in use. When you create a firewall, the operation
-- initializes this flag to @TRUE@.
updateFirewallDeleteProtectionResponse_deleteProtection :: Lens.Lens' UpdateFirewallDeleteProtectionResponse (Prelude.Maybe Prelude.Bool)
updateFirewallDeleteProtectionResponse_deleteProtection :: Lens' UpdateFirewallDeleteProtectionResponse (Maybe Bool)
updateFirewallDeleteProtectionResponse_deleteProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtectionResponse' {Maybe Bool
deleteProtection :: Maybe Bool
$sel:deleteProtection:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Bool
deleteProtection} -> Maybe Bool
deleteProtection) (\s :: UpdateFirewallDeleteProtectionResponse
s@UpdateFirewallDeleteProtectionResponse' {} Maybe Bool
a -> UpdateFirewallDeleteProtectionResponse
s {$sel:deleteProtection:UpdateFirewallDeleteProtectionResponse' :: Maybe Bool
deleteProtection = Maybe Bool
a} :: UpdateFirewallDeleteProtectionResponse)

-- | The Amazon Resource Name (ARN) of the firewall.
updateFirewallDeleteProtectionResponse_firewallArn :: Lens.Lens' UpdateFirewallDeleteProtectionResponse (Prelude.Maybe Prelude.Text)
updateFirewallDeleteProtectionResponse_firewallArn :: Lens' UpdateFirewallDeleteProtectionResponse (Maybe Text)
updateFirewallDeleteProtectionResponse_firewallArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtectionResponse' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: UpdateFirewallDeleteProtectionResponse
s@UpdateFirewallDeleteProtectionResponse' {} Maybe Text
a -> UpdateFirewallDeleteProtectionResponse
s {$sel:firewallArn:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
firewallArn = Maybe Text
a} :: UpdateFirewallDeleteProtectionResponse)

-- | The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
updateFirewallDeleteProtectionResponse_firewallName :: Lens.Lens' UpdateFirewallDeleteProtectionResponse (Prelude.Maybe Prelude.Text)
updateFirewallDeleteProtectionResponse_firewallName :: Lens' UpdateFirewallDeleteProtectionResponse (Maybe Text)
updateFirewallDeleteProtectionResponse_firewallName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtectionResponse' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: UpdateFirewallDeleteProtectionResponse
s@UpdateFirewallDeleteProtectionResponse' {} Maybe Text
a -> UpdateFirewallDeleteProtectionResponse
s {$sel:firewallName:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
firewallName = Maybe Text
a} :: UpdateFirewallDeleteProtectionResponse)

-- | 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.
updateFirewallDeleteProtectionResponse_updateToken :: Lens.Lens' UpdateFirewallDeleteProtectionResponse (Prelude.Maybe Prelude.Text)
updateFirewallDeleteProtectionResponse_updateToken :: Lens' UpdateFirewallDeleteProtectionResponse (Maybe Text)
updateFirewallDeleteProtectionResponse_updateToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallDeleteProtectionResponse' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: UpdateFirewallDeleteProtectionResponse
s@UpdateFirewallDeleteProtectionResponse' {} Maybe Text
a -> UpdateFirewallDeleteProtectionResponse
s {$sel:updateToken:UpdateFirewallDeleteProtectionResponse' :: Maybe Text
updateToken = Maybe Text
a} :: UpdateFirewallDeleteProtectionResponse)

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

instance
  Prelude.NFData
    UpdateFirewallDeleteProtectionResponse
  where
  rnf :: UpdateFirewallDeleteProtectionResponse -> ()
rnf UpdateFirewallDeleteProtectionResponse' {Int
Maybe Bool
Maybe Text
httpStatus :: Int
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
deleteProtection :: Maybe Bool
$sel:httpStatus:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Int
$sel:updateToken:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
$sel:firewallName:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
$sel:firewallArn:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Text
$sel:deleteProtection:UpdateFirewallDeleteProtectionResponse' :: UpdateFirewallDeleteProtectionResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteProtection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firewallName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
updateToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus