{-# 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.FirewallPolicyMetadata
-- 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.FirewallPolicyMetadata 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 policy, returned by operations
-- like create and describe. You can use the information provided in the
-- metadata to retrieve and manage a firewall policy. You can retrieve all
-- objects for a firewall policy by calling DescribeFirewallPolicy.
--
-- /See:/ 'newFirewallPolicyMetadata' smart constructor.
data FirewallPolicyMetadata = FirewallPolicyMetadata'
  { -- | The Amazon Resource Name (ARN) of the firewall policy.
    FirewallPolicyMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The descriptive name of the firewall policy. You can\'t change the name
    -- of a firewall policy after you create it.
    FirewallPolicyMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool
(FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool)
-> (FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool)
-> Eq FirewallPolicyMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool
$c/= :: FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool
== :: FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool
$c== :: FirewallPolicyMetadata -> FirewallPolicyMetadata -> Bool
Prelude.Eq, ReadPrec [FirewallPolicyMetadata]
ReadPrec FirewallPolicyMetadata
Int -> ReadS FirewallPolicyMetadata
ReadS [FirewallPolicyMetadata]
(Int -> ReadS FirewallPolicyMetadata)
-> ReadS [FirewallPolicyMetadata]
-> ReadPrec FirewallPolicyMetadata
-> ReadPrec [FirewallPolicyMetadata]
-> Read FirewallPolicyMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallPolicyMetadata]
$creadListPrec :: ReadPrec [FirewallPolicyMetadata]
readPrec :: ReadPrec FirewallPolicyMetadata
$creadPrec :: ReadPrec FirewallPolicyMetadata
readList :: ReadS [FirewallPolicyMetadata]
$creadList :: ReadS [FirewallPolicyMetadata]
readsPrec :: Int -> ReadS FirewallPolicyMetadata
$creadsPrec :: Int -> ReadS FirewallPolicyMetadata
Prelude.Read, Int -> FirewallPolicyMetadata -> ShowS
[FirewallPolicyMetadata] -> ShowS
FirewallPolicyMetadata -> String
(Int -> FirewallPolicyMetadata -> ShowS)
-> (FirewallPolicyMetadata -> String)
-> ([FirewallPolicyMetadata] -> ShowS)
-> Show FirewallPolicyMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallPolicyMetadata] -> ShowS
$cshowList :: [FirewallPolicyMetadata] -> ShowS
show :: FirewallPolicyMetadata -> String
$cshow :: FirewallPolicyMetadata -> String
showsPrec :: Int -> FirewallPolicyMetadata -> ShowS
$cshowsPrec :: Int -> FirewallPolicyMetadata -> ShowS
Prelude.Show, (forall x. FirewallPolicyMetadata -> Rep FirewallPolicyMetadata x)
-> (forall x.
    Rep FirewallPolicyMetadata x -> FirewallPolicyMetadata)
-> Generic FirewallPolicyMetadata
forall x. Rep FirewallPolicyMetadata x -> FirewallPolicyMetadata
forall x. FirewallPolicyMetadata -> Rep FirewallPolicyMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FirewallPolicyMetadata x -> FirewallPolicyMetadata
$cfrom :: forall x. FirewallPolicyMetadata -> Rep FirewallPolicyMetadata x
Prelude.Generic)

-- |
-- Create a value of 'FirewallPolicyMetadata' 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:
--
-- 'arn', 'firewallPolicyMetadata_arn' - The Amazon Resource Name (ARN) of the firewall policy.
--
-- 'name', 'firewallPolicyMetadata_name' - The descriptive name of the firewall policy. You can\'t change the name
-- of a firewall policy after you create it.
newFirewallPolicyMetadata ::
  FirewallPolicyMetadata
newFirewallPolicyMetadata :: FirewallPolicyMetadata
newFirewallPolicyMetadata =
  FirewallPolicyMetadata' :: Maybe Text -> Maybe Text -> FirewallPolicyMetadata
FirewallPolicyMetadata'
    { $sel:arn:FirewallPolicyMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:FirewallPolicyMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance Prelude.Hashable FirewallPolicyMetadata

instance Prelude.NFData FirewallPolicyMetadata