{-# 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.UpdateFirewallEncryptionConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A complex type that contains settings for encryption of your firewall
-- resources.
module Amazonka.NetworkFirewall.UpdateFirewallEncryptionConfiguration
  ( -- * Creating a Request
    UpdateFirewallEncryptionConfiguration (..),
    newUpdateFirewallEncryptionConfiguration,

    -- * Request Lenses
    updateFirewallEncryptionConfiguration_encryptionConfiguration,
    updateFirewallEncryptionConfiguration_firewallArn,
    updateFirewallEncryptionConfiguration_firewallName,
    updateFirewallEncryptionConfiguration_updateToken,

    -- * Destructuring the Response
    UpdateFirewallEncryptionConfigurationResponse (..),
    newUpdateFirewallEncryptionConfigurationResponse,

    -- * Response Lenses
    updateFirewallEncryptionConfigurationResponse_encryptionConfiguration,
    updateFirewallEncryptionConfigurationResponse_firewallArn,
    updateFirewallEncryptionConfigurationResponse_firewallName,
    updateFirewallEncryptionConfigurationResponse_updateToken,
    updateFirewallEncryptionConfigurationResponse_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:/ 'newUpdateFirewallEncryptionConfiguration' smart constructor.
data UpdateFirewallEncryptionConfiguration = UpdateFirewallEncryptionConfiguration'
  { UpdateFirewallEncryptionConfiguration
-> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
    -- | The Amazon Resource Name (ARN) of the firewall.
    UpdateFirewallEncryptionConfiguration -> 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.
    UpdateFirewallEncryptionConfiguration -> 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.
    UpdateFirewallEncryptionConfiguration -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateFirewallEncryptionConfiguration
-> UpdateFirewallEncryptionConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFirewallEncryptionConfiguration
-> UpdateFirewallEncryptionConfiguration -> Bool
$c/= :: UpdateFirewallEncryptionConfiguration
-> UpdateFirewallEncryptionConfiguration -> Bool
== :: UpdateFirewallEncryptionConfiguration
-> UpdateFirewallEncryptionConfiguration -> Bool
$c== :: UpdateFirewallEncryptionConfiguration
-> UpdateFirewallEncryptionConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateFirewallEncryptionConfiguration]
ReadPrec UpdateFirewallEncryptionConfiguration
Int -> ReadS UpdateFirewallEncryptionConfiguration
ReadS [UpdateFirewallEncryptionConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFirewallEncryptionConfiguration]
$creadListPrec :: ReadPrec [UpdateFirewallEncryptionConfiguration]
readPrec :: ReadPrec UpdateFirewallEncryptionConfiguration
$creadPrec :: ReadPrec UpdateFirewallEncryptionConfiguration
readList :: ReadS [UpdateFirewallEncryptionConfiguration]
$creadList :: ReadS [UpdateFirewallEncryptionConfiguration]
readsPrec :: Int -> ReadS UpdateFirewallEncryptionConfiguration
$creadsPrec :: Int -> ReadS UpdateFirewallEncryptionConfiguration
Prelude.Read, Int -> UpdateFirewallEncryptionConfiguration -> ShowS
[UpdateFirewallEncryptionConfiguration] -> ShowS
UpdateFirewallEncryptionConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFirewallEncryptionConfiguration] -> ShowS
$cshowList :: [UpdateFirewallEncryptionConfiguration] -> ShowS
show :: UpdateFirewallEncryptionConfiguration -> String
$cshow :: UpdateFirewallEncryptionConfiguration -> String
showsPrec :: Int -> UpdateFirewallEncryptionConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateFirewallEncryptionConfiguration -> ShowS
Prelude.Show, forall x.
Rep UpdateFirewallEncryptionConfiguration x
-> UpdateFirewallEncryptionConfiguration
forall x.
UpdateFirewallEncryptionConfiguration
-> Rep UpdateFirewallEncryptionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFirewallEncryptionConfiguration x
-> UpdateFirewallEncryptionConfiguration
$cfrom :: forall x.
UpdateFirewallEncryptionConfiguration
-> Rep UpdateFirewallEncryptionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFirewallEncryptionConfiguration' 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:
--
-- 'encryptionConfiguration', 'updateFirewallEncryptionConfiguration_encryptionConfiguration' - Undocumented member.
--
-- 'firewallArn', 'updateFirewallEncryptionConfiguration_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'updateFirewallEncryptionConfiguration_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'updateToken', 'updateFirewallEncryptionConfiguration_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.
newUpdateFirewallEncryptionConfiguration ::
  UpdateFirewallEncryptionConfiguration
newUpdateFirewallEncryptionConfiguration :: UpdateFirewallEncryptionConfiguration
newUpdateFirewallEncryptionConfiguration =
  UpdateFirewallEncryptionConfiguration'
    { $sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:firewallArn:UpdateFirewallEncryptionConfiguration' :: Maybe Text
firewallArn = forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:UpdateFirewallEncryptionConfiguration' :: Maybe Text
firewallName = forall a. Maybe a
Prelude.Nothing,
      $sel:updateToken:UpdateFirewallEncryptionConfiguration' :: Maybe Text
updateToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
updateFirewallEncryptionConfiguration_encryptionConfiguration :: Lens.Lens' UpdateFirewallEncryptionConfiguration (Prelude.Maybe EncryptionConfiguration)
updateFirewallEncryptionConfiguration_encryptionConfiguration :: Lens'
  UpdateFirewallEncryptionConfiguration
  (Maybe EncryptionConfiguration)
updateFirewallEncryptionConfiguration_encryptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallEncryptionConfiguration' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration
-> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: UpdateFirewallEncryptionConfiguration
s@UpdateFirewallEncryptionConfiguration' {} Maybe EncryptionConfiguration
a -> UpdateFirewallEncryptionConfiguration
s {$sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: UpdateFirewallEncryptionConfiguration)

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

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

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

instance
  Core.AWSRequest
    UpdateFirewallEncryptionConfiguration
  where
  type
    AWSResponse
      UpdateFirewallEncryptionConfiguration =
      UpdateFirewallEncryptionConfigurationResponse
  request :: (Service -> Service)
-> UpdateFirewallEncryptionConfiguration
-> Request UpdateFirewallEncryptionConfiguration
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 UpdateFirewallEncryptionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateFirewallEncryptionConfiguration)))
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 EncryptionConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateFirewallEncryptionConfigurationResponse
UpdateFirewallEncryptionConfigurationResponse'
            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
