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