{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.Firewall
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.NetworkFirewall.Types.Firewall where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.SubnetMapping
import Amazonka.NetworkFirewall.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | The firewall defines the configuration settings for an AWS Network
-- Firewall firewall. These settings include the firewall policy, the
-- subnets in your VPC to use for the firewall endpoints, and any tags that
-- are attached to the firewall AWS resource.
--
-- The status of the firewall, for example whether it\'s ready to filter
-- network traffic, is provided in the corresponding FirewallStatus. You
-- can retrieve both objects by calling DescribeFirewall.
--
-- /See:/ 'newFirewall' smart constructor.
data Firewall = Firewall'
  { -- | The Amazon Resource Name (ARN) of the firewall.
    Firewall -> Maybe Text
firewallArn :: 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@.
    Firewall -> Maybe Bool
firewallPolicyChangeProtection :: Prelude.Maybe Prelude.Bool,
    -- | A setting indicating whether the firewall is protected against changes
    -- to the subnet associations. Use this setting to protect against
    -- accidentally modifying the subnet associations for a firewall that is in
    -- use. When you create a firewall, the operation initializes this setting
    -- to @TRUE@.
    Firewall -> Maybe Bool
subnetChangeProtection :: Prelude.Maybe Prelude.Bool,
    -- | 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@.
    Firewall -> Maybe Bool
deleteProtection :: Prelude.Maybe Prelude.Bool,
    -- | A description of the firewall.
    Firewall -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    Firewall -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The descriptive name of the firewall. You can\'t change the name of a
    -- firewall after you create it.
    Firewall -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the firewall policy.
    --
    -- The relationship of firewall to firewall policy is many to one. Each
    -- firewall requires one firewall policy association, and you can use the
    -- same firewall policy for multiple firewalls.
    Firewall -> Text
firewallPolicyArn :: Prelude.Text,
    -- | The unique identifier of the VPC where the firewall is in use.
    Firewall -> Text
vpcId :: Prelude.Text,
    -- | The public subnets that Network Firewall is using for the firewall. Each
    -- subnet must belong to a different Availability Zone.
    Firewall -> [SubnetMapping]
subnetMappings :: [SubnetMapping],
    -- | The unique identifier for the firewall.
    Firewall -> Text
firewallId :: Prelude.Text
  }
  deriving (Firewall -> Firewall -> Bool
(Firewall -> Firewall -> Bool)
-> (Firewall -> Firewall -> Bool) -> Eq Firewall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Firewall -> Firewall -> Bool
$c/= :: Firewall -> Firewall -> Bool
== :: Firewall -> Firewall -> Bool
$c== :: Firewall -> Firewall -> Bool
Prelude.Eq, ReadPrec [Firewall]
ReadPrec Firewall
Int -> ReadS Firewall
ReadS [Firewall]
(Int -> ReadS Firewall)
-> ReadS [Firewall]
-> ReadPrec Firewall
-> ReadPrec [Firewall]
-> Read Firewall
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Firewall]
$creadListPrec :: ReadPrec [Firewall]
readPrec :: ReadPrec Firewall
$creadPrec :: ReadPrec Firewall
readList :: ReadS [Firewall]
$creadList :: ReadS [Firewall]
readsPrec :: Int -> ReadS Firewall
$creadsPrec :: Int -> ReadS Firewall
Prelude.Read, Int -> Firewall -> ShowS
[Firewall] -> ShowS
Firewall -> String
(Int -> Firewall -> ShowS)
-> (Firewall -> String) -> ([Firewall] -> ShowS) -> Show Firewall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Firewall] -> ShowS
$cshowList :: [Firewall] -> ShowS
show :: Firewall -> String
$cshow :: Firewall -> String
showsPrec :: Int -> Firewall -> ShowS
$cshowsPrec :: Int -> Firewall -> ShowS
Prelude.Show, (forall x. Firewall -> Rep Firewall x)
-> (forall x. Rep Firewall x -> Firewall) -> Generic Firewall
forall x. Rep Firewall x -> Firewall
forall x. Firewall -> Rep Firewall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Firewall x -> Firewall
$cfrom :: forall x. Firewall -> Rep Firewall x
Prelude.Generic)

