{-# 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.FirewallMetadata
-- 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.FirewallMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | High-level information about a firewall, returned by operations like
-- create and describe. You can use the information provided in the
-- metadata to retrieve and manage a firewall.
--
-- /See:/ 'newFirewallMetadata' smart constructor.
data FirewallMetadata = FirewallMetadata'
  { -- | The Amazon Resource Name (ARN) of the firewall.
    FirewallMetadata -> 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.
    FirewallMetadata -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text
  }
  deriving (FirewallMetadata -> FirewallMetadata -> Bool
(FirewallMetadata -> FirewallMetadata -> Bool)
-> (FirewallMetadata -> FirewallMetadata -> Bool)
-> Eq FirewallMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallMetadata -> FirewallMetadata -> Bool
$c/= :: FirewallMetadata -> FirewallMetadata -> Bool
== :: FirewallMetadata -> FirewallMetadata -> Bool
$c== :: FirewallMetadata -> FirewallMetadata -> Bool
Prelude.Eq, ReadPrec [FirewallMetadata]
ReadPrec FirewallMetadata
Int -> ReadS FirewallMetadata
ReadS [FirewallMetadata]
(Int -> ReadS FirewallMetadata)
-> ReadS [FirewallMetadata]
-> ReadPrec FirewallMetadata
-> ReadPrec [FirewallMetadata]
-> Read FirewallMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallMetadata]
$creadListPrec :: ReadPrec [FirewallMetadata]
readPrec :: ReadPrec FirewallMetadata
$creadPrec :: ReadPrec FirewallMetadata
readList :: ReadS [FirewallMetadata]
$creadList :: ReadS [FirewallMetadata]
readsPrec :: Int -> ReadS FirewallMetadata
$creadsPrec :: Int -> ReadS FirewallMetadata
Prelude.Read, Int -> FirewallMetadata -> ShowS
[FirewallMetadata] -> ShowS
FirewallMetadata -> String
(Int -> FirewallMetadata -> ShowS)
-> (FirewallMetadata -> String)
-> ([FirewallMetadata] -> ShowS)
-> Show FirewallMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallMetadata] -> ShowS
$cshowList :: [FirewallMetadata] -> ShowS
show :: FirewallMetadata -> String
$cshow :: FirewallMetadata -> String
showsPrec :: Int -> FirewallMetadata -> ShowS
$cshowsPrec :: Int -> FirewallMetadata -> ShowS
Prelude.Show, (forall x. FirewallMetadata -> Rep FirewallMetadata x)
-> (forall x. Rep FirewallMetadata x -> FirewallMetadata)
-> Generic FirewallMetadata
forall x. Rep FirewallMetadata x -> FirewallMetadata
forall x. FirewallMetadata -> Rep FirewallMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FirewallMetadata x -> FirewallMetadata
$cfrom :: forall x. FirewallMetadata -> Rep FirewallMetadata x
Prelude.Generic)

-- |
-- Create a value of 'FirewallMetadata' 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', 'firewallMetadata_firewallArn' - The Amazon Resource Name (ARN) of the firewall.
--
-- 'firewallName', 'firewallMetadata_firewallName' - The descriptive name of the firewall. You can\'t change the name of a
-- firewall after you create it.
newFirewallMetadata ::
  FirewallMetadata
newFirewallMetadata :: FirewallMetadata
newFirewallMetadata =
  FirewallMetadata' :: Maybe Text -> Maybe Text -> FirewallMetadata
FirewallMetadata'
    { $sel:firewallArn:FirewallMetadata' :: Maybe Text
firewallArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firewallName:FirewallMetadata' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromJSON FirewallMetadata where
  parseJSON :: Value -> Parser FirewallMetadata
parseJSON =
    String
-> (Object -> Parser FirewallMetadata)
-> Value
-> Parser FirewallMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FirewallMetadata"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> FirewallMetadata
FirewallMetadata'
            (Maybe Text -> Maybe Text -> FirewallMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> FirewallMetadata)
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 Text -> FirewallMetadata)
-> Parser (Maybe Text) -> Parser FirewallMetadata
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")
      )

instance Prelude.Hashable FirewallMetadata

instance Prelude.NFData FirewallMetadata