{-# 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.UpdateFirewallPolicyChangeProtection
-- 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, @ChangeProtection@, which indicates whether it is
-- possible to change the firewall. If the flag is set to @TRUE@, the
-- firewall is protected from changes. This setting helps protect against
-- accidentally changing a firewall that\'s in use.
module Amazonka.NetworkFirewall.UpdateFirewallPolicyChangeProtection
  ( -- * Creating a Request
    UpdateFirewallPolicyChangeProtection (..),
    newUpdateFirewallPolicyChangeProtection,

    -- * Request Lenses
    updateFirewallPolicyChangeProtection_firewallArn,
    updateFirewallPolicyChangeProtection_firewallName,
    updateFirewallPolicyChangeProtection_updateToken,
    updateFirewallPolicyChangeProtection_firewallPolicyChangeProtection,

    -- * Destructuring the Response
    UpdateFirewallPolicyChangeProtectionResponse (..),
    newUpdateFirewallPolicyChangeProtectionResponse,

    -- * Response Lenses
    updateFirewallPolicyChangeProtectionResponse_firewallArn,
    updateFirewallPolicyChangeProtectionResponse_firewallName,
    updateFirewallPolicyChangeProtectionResponse_firewallPolicyChangeProtection,
    updateFirewallPolicyChangeProtectionResponse_updateToken,
    updateFirewallPolicyChangeProtectionResponse_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:/ 'newUpdateFirewallPolicyChangeProtection' smart constructor.
data UpdateFirewallPolicyChangeProtection = UpdateFirewallPolicyChangeProtection'
  { -- | The Amazon Resource Name (ARN) of the firewall.
    --
    -- You must specify the ARN or the name, and you can specify both.
    UpdateFirewallPolicyChangeProtection -> 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.
    UpdateFirewallPolicyChangeProtection -> 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.
    UpdateFirewallPolicyChangeProtection -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | A setting indicating whether the firewall is protected against a change
    -- to the firewall policy association. Use this setting to protect against
    -- accidentally modifying the firewall policy for a firewall that is in
    -- use. When you create a firewall, the operation initializes this setting
    -- to @TRUE@.
    UpdateFirewallPolicyChangeProtection -> Bool
firewallPolicyChangeProtection :: Prelude.Bool
  }
  deriving (UpdateFirewallPolicyChangeProtection
-> UpdateFirewallPolicyChangeProtection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFirewallPolicyChangeProtection
-> UpdateFirewallPolicyChangeProtection -> Bool
$c/= :: UpdateFirewallPolicyChangeProtection
-> UpdateFirewallPolicyChangeProtection -> Bool
== :: UpdateFirewallPolicyChangeProtection
-> UpdateFirewallPolicyChangeProtection -> Bool
$c== :: UpdateFirewallPolicyChangeProtection
-> UpdateFirewallPolicyChangeProtection -> Bool
Prelude.Eq, ReadPrec [UpdateFirewallPolicyChangeProtection]
ReadPrec UpdateFirewallPolicyChangeProtection
Int -> ReadS UpdateFirewallPolicyChangeProtection
ReadS [UpdateFirewallPolicyChangeProtection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFirewallPolicyChangeProtection]
$creadListPrec :: ReadPrec [UpdateFirewallPolicyChangeProtection]
readPrec :: ReadPrec UpdateFirewallPolicyChangeProtection
$creadPrec :: ReadPrec UpdateFirewallPolicyChangeProtection
readList :: ReadS [UpdateFirewallPolicyChangeProtection]
$creadList :: ReadS [UpdateFirewallPolicyChangeProtection]
readsPrec :: Int -> ReadS UpdateFirewallPolicyChangeProtection
$creadsPrec :: Int -> ReadS UpdateFirewallPolicyChangeProtection
Prelude.Read, Int -> UpdateFirewallPolicyChangeProtection -> ShowS
[UpdateFirewallPolicyChangeProtection] -> ShowS
UpdateFirewallPolicyChangeProtection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFirewallPolicyChangeProtection] -> ShowS
$cshowList :: [UpdateFirewallPolicyChangeProtection] -> ShowS
show :: UpdateFirewallPolicyChangeProtection -> String
$cshow :: UpdateFirewallPolicyChangeProtection -> String
showsPrec :: Int -> UpdateFirewallPolicyChangeProtection -> ShowS
$cshowsPrec :: Int -> UpdateFirewallPolicyChangeProtection -> ShowS
Prelude.Show, forall x.
Rep UpdateFirewallPolicyChangeProtection x
-> UpdateFirewallPolicyChangeProtection
forall x.
UpdateFirewallPolicyChangeProtection
-> Rep UpdateFirewallPolicyChangeProtection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFirewallPolicyChangeProtection x
-> UpdateFirewallPolicyChangeProtection
$cfrom :: forall x.
UpdateFirewallPolicyChangeProtection
-> Rep UpdateFirewallPolicyChangeProtection x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFirewallPolicyChangeProtection' 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', 'updateFirewallPolicyChangeProtection_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'firewallName', 'updateFirewallPolicyChangeProtection_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', 'updateFirewallPolicyChangeProtection_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.
--
-- 'firewallPolicyChangeProtection', 'updateFirewallPolicyChangeProtection_firewallPolicyChangeProtection' - A setting indicating whether the firewall is protected against a change
-- to the firewall policy association. Use this setting to protect against
-- accidentally modifying the firewall policy for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
newUpdateFirewallPolicyChangeProtection ::
  -- | 'firewallPolicyChangeProtection'
  Prelude.Bool ->
  UpdateFirewallPolicyChangeProtection
newUpdateFirewallPolicyChangeProtection :: Bool -> UpdateFirewallPolicyChangeProtection
newUpdateFirewallPolicyChangeProtection
  Bool
pFirewallPolicyChangeProtection_ =
    UpdateFirewallPolicyChangeProtection'
      { $sel:firewallArn:UpdateFirewallPolicyChangeProtection' :: Maybe Text
firewallArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallName:UpdateFirewallPolicyChangeProtection' :: Maybe Text
firewallName = forall a. Maybe a
Prelude.Nothing,
        $sel:updateToken:UpdateFirewallPolicyChangeProtection' :: Maybe Text
updateToken = forall a. Maybe a
Prelude.Nothing,
        $sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: Bool
firewallPolicyChangeProtection =
          Bool
pFirewallPolicyChangeProtection_
      }

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

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

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

-- | A setting indicating whether the firewall is protected against a change
-- to the firewall policy association. Use this setting to protect against
-- accidentally modifying the firewall policy for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
updateFirewallPolicyChangeProtection_firewallPolicyChangeProtection :: Lens.Lens' UpdateFirewallPolicyChangeProtection Prelude.Bool
updateFirewallPolicyChangeProtection_firewallPolicyChangeProtection :: Lens' UpdateFirewallPolicyChangeProtection Bool
updateFirewallPolicyChangeProtection_firewallPolicyChangeProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallPolicyChangeProtection' {Bool
firewallPolicyChangeProtection :: Bool
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Bool
firewallPolicyChangeProtection} -> Bool
firewallPolicyChangeProtection) (\s :: UpdateFirewallPolicyChangeProtection
s@UpdateFirewallPolicyChangeProtection' {} Bool
a -> UpdateFirewallPolicyChangeProtection
s {$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: Bool
firewallPolicyChangeProtection = Bool
a} :: UpdateFirewallPolicyChangeProtection)

