{-# 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 #-}
module Amazonka.NetworkFirewall.Types.FirewallPolicyMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FirewallPolicyMetadata = FirewallPolicyMetadata'
{
FirewallPolicyMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
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)
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
}
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)
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