-- |
-- Create a value of 'Firewall' 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', 'firewall_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallPolicyChangeProtection', 'firewall_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@.
--
-- 'subnetChangeProtection', 'firewall_subnetChangeProtection' - A setting indicating whether the firewall is protected against changes
-- to the subnet associations. Use this setting to protect against
-- accidentally modifying the subnet associations for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
--
-- 'deleteProtection', 'firewall_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@.
--
-- 'description', 'firewall_description' - A description of the firewall.
--
-- 'tags', 'firewall_tags' -
--
-- 'firewallName', 'firewall_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
--
-- 'firewallPolicyArn', 'firewall_firewallPolicyArn' - The Amazon Resource Name (ARN) of the firewall policy.
--
-- The relationship of firewall to firewall policy is many to one. Each
-- firewall requires one firewall policy association, and you can use the
-- same firewall policy for multiple firewalls.
--
-- 'vpcId', 'firewall_vpcId' - The unique identifier of the VPC where the firewall is in use.
--
-- 'subnetMappings', 'firewall_subnetMappings' - The public subnets that Network Firewall is using for the firewall. Each
-- subnet must belong to a different Availability Zone.
--
-- 'firewallId', 'firewall_firewallId' - The unique identifier for the firewall.
newFirewall ::
  -- | 'firewallPolicyArn'
  Prelude.Text ->
  -- | 'vpcId'
  Prelude.Text ->
  -- | 'firewallId'
  Prelude.Text ->
  Firewall
newFirewall :: Text -> Text -> Text -> Firewall
newFirewall Text
pFirewallPolicyArn_ Text
pVpcId_ Text
pFirewallId_ =
  Firewall' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Maybe Text
-> Text
-> Text
-> [SubnetMapping]
-> Text
-> Firewall
Firewall'
    { $sel:firewallArn:Firewall' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallPolicyChangeProtection:Firewall' :: Maybe Bool
firewallPolicyChangeProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetChangeProtection:Firewall' :: Maybe Bool
subnetChangeProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteProtection:Firewall' :: Maybe Bool
deleteProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Firewall' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Firewall' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:Firewall' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallPolicyArn:Firewall' :: Text
firewallPolicyArn = Text
pFirewallPolicyArn_,
      $sel:vpcId:Firewall' :: Text
vpcId = Text
pVpcId_,
      $sel:subnetMappings:Firewall' :: [SubnetMapping]
subnetMappings = [SubnetMapping]
forall a. Monoid a => a
Prelude.mempty,
      $sel:firewallId:Firewall' :: Text
firewallId = Text
pFirewallId_
    }

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

-- | 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@.
firewall_firewallPolicyChangeProtection :: Lens.Lens' Firewall (Prelude.Maybe Prelude.Bool)
firewall_firewallPolicyChangeProtection :: (Maybe Bool -> f (Maybe Bool)) -> Firewall -> f Firewall
firewall_firewallPolicyChangeProtection = (Firewall -> Maybe Bool)
-> (Firewall -> Maybe Bool -> Firewall)
-> Lens Firewall Firewall (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Maybe Bool
firewallPolicyChangeProtection :: Maybe Bool
$sel:firewallPolicyChangeProtection:Firewall' :: Firewall -> Maybe Bool
firewallPolicyChangeProtection} -> Maybe Bool
firewallPolicyChangeProtection) (\s :: Firewall
s@Firewall' {} Maybe Bool
a -> Firewall
s {$sel:firewallPolicyChangeProtection:Firewall' :: Maybe Bool
firewallPolicyChangeProtection = Maybe Bool
a} :: Firewall)

-- | A setting indicating whether the firewall is protected against changes
-- to the subnet associations. Use this setting to protect against
-- accidentally modifying the subnet associations for a firewall that is in
-- use. When you create a firewall, the operation initializes this setting
-- to @TRUE@.
firewall_subnetChangeProtection :: Lens.Lens' Firewall (Prelude.Maybe Prelude.Bool)
firewall_subnetChangeProtection :: (Maybe Bool -> f (Maybe Bool)) -> Firewall -> f Firewall
firewall_subnetChangeProtection = (Firewall -> Maybe Bool)
-> (Firewall -> Maybe Bool -> Firewall)
-> Lens Firewall Firewall (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Maybe Bool
subnetChangeProtection :: Maybe Bool
$sel:subnetChangeProtection:Firewall' :: Firewall -> Maybe Bool
subnetChangeProtection} -> Maybe Bool
subnetChangeProtection) (\s :: Firewall
s@Firewall' {} Maybe Bool
a -> Firewall
s {$sel:subnetChangeProtection:Firewall' :: Maybe Bool
subnetChangeProtection = Maybe Bool
a} :: Firewall)