instance
  Core.AWSRequest
    UpdateFirewallPolicyChangeProtection
  where
  type
    AWSResponse UpdateFirewallPolicyChangeProtection =
      UpdateFirewallPolicyChangeProtectionResponse
  request :: (Service -> Service)
-> UpdateFirewallPolicyChangeProtection
-> Request UpdateFirewallPolicyChangeProtection
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 UpdateFirewallPolicyChangeProtection
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateFirewallPolicyChangeProtection)))
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 Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Int
-> UpdateFirewallPolicyChangeProtectionResponse
UpdateFirewallPolicyChangeProtectionResponse'
            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
"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
"FirewallPolicyChangeProtection")
            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
    UpdateFirewallPolicyChangeProtection
  where
  hashWithSalt :: Int -> UpdateFirewallPolicyChangeProtection -> Int
hashWithSalt
    Int
_salt
    UpdateFirewallPolicyChangeProtection' {Bool
Maybe Text
firewallPolicyChangeProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Bool
$sel:updateToken:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallName:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> 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
firewallPolicyChangeProtection

instance
  Prelude.NFData
    UpdateFirewallPolicyChangeProtection
  where
  rnf :: UpdateFirewallPolicyChangeProtection -> ()
rnf UpdateFirewallPolicyChangeProtection' {Bool
Maybe Text
firewallPolicyChangeProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Bool
$sel:updateToken:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallName:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> 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
firewallPolicyChangeProtection