"EncryptionConfiguration")
            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
    UpdateFirewallEncryptionConfiguration
  where
  hashWithSalt :: Int -> UpdateFirewallEncryptionConfiguration -> Int
hashWithSalt
    Int
_salt
    UpdateFirewallEncryptionConfiguration' {Maybe Text
Maybe EncryptionConfiguration
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:updateToken:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallName:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallArn:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration
-> Maybe EncryptionConfiguration
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionConfiguration
encryptionConfiguration
        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

instance
  Prelude.NFData
    UpdateFirewallEncryptionConfiguration
  where
  rnf :: UpdateFirewallEncryptionConfiguration -> ()
rnf UpdateFirewallEncryptionConfiguration' {Maybe Text
Maybe EncryptionConfiguration
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:updateToken:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallName:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallArn:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration
-> Maybe EncryptionConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionConfiguration
encryptionConfiguration
      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

instance
  Data.ToHeaders
    UpdateFirewallEncryptionConfiguration
  where
  toHeaders :: UpdateFirewallEncryptionConfiguration -> 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.UpdateFirewallEncryptionConfiguration" ::
                          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
    UpdateFirewallEncryptionConfiguration
  where
  toJSON :: UpdateFirewallEncryptionConfiguration -> Value
toJSON UpdateFirewallEncryptionConfiguration' {Maybe Text
Maybe EncryptionConfiguration
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:updateToken:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallName:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:firewallArn:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration -> Maybe Text
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfiguration' :: UpdateFirewallEncryptionConfiguration
-> Maybe EncryptionConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"EncryptionConfiguration" 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 EncryptionConfiguration
encryptionConfiguration,
            (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
          ]
      )

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

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

-- | /See:/ 'newUpdateFirewallEncryptionConfigurationResponse' smart constructor.
data UpdateFirewallEncryptionConfigurationResponse = UpdateFirewallEncryptionConfigurationResponse'
  { UpdateFirewallEncryptionConfigurationResponse
-> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
    -- | The Amazon Resource Name (ARN) of the firewall.
    UpdateFirewallEncryptionConfigurationResponse -> 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.
    UpdateFirewallEncryptionConfigurationResponse -> 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.
    UpdateFirewallEncryptionConfigurationResponse -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateFirewallEncryptionConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFirewallEncryptionConfigurationResponse
-> UpdateFirewallEncryptionConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFirewallEncryptionConfigurationResponse
-> UpdateFirewallEncryptionConfigurationResponse -> Bool
$c/= :: UpdateFirewallEncryptionConfigurationResponse
-> UpdateFirewallEncryptionConfigurationResponse -> Bool
== :: UpdateFirewallEncryptionConfigurationResponse
-> UpdateFirewallEncryptionConfigurationResponse -> Bool
$c== :: UpdateFirewallEncryptionConfigurationResponse
-> UpdateFirewallEncryptionConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFirewallEncryptionConfigurationResponse]
ReadPrec UpdateFirewallEncryptionConfigurationResponse
Int -> ReadS UpdateFirewallEncryptionConfigurationResponse
ReadS [UpdateFirewallEncryptionConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFirewallEncryptionConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateFirewallEncryptionConfigurationResponse]
readPrec :: ReadPrec UpdateFirewallEncryptionConfigurationResponse
$creadPrec :: ReadPrec UpdateFirewallEncryptionConfigurationResponse
readList :: ReadS [UpdateFirewallEncryptionConfigurationResponse]
$creadList :: ReadS [UpdateFirewallEncryptionConfigurationResponse]
readsPrec :: Int -> ReadS UpdateFirewallEncryptionConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateFirewallEncryptionConfigurationResponse
Prelude.Read, Int -> UpdateFirewallEncryptionConfigurationResponse -> ShowS
[UpdateFirewallEncryptionConfigurationResponse] -> ShowS
UpdateFirewallEncryptionConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFirewallEncryptionConfigurationResponse] -> ShowS
$cshowList :: [UpdateFirewallEncryptionConfigurationResponse] -> ShowS
show :: UpdateFirewallEncryptionConfigurationResponse -> String
$cshow :: UpdateFirewallEncryptionConfigurationResponse -> String
showsPrec :: Int -> UpdateFirewallEncryptionConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateFirewallEncryptionConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateFirewallEncryptionConfigurationResponse x
-> UpdateFirewallEncryptionConfigurationResponse
forall x.
UpdateFirewallEncryptionConfigurationResponse
-> Rep UpdateFirewallEncryptionConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFirewallEncryptionConfigurationResponse x
-> UpdateFirewallEncryptionConfigurationResponse
$cfrom :: forall x.
UpdateFirewallEncryptionConfigurationResponse
-> Rep UpdateFirewallEncryptionConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFirewallEncryptionConfigurationResponse' 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:
--
-- 'encryptionConfiguration', 'updateFirewallEncryptionConfigurationResponse_encryptionConfiguration' - Undocumented member.
--
-- 'firewallArn', 'updateFirewallEncryptionConfigurationResponse_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'updateFirewallEncryptionConfigurationResponse_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'updateToken', 'updateFirewallEncryptionConfigurationResponse_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', 'updateFirewallEncryptionConfigurationResponse_httpStatus' - The response's http status code.
newUpdateFirewallEncryptionConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFirewallEncryptionConfigurationResponse
newUpdateFirewallEncryptionConfigurationResponse :: Int -> UpdateFirewallEncryptionConfigurationResponse
newUpdateFirewallEncryptionConfigurationResponse
  Int
pHttpStatus_ =
    UpdateFirewallEncryptionConfigurationResponse'
      { $sel:encryptionConfiguration:UpdateFirewallEncryptionConfigurationResponse' :: Maybe EncryptionConfiguration
encryptionConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallArn:UpdateFirewallEncryptionConfigurationResponse' :: Maybe Text
firewallArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:firewallName:UpdateFirewallEncryptionConfigurationResponse' :: Maybe Text
firewallName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:updateToken:UpdateFirewallEncryptionConfigurationResponse' :: Maybe Text
updateToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateFirewallEncryptionConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
updateFirewallEncryptionConfigurationResponse_encryptionConfiguration :: Lens.Lens' UpdateFirewallEncryptionConfigurationResponse (Prelude.Maybe EncryptionConfiguration)
updateFirewallEncryptionConfigurationResponse_encryptionConfiguration :: Lens'
  UpdateFirewallEncryptionConfigurationResponse
  (Maybe EncryptionConfiguration)
updateFirewallEncryptionConfigurationResponse_encryptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFirewallEncryptionConfigurationResponse' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse
-> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: UpdateFirewallEncryptionConfigurationResponse
s@UpdateFirewallEncryptionConfigurationResponse' {} Maybe EncryptionConfiguration
a -> UpdateFirewallEncryptionConfigurationResponse
s {$sel:encryptionConfiguration:UpdateFirewallEncryptionConfigurationResponse' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: UpdateFirewallEncryptionConfigurationResponse)

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

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

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

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

instance
  Prelude.NFData
    UpdateFirewallEncryptionConfigurationResponse
  where
  rnf :: UpdateFirewallEncryptionConfigurationResponse -> ()
rnf
    UpdateFirewallEncryptionConfigurationResponse' {Int
Maybe Text
Maybe EncryptionConfiguration
httpStatus :: Int
updateToken :: Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:httpStatus:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse -> Int
$sel:updateToken:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse -> Maybe Text
$sel:firewallName:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse -> Maybe Text
$sel:firewallArn:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse -> Maybe Text
$sel:encryptionConfiguration:UpdateFirewallEncryptionConfigurationResponse' :: UpdateFirewallEncryptionConfigurationResponse
-> Maybe EncryptionConfiguration
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionConfiguration
encryptionConfiguration
        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