-- | 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@.
firewall_deleteProtection :: Lens.Lens' Firewall (Prelude.Maybe Prelude.Bool)
firewall_deleteProtection :: (Maybe Bool -> f (Maybe Bool)) -> Firewall -> f Firewall
firewall_deleteProtection = (Firewall -> Maybe Bool)
-> (Firewall -> Maybe Bool -> Firewall)
-> Lens Firewall Firewall (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Maybe Bool
deleteProtection :: Maybe Bool
$sel:deleteProtection:Firewall' :: Firewall -> Maybe Bool
deleteProtection} -> Maybe Bool
deleteProtection) (\s :: Firewall
s@Firewall' {} Maybe Bool
a -> Firewall
s {$sel:deleteProtection:Firewall' :: Maybe Bool
deleteProtection = Maybe Bool
a} :: Firewall)

-- | A description of the firewall.
firewall_description :: Lens.Lens' Firewall (Prelude.Maybe Prelude.Text)
firewall_description :: (Maybe Text -> f (Maybe Text)) -> Firewall -> f Firewall
firewall_description = (Firewall -> Maybe Text)
-> (Firewall -> Maybe Text -> Firewall)
-> Lens Firewall Firewall (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Maybe Text
description :: Maybe Text
$sel:description:Firewall' :: Firewall -> Maybe Text
description} -> Maybe Text
description) (\s :: Firewall
s@Firewall' {} Maybe Text
a -> Firewall
s {$sel:description:Firewall' :: Maybe Text
description = Maybe Text
a} :: Firewall)

-- |
firewall_tags :: Lens.Lens' Firewall (Prelude.Maybe (Prelude.NonEmpty Tag))
firewall_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Firewall -> f Firewall
firewall_tags = (Firewall -> Maybe (NonEmpty Tag))
-> (Firewall -> Maybe (NonEmpty Tag) -> Firewall)
-> Lens
     Firewall Firewall (Maybe (NonEmpty Tag)) (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Firewall' :: Firewall -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Firewall
s@Firewall' {} Maybe (NonEmpty Tag)
a -> Firewall
s {$sel:tags:Firewall' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Firewall) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> Firewall -> f Firewall)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Firewall
-> f Firewall
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The Amazon Resource Name (ARN) of the firewall policy.
--
-- The relationship of firewall to firewall policy is many to one. Each
-- firewall requires one firewall policy association, and you can use the
-- same firewall policy for multiple firewalls.
firewall_firewallPolicyArn :: Lens.Lens' Firewall Prelude.Text
firewall_firewallPolicyArn :: (Text -> f Text) -> Firewall -> f Firewall
firewall_firewallPolicyArn = (Firewall -> Text)
-> (Firewall -> Text -> Firewall)
-> Lens Firewall Firewall Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Text
firewallPolicyArn :: Text
$sel:firewallPolicyArn:Firewall' :: Firewall -> Text
firewallPolicyArn} -> Text
firewallPolicyArn) (\s :: Firewall
s@Firewall' {} Text
a -> Firewall
s {$sel:firewallPolicyArn:Firewall' :: Text
firewallPolicyArn = Text
a} :: Firewall)

-- | The unique identifier of the VPC where the firewall is in use.
firewall_vpcId :: Lens.Lens' Firewall Prelude.Text
firewall_vpcId :: (Text -> f Text) -> Firewall -> f Firewall
firewall_vpcId = (Firewall -> Text)
-> (Firewall -> Text -> Firewall)
-> Lens Firewall Firewall Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Text
vpcId :: Text
$sel:vpcId:Firewall' :: Firewall -> Text
vpcId} -> Text
vpcId) (\s :: Firewall
s@Firewall' {} Text
a -> Firewall
s {$sel:vpcId:Firewall' :: Text
vpcId = Text
a} :: Firewall)

-- | The public subnets that Network Firewall is using for the firewall. Each
-- subnet must belong to a different Availability Zone.
firewall_subnetMappings :: Lens.Lens' Firewall [SubnetMapping]
firewall_subnetMappings :: ([SubnetMapping] -> f [SubnetMapping]) -> Firewall -> f Firewall
firewall_subnetMappings = (Firewall -> [SubnetMapping])
-> (Firewall -> [SubnetMapping] -> Firewall)
-> Lens Firewall Firewall [SubnetMapping] [SubnetMapping]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {[SubnetMapping]
subnetMappings :: [SubnetMapping]
$sel:subnetMappings:Firewall' :: Firewall -> [SubnetMapping]
subnetMappings} -> [SubnetMapping]
subnetMappings) (\s :: Firewall
s@Firewall' {} [SubnetMapping]
a -> Firewall
s {$sel:subnetMappings:Firewall' :: [SubnetMapping]
subnetMappings = [SubnetMapping]
a} :: Firewall) (([SubnetMapping] -> f [SubnetMapping]) -> Firewall -> f Firewall)
-> (([SubnetMapping] -> f [SubnetMapping])
    -> [SubnetMapping] -> f [SubnetMapping])
-> ([SubnetMapping] -> f [SubnetMapping])
-> Firewall
-> f Firewall
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SubnetMapping] -> f [SubnetMapping])
-> [SubnetMapping] -> f [SubnetMapping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier for the firewall.
firewall_firewallId :: Lens.Lens' Firewall Prelude.Text
firewall_firewallId :: (Text -> f Text) -> Firewall -> f Firewall
firewall_firewallId = (Firewall -> Text)
-> (Firewall -> Text -> Firewall)
-> Lens Firewall Firewall Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Firewall' {Text
firewallId :: Text
$sel:firewallId:Firewall' :: Firewall -> Text
firewallId} -> Text
firewallId) (\s :: Firewall
s@Firewall' {} Text
a -> Firewall
s {$sel:firewallId:Firewall' :: Text
firewallId = Text
a} :: Firewall)

instance Core.FromJSON Firewall where
  parseJSON :: Value -> Parser Firewall
parseJSON =
    String -> (Object -> Parser Firewall) -> Value -> Parser Firewall
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Firewall"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Maybe Text
-> Text
-> Text
-> [SubnetMapping]
-> Text
-> Firewall
Firewall'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe (NonEmpty Tag)
 -> Maybe Text
 -> Text
 -> Text
 -> [SubnetMapping]
 -> Text
 -> Firewall)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Maybe Text
      -> Text
      -> Text
      -> [SubnetMapping]
      -> Text
      -> Firewall)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirewallArn")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Maybe Text
   -> Text
   -> Text
   -> [SubnetMapping]
   -> Text
   -> Firewall)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Maybe Text
      -> Text
      -> Text
      -> [SubnetMapping]
      -> Text
      -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirewallPolicyChangeProtection")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Maybe Text
   -> Text
   -> Text
   -> [SubnetMapping]
   -> Text
   -> Firewall)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Maybe Text
      -> Text
      -> Text
      -> [SubnetMapping]
      -> Text
      -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetChangeProtection")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Maybe Text
   -> Text
   -> Text
   -> [SubnetMapping]
   -> Text
   -> Firewall)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Maybe Text
      -> Text
      -> Text
      -> [SubnetMapping]
      -> Text
      -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeleteProtection")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Maybe Text
   -> Text
   -> Text
   -> [SubnetMapping]
   -> Text
   -> Firewall)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Tag)
      -> Maybe Text
      -> Text
      -> Text
      -> [SubnetMapping]
      -> Text
      -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser
  (Maybe (NonEmpty Tag)
   -> Maybe Text
   -> Text
   -> Text
   -> [SubnetMapping]
   -> Text
   -> Firewall)
-> Parser (Maybe (NonEmpty Tag))
-> Parser
     (Maybe Text -> Text -> Text -> [SubnetMapping] -> Text -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags")
            Parser
  (Maybe Text -> Text -> Text -> [SubnetMapping] -> Text -> Firewall)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> [SubnetMapping] -> Text -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirewallName")
            Parser (Text -> Text -> [SubnetMapping] -> Text -> Firewall)
-> Parser Text
-> Parser (Text -> [SubnetMapping] -> Text -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FirewallPolicyArn")
            Parser (Text -> [SubnetMapping] -> Text -> Firewall)
-> Parser Text -> Parser ([SubnetMapping] -> Text -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VpcId")
            Parser ([SubnetMapping] -> Text -> Firewall)
-> Parser [SubnetMapping] -> Parser (Text -> Firewall)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [SubnetMapping])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetMappings" Parser (Maybe [SubnetMapping])
-> [SubnetMapping] -> Parser [SubnetMapping]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [SubnetMapping]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Firewall) -> Parser Text -> Parser Firewall
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FirewallId")
      )

instance Prelude.Hashable Firewall

instance Prelude.NFData Firewall