instance
  Data.ToHeaders
    UpdateFirewallPolicyChangeProtection
  where
  toHeaders :: UpdateFirewallPolicyChangeProtection -> 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.UpdateFirewallPolicyChangeProtection" ::
                          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
    UpdateFirewallPolicyChangeProtection
  where
  toJSON :: UpdateFirewallPolicyChangeProtection -> Value
toJSON UpdateFirewallPolicyChangeProtection' {Bool
Maybe Text
firewallPolicyChangeProtection :: Bool
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Bool
$sel:updateToken:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallName:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> Maybe Text
$sel:firewallArn:UpdateFirewallPolicyChangeProtection' :: UpdateFirewallPolicyChangeProtection -> 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
"FirewallPolicyChangeProtection"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
firewallPolicyChangeProtection
              )
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateFirewallPolicyChangeProtectionResponse' 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', 'updateFirewallPolicyChangeProtectionResponse_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'updateFirewallPolicyChangeProtectionResponse_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'firewallPolicyChangeProtection', 'updateFirewallPolicyChangeProtectionResponse_firewallPolicyChangeProtection' - A setting indicating whether the firewall is protected against a change
-- to the firewall policy association. Use this setting to protect against
-- accidentally modifying the firewall policy for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
--
-- 'updateToken', 'updateFirewallPolicyChangeProtectionResponse_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', 'updateFirewallPolicyChangeProtectionResponse_httpStatus' - The response's http status code.
newUpdateFirewallPolicyChangeProtectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFirewallPolicyChangeProtectionResponse
newUpdateFirewallPolicyChangeProtectionResponse :: Int -> UpdateFirewallPolicyChangeProtectionResponse
newUpdateFirewallPolicyChangeProtectionResponse
  Int
pHttpStatus_ =
    UpdateFirewallPolicyChangeProtectionResponse'
      { $sel:firewallArn:UpdateFirewallPolicyChangeProtectionResponse' :: Maybe Text
firewallArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallName:UpdateFirewallPolicyChangeProtectionResponse' :: Maybe Text
firewallName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtectionResponse' :: Maybe Bool
firewallPolicyChangeProtection =
          forall a. Maybe a
Prelude.Nothing,
        $sel:updateToken:UpdateFirewallPolicyChangeProtectionResponse' :: Maybe Text
updateToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateFirewallPolicyChangeProtectionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

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

-- | A setting indicating whether the firewall is protected against a change
-- to the firewall policy association. Use this setting to protect against
-- accidentally modifying the firewall policy for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
updateFirewallPolicyChangeProtectionResponse_firewallPolicyChangeProtection :: Lens.Lens' UpdateFirewallPolicyChangeProtectionResponse (Prelude.Maybe Prelude.Bool)
updateFirewallPolicyChangeProtectionResponse_firewallPolicyChangeProtection :: Lens' UpdateFirewallPolicyChangeProtectionResponse (Maybe Bool)
updateFirewallPolicyChangeProtectionResponse_firewallPolicyChangeProtection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallPolicyChangeProtectionResponse' {Maybe Bool
firewallPolicyChangeProtection :: Maybe Bool
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> Maybe Bool
firewallPolicyChangeProtection} -> Maybe Bool
firewallPolicyChangeProtection) (\s :: UpdateFirewallPolicyChangeProtectionResponse
s@UpdateFirewallPolicyChangeProtectionResponse' {} Maybe Bool
a -> UpdateFirewallPolicyChangeProtectionResponse
s {$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtectionResponse' :: Maybe Bool
firewallPolicyChangeProtection = Maybe Bool
a} :: UpdateFirewallPolicyChangeProtectionResponse)

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

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

instance
  Prelude.NFData
    UpdateFirewallPolicyChangeProtectionResponse
  where
  rnf :: UpdateFirewallPolicyChangeProtectionResponse -> ()
rnf UpdateFirewallPolicyChangeProtectionResponse' {Int
Maybe Bool
Maybe Text
httpStatus :: Int
updateToken :: Maybe Text
firewallPolicyChangeProtection :: Maybe Bool
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:httpStatus:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> Int
$sel:updateToken:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> Maybe Text
$sel:firewallPolicyChangeProtection:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> Maybe Bool
$sel:firewallName:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> Maybe Text
$sel:firewallArn:UpdateFirewallPolicyChangeProtectionResponse' :: UpdateFirewallPolicyChangeProtectionResponse -> 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 Bool
firewallPolicyChangeProtection